Mercurial > dropbear
comparison ecdsa.c @ 855:04ede40a529a
- Some fixes for old compilers like tru64 v4 from Daniel Richard G.
- Don't warn about blocking random device for prngd
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 14 Nov 2013 21:36:45 +0800 |
parents | 7540c0822374 |
children | c19acba28590 |
comparison
equal
deleted
inserted
replaced
854:ccc76acaf4c7 | 855:04ede40a529a |
---|---|
34 return DROPBEAR_SIGNKEY_NONE; | 34 return DROPBEAR_SIGNKEY_NONE; |
35 } | 35 } |
36 | 36 |
37 ecc_key *gen_ecdsa_priv_key(unsigned int bit_size) { | 37 ecc_key *gen_ecdsa_priv_key(unsigned int bit_size) { |
38 const ltc_ecc_set_type *dp = NULL; // curve domain parameters | 38 const ltc_ecc_set_type *dp = NULL; // curve domain parameters |
39 ecc_key *new_key = NULL; | |
39 switch (bit_size) { | 40 switch (bit_size) { |
40 #ifdef DROPBEAR_ECC_256 | 41 #ifdef DROPBEAR_ECC_256 |
41 case 256: | 42 case 256: |
42 dp = ecc_curve_nistp256.dp; | 43 dp = ecc_curve_nistp256.dp; |
43 break; | 44 break; |
65 "521 " | 66 "521 " |
66 #endif | 67 #endif |
67 , bit_size); | 68 , bit_size); |
68 } | 69 } |
69 | 70 |
70 ecc_key *new_key = m_malloc(sizeof(*new_key)); | 71 new_key = m_malloc(sizeof(*new_key)); |
71 if (ecc_make_key_ex(NULL, dropbear_ltc_prng, new_key, dp) != CRYPT_OK) { | 72 if (ecc_make_key_ex(NULL, dropbear_ltc_prng, new_key, dp) != CRYPT_OK) { |
72 dropbear_exit("ECC error"); | 73 dropbear_exit("ECC error"); |
73 } | 74 } |
74 return new_key; | 75 return new_key; |
75 } | 76 } |