X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshecc.c;h=46e6fadbec500c077e886ff01c64f074f8b56139;hb=15386cbe927fc85ac2fed0bb47704645c4b67dad;hp=541dd63cdb885b9b645be8aa41c9d4ac6dcfbcc8;hpb=0629f1dfa53fe63bce41eaefd9358ea8c7227eeb;p=PuTTY.git diff --git a/sshecc.c b/sshecc.c index 541dd63c..46e6fadb 100644 --- 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)