X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshrsa.c;h=e565a64ac791ff7be104a17f27814f4962f32fc7;hb=805ef41152db7309987981eb1ba4d914ab6eae6f;hp=32694456878fb1d16f42f3b081513ed50ed62409;hpb=870ad6ab0780c68e0e71d1a14d394aa543a8b89e;p=PuTTY.git diff --git a/sshrsa.c b/sshrsa.c index 32694456..e565a64a 100644 --- a/sshrsa.c +++ b/sshrsa.c @@ -773,6 +773,8 @@ static int rsa2_pubkey_bits(const struct ssh_signkey *self, int ret; rsa = rsa2_newkey(self, (const char *) blob, len); + if (!rsa) + return -1; ret = bignum_bitcount(rsa->modulus); rsa2_freekey(rsa); @@ -917,7 +919,8 @@ const struct ssh_signkey ssh_rsa = { rsa2_verifysig, rsa2_sign, "ssh-rsa", - "rsa2" + "rsa2", + NULL, }; void *ssh_rsakex_newkey(char *data, int len) @@ -1057,11 +1060,11 @@ void ssh_rsakex_encrypt(const struct ssh_hash *h, unsigned char *in, int inlen, } static const struct ssh_kex ssh_rsa_kex_sha1 = { - "rsa1024-sha1", NULL, KEXTYPE_RSA, NULL, NULL, 0, 0, &ssh_sha1 + "rsa1024-sha1", NULL, KEXTYPE_RSA, &ssh_sha1, NULL, }; static const struct ssh_kex ssh_rsa_kex_sha256 = { - "rsa2048-sha256", NULL, KEXTYPE_RSA, NULL, NULL, 0, 0, &ssh_sha256 + "rsa2048-sha256", NULL, KEXTYPE_RSA, &ssh_sha256, NULL, }; static const struct ssh_kex *const rsa_kex_list[] = {