1
0
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:
Simon Tatham
2004-01-22 19:15:32 +00:00
parent 7b140b2fe7
commit 2d1287b9ca
10 changed files with 1040 additions and 12 deletions

View File

@ -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,