X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshecc.c;h=541dd63cdb885b9b645be8aa41c9d4ac6dcfbcc8;hb=5471539a6738484b48fb938c88dce547a3e4b299;hp=9f188df89b5cc27622cd73f1a031d098e292d18b;hpb=f69b371bcd476a084639cddfb5cddfd3765413bc;p=PuTTY.git diff --git a/sshecc.c b/sshecc.c index 9f188df8..541dd63c 100644 --- a/sshecc.c +++ b/sshecc.c @@ -1648,6 +1648,7 @@ static int decodepoint_ed(const char *p, int length, struct ec_point *point) /* Read x bit and then reset it */ negative = bignum_bit(point->y, point->curve->fieldBits - 1); bignum_set_bit(point->y, point->curve->fieldBits - 1, 0); + bn_restore_invariant(point->y); /* Get the x from the y */ point->x = ecp_edx(point->curve, point->y); @@ -1782,11 +1783,11 @@ static void *ecdsa_newkey(const struct ssh_signkey *self, ec->publicKey.x = NULL; ec->publicKey.y = NULL; ec->publicKey.z = NULL; + ec->privateKey = NULL; if (!getmppoint(&data, &len, &ec->publicKey)) { ecdsa_freekey(ec); return NULL; } - ec->privateKey = NULL; if (!ec->publicKey.x || !ec->publicKey.y || bignum_cmp(ec->publicKey.x, curve->p) >= 0 ||