]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshrsa.c
first pass
[PuTTY.git] / sshrsa.c
index 32694456878fb1d16f42f3b081513ed50ed62409..e565a64ac791ff7be104a17f27814f4962f32fc7 100644 (file)
--- 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[] = {