]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - sshecc.c
Log proxy host correctly in Event Log.
[PuTTY.git] / sshecc.c
index 46e6fadbec500c077e886ff01c64f074f8b56139..3ce6c7fe6ae07e19e3b0b35dfdba92398e1cf999 100644 (file)
--- a/sshecc.c
+++ b/sshecc.c
@@ -2029,10 +2029,10 @@ static void *ed25519_openssh_createkey(const struct ssh_signkey *self,
     }
 
     getstring((const char**)blob, len, &q, &qlen);
-    if (!q)
-        return NULL;
-    if (qlen != 64)
+    if (!q || qlen != 64) {
+        ecdsa_freekey(ec);
         return NULL;
+    }
 
     ec->privateKey = bignum_from_bytes_le((const unsigned char *)q, 32);
 
@@ -2760,7 +2760,7 @@ void *ssh_ecdhkex_newkey(const struct ssh_kex *kex)
         bytes[0] &= 248;
         bytes[31] &= 127;
         bytes[31] |= 64;
-        key->privateKey = bignum_from_bytes(bytes, sizeof(bytes));
+        key->privateKey = bignum_from_bytes_le(bytes, sizeof(bytes));
         smemclr(bytes, sizeof(bytes));
         if (!key->privateKey) {
             sfree(key);