Mercurial > dropbear
comparison keyimport.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 | 71e7d31f7671 |
children | d7d9f1612d51 d4ce5269a439 |
comparison
equal
deleted
inserted
replaced
806:71e7d31f7671 | 807:75509065db53 |
---|---|
678 const char* ecdsa_name; | 678 const char* ecdsa_name; |
679 unsigned char* private_key_bytes = NULL; | 679 unsigned char* private_key_bytes = NULL; |
680 int private_key_len = 0; | 680 int private_key_len = 0; |
681 unsigned char* public_key_bytes = NULL; | 681 unsigned char* public_key_bytes = NULL; |
682 int public_key_len = 0; | 682 int public_key_len = 0; |
683 ecc_key *ecc; | 683 ecc_key *ecc = NULL; |
684 const struct dropbear_ecc_curve *curve = NULL; | 684 const struct dropbear_ecc_curve *curve = NULL; |
685 | 685 |
686 // See SEC1 v2, Appendix C.4 | 686 // See SEC1 v2, Appendix C.4 |
687 // OpenSSL (so OpenSSH) seems to include the optional parts. | 687 // OpenSSL (so OpenSSH) seems to include the optional parts. |
688 | 688 |
772 != MP_OKAY) { | 772 != MP_OKAY) { |
773 errmsg = "Error parsing ECC key"; | 773 errmsg = "Error parsing ECC key"; |
774 goto error; | 774 goto error; |
775 } | 775 } |
776 | 776 |
777 retkey->ecckey = ecc; | 777 *signkey_ecc_key_ptr(retkey, retkey->type) = ecc; |
778 } | 778 } |
779 #endif // DROPBEAR_ECDSA | 779 #endif // DROPBEAR_ECDSA |
780 | 780 |
781 /* | 781 /* |
782 * Now put together the actual key. Simplest way to do this is | 782 * Now put together the actual key. Simplest way to do this is |