diff dropbearkey.c @ 807:75509065db53 ecc

have separate ecdsa keys for each size fix crash from the mp_alloc_init_multi change in RSA
author Matt Johnston <matt@ucc.asn.au>
date Sat, 25 May 2013 00:54:19 +0800
parents c344607b7341
children 5128e525c8fa
line wrap: on
line diff
--- a/dropbearkey.c	Thu May 23 22:18:33 2013 +0800
+++ b/dropbearkey.c	Sat May 25 00:54:19 2013 +0800
@@ -266,8 +266,11 @@
 #endif
 #ifdef DROPBEAR_ECDSA
 		case DROPBEAR_SIGNKEY_ECDSA_KEYGEN:
-			key->ecckey = gen_ecdsa_priv_key(bits);
-			keytype = ecdsa_signkey_type(key->ecckey);
+			{
+				ecc_key *ecckey = gen_ecdsa_priv_key(bits);
+				keytype = ecdsa_signkey_type(ecckey);
+				*signkey_ecc_key_ptr(key, keytype) = ecckey;
+			}
 			break;
 #endif
 		default: