]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Avoid trying to take the modular inverse of zero in response to a
authorSimon Tatham <anakin@pobox.com>
Sun, 4 Aug 2013 19:34:00 +0000 (19:34 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 4 Aug 2013 19:34:00 +0000 (19:34 +0000)
sufficiently silly DSA signature.

[originally from svn r9989]

sshdss.c

index bf6c3ba5045c33b43840c47bf79aa964da04a2fb..3ea36952b503882a89c80a7a7a76775a55c54f78 100644 (file)
--- a/sshdss.c
+++ b/sshdss.c
@@ -276,6 +276,12 @@ static int dss_verifysig(void *key, char *sig, int siglen,
        return 0;
     }
 
+    if (!bignum_cmp(s, Zero)) {
+        freebn(r);
+        freebn(s);
+        return 0;
+    }
+
     /*
      * Step 1. w <- s^-1 mod q.
      */