Mercurial > dropbear
comparison svr-kex.c @ 1659:d32bcb5c557d
Add Ed25519 support (#91)
* Add support for Ed25519 as a public key type
Ed25519 is a elliptic curve signature scheme that offers
better security than ECDSA and DSA and good performance. It may be
used for both user and host keys.
OpenSSH key import and fuzzer are not supported yet.
Initially inspired by Peter Szabo.
* Add curve25519 and ed25519 fuzzers
* Add import and export of Ed25519 keys
author | Vladislav Grishenko <themiron@users.noreply.github.com> |
---|---|
date | Wed, 11 Mar 2020 21:09:45 +0500 |
parents | 2f64cb3d3007 |
children | ba6fc7afe1c5 |
comparison
equal
deleted
inserted
replaced
1658:7402218141d4 | 1659:d32bcb5c557d |
---|---|
121 case DROPBEAR_SIGNKEY_ECDSA_NISTP384: | 121 case DROPBEAR_SIGNKEY_ECDSA_NISTP384: |
122 case DROPBEAR_SIGNKEY_ECDSA_NISTP521: | 122 case DROPBEAR_SIGNKEY_ECDSA_NISTP521: |
123 fn = ECDSA_PRIV_FILENAME; | 123 fn = ECDSA_PRIV_FILENAME; |
124 break; | 124 break; |
125 #endif | 125 #endif |
126 #if DROPBEAR_ED25519 | |
127 case DROPBEAR_SIGNKEY_ED25519: | |
128 fn = ED25519_PRIV_FILENAME; | |
129 break; | |
130 #endif | |
126 default: | 131 default: |
127 dropbear_assert(0); | 132 dropbear_assert(0); |
128 } | 133 } |
129 | 134 |
130 if (readhostkey(fn, svr_opts.hostkey, &type) == DROPBEAR_SUCCESS) { | 135 if (readhostkey(fn, svr_opts.hostkey, &type) == DROPBEAR_SUCCESS) { |
217 #if DROPBEAR_CURVE25519 | 222 #if DROPBEAR_CURVE25519 |
218 case DROPBEAR_KEX_CURVE25519: | 223 case DROPBEAR_KEX_CURVE25519: |
219 { | 224 { |
220 struct kex_curve25519_param *param = gen_kexcurve25519_param(); | 225 struct kex_curve25519_param *param = gen_kexcurve25519_param(); |
221 kexcurve25519_comb_key(param, ecdh_qs, svr_opts.hostkey); | 226 kexcurve25519_comb_key(param, ecdh_qs, svr_opts.hostkey); |
222 buf_putstring(ses.writepayload, (const char*)param->pub, CURVE25519_LEN); | 227 |
228 buf_putstring(ses.writepayload, param->pub, CURVE25519_LEN); | |
223 free_kexcurve25519_param(param); | 229 free_kexcurve25519_param(param); |
224 } | 230 } |
225 break; | 231 break; |
226 #endif | 232 #endif |
227 } | 233 } |