]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshecc.c
Cross-reference all the host key docs.
[PuTTY.git] / sshecc.c
index 541dd63cdb885b9b645be8aa41c9d4ac6dcfbcc8..46e6fadbec500c077e886ff01c64f074f8b56139 100644 (file)
--- a/sshecc.c
+++ b/sshecc.c
@@ -2268,6 +2268,7 @@ static int ecdsa_verifysig(void *key, const char *sig, int siglen,
     }
 
     getstring(&sig, &siglen, &p, &slen);
+    if (!p) return 0;
     if (ec->publicKey.curve->type == EC_EDWARDS) {
         struct ec_point *r;
         Bignum s, h;
@@ -2760,10 +2761,7 @@ void *ssh_ecdhkex_newkey(const struct ssh_kex *kex)
         bytes[31] &= 127;
         bytes[31] |= 64;
         key->privateKey = bignum_from_bytes(bytes, sizeof(bytes));
-        for (i = 0; i < sizeof(bytes); ++i)
-        {
-            ((volatile char*)bytes)[i] = 0;
-        }
+        smemclr(bytes, sizeof(bytes));
         if (!key->privateKey) {
             sfree(key);
             return NULL;
@@ -2939,6 +2937,9 @@ const unsigned char *ec_alg_oid(const struct ssh_signkey *alg,
     return extra->oid;
 }
 
+const int ec_nist_curve_lengths[] = { 256, 384, 521 };
+const int n_ec_nist_curve_lengths = lenof(ec_nist_curve_lengths);
+
 const int ec_nist_alg_and_curve_by_bits(int bits,
                                         const struct ec_curve **curve,
                                         const struct ssh_signkey **alg)