]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Verify RSA keys created by rsa2_openssh_createkey.
authorSimon Tatham <anakin@pobox.com>
Fri, 2 Aug 2013 06:28:05 +0000 (06:28 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 2 Aug 2013 06:28:05 +0000 (06:28 +0000)
[originally from svn r9980]

sshrsa.c

index 11c488e819e8f2585daf3f26495a5847e4e4a179..078536467664ce2f5952ae686f978808db8b39aa 100644 (file)
--- a/sshrsa.c
+++ b/sshrsa.c
@@ -711,6 +711,11 @@ static void *rsa2_openssh_createkey(unsigned char **blob, int *len)
        return NULL;
     }
 
+    if (!rsa_verify(rsa)) {
+       rsa2_freekey(rsa);
+       return NULL;
+    }
+
     return rsa;
 }