mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-13 17:17:37 -05:00
Added a command-line key generation tool. Currently builds and runs
on Linux, but the (very few) platform-specific bits are already abstracted out of the main code, so it should port to other platforms with a minimum of fuss. [originally from svn r3762]
This commit is contained in:
13
sshrsa.c
13
sshrsa.c
@ -629,6 +629,18 @@ static int rsa2_openssh_fmtkey(void *key, unsigned char *blob, int len)
|
||||
return bloblen;
|
||||
}
|
||||
|
||||
static int rsa2_pubkey_bits(void *blob, int len)
|
||||
{
|
||||
struct RSAKey *rsa;
|
||||
int ret;
|
||||
|
||||
rsa = rsa2_newkey((char *) blob, len);
|
||||
ret = bignum_bitcount(rsa->modulus);
|
||||
rsa2_freekey(rsa);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *rsa2_fingerprint(void *key)
|
||||
{
|
||||
struct RSAKey *rsa = (struct RSAKey *) key;
|
||||
@ -794,6 +806,7 @@ const struct ssh_signkey ssh_rsa = {
|
||||
rsa2_createkey,
|
||||
rsa2_openssh_createkey,
|
||||
rsa2_openssh_fmtkey,
|
||||
rsa2_pubkey_bits,
|
||||
rsa2_fingerprint,
|
||||
rsa2_verifysig,
|
||||
rsa2_sign,
|
||||
|
Reference in New Issue
Block a user