mirror of
https://github.com/mkj/dropbear.git
synced 2025-12-20 02:17:46 +08:00
Fix incorrect naming of ec_qs
Change to q_s and q_c since pqhybrid isn't only EC.
This commit is contained in:
@@ -45,14 +45,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
unsigned int e = buf_getint(fuzz.input);
|
||||
struct kex_curve25519_param *curve25519_param = curve25519_params[e % NUM_PARAMS];
|
||||
|
||||
buffer * ecdh_qs = buf_getstringbuf(fuzz.input);
|
||||
buffer * ecdh_qc = buf_getstringbuf(fuzz.input);
|
||||
|
||||
ses.kexhashbuf = buf_new(KEXHASHBUF_MAX_INTS);
|
||||
kexcurve25519_comb_key(curve25519_param, ecdh_qs, svr_opts.hostkey);
|
||||
kexcurve25519_comb_key(curve25519_param, ecdh_qc, svr_opts.hostkey);
|
||||
|
||||
mp_clear(ses.dh_K);
|
||||
m_free(ses.dh_K);
|
||||
buf_free(ecdh_qs);
|
||||
buf_free(ecdh_qc);
|
||||
|
||||
buf_free(ses.hash);
|
||||
buf_free(ses.session_id);
|
||||
|
||||
@@ -58,14 +58,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
unsigned int e = buf_getint(fuzz.input);
|
||||
struct kex_ecdh_param *ecdh_param = ecdh_params[e % NUM_PARAMS];
|
||||
|
||||
buffer * ecdh_qs = buf_getstringbuf(fuzz.input);
|
||||
buffer * ecdh_qc = buf_getstringbuf(fuzz.input);
|
||||
|
||||
ses.kexhashbuf = buf_new(KEXHASHBUF_MAX_INTS);
|
||||
kexecdh_comb_key(ecdh_param, ecdh_qs, svr_opts.hostkey);
|
||||
kexecdh_comb_key(ecdh_param, ecdh_qc, svr_opts.hostkey);
|
||||
|
||||
mp_clear(ses.dh_K);
|
||||
m_free(ses.dh_K);
|
||||
buf_free(ecdh_qs);
|
||||
buf_free(ecdh_qc);
|
||||
|
||||
buf_free(ses.hash);
|
||||
buf_free(ses.session_id);
|
||||
|
||||
@@ -186,9 +186,9 @@ void recv_msg_kexdh_reply() {
|
||||
#if DROPBEAR_PQHYBRID
|
||||
case DROPBEAR_KEX_PQHYBRID:
|
||||
{
|
||||
buffer *ecdh_qs = buf_getstringbuf(ses.payload);
|
||||
kexpqhybrid_comb_key(cli_ses.pqhybrid_param, ecdh_qs, hostkey);
|
||||
buf_free(ecdh_qs);
|
||||
buffer *q_s = buf_getstringbuf(ses.payload);
|
||||
kexpqhybrid_comb_key(cli_ses.pqhybrid_param, q_s, hostkey);
|
||||
buf_free(q_s);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "ecc.h"
|
||||
#include "gensignkey.h"
|
||||
|
||||
static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs);
|
||||
static void send_msg_kexdh_reply(mp_int *dh_e, buffer *q_c);
|
||||
#if DROPBEAR_EXT_INFO
|
||||
static void send_msg_ext_info(void);
|
||||
#endif
|
||||
@@ -48,7 +48,7 @@ static void send_msg_ext_info(void);
|
||||
* that function, then brings the new keys into use */
|
||||
void recv_msg_kexdh_init() {
|
||||
DEF_MP_INT(dh_e);
|
||||
buffer *ecdh_qs = NULL;
|
||||
buffer *q_c = NULL;
|
||||
|
||||
TRACE(("enter recv_msg_kexdh_init"))
|
||||
if (!ses.kexstate.recvkexinit) {
|
||||
@@ -74,7 +74,7 @@ void recv_msg_kexdh_init() {
|
||||
case DROPBEAR_KEX_PQHYBRID:
|
||||
#endif
|
||||
#if DROPBEAR_ECDH || DROPBEAR_CURVE25519 || DROPBEAR_PQHYBRID
|
||||
ecdh_qs = buf_getstringbuf(ses.payload);
|
||||
q_c = buf_getstringbuf(ses.payload);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -82,12 +82,12 @@ void recv_msg_kexdh_init() {
|
||||
dropbear_exit("Bad kex value");
|
||||
}
|
||||
|
||||
send_msg_kexdh_reply(&dh_e, ecdh_qs);
|
||||
send_msg_kexdh_reply(&dh_e, q_c);
|
||||
|
||||
mp_clear(&dh_e);
|
||||
if (ecdh_qs) {
|
||||
buf_free(ecdh_qs);
|
||||
ecdh_qs = NULL;
|
||||
if (q_c) {
|
||||
buf_free(q_c);
|
||||
q_c = NULL;
|
||||
}
|
||||
|
||||
send_msg_newkeys();
|
||||
@@ -189,7 +189,7 @@ out:
|
||||
*
|
||||
* See the transport RFC4253 section 8 for details
|
||||
* or RFC5656 section 4 for elliptic curve variant. */
|
||||
static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) {
|
||||
static void send_msg_kexdh_reply(mp_int *dh_e, buffer *q_c) {
|
||||
TRACE(("enter send_msg_kexdh_reply"))
|
||||
|
||||
/* we can start creating the kexdh_reply packet */
|
||||
@@ -230,7 +230,7 @@ static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) {
|
||||
case DROPBEAR_KEX_ECDH:
|
||||
{
|
||||
struct kex_ecdh_param *ecdh_param = gen_kexecdh_param();
|
||||
kexecdh_comb_key(ecdh_param, ecdh_qs, svr_opts.hostkey);
|
||||
kexecdh_comb_key(ecdh_param, q_c, svr_opts.hostkey);
|
||||
|
||||
buf_put_ecc_raw_pubkey_string(ses.writepayload, &ecdh_param->key);
|
||||
free_kexecdh_param(ecdh_param);
|
||||
@@ -241,7 +241,7 @@ static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) {
|
||||
case DROPBEAR_KEX_CURVE25519:
|
||||
{
|
||||
struct kex_curve25519_param *param = gen_kexcurve25519_param();
|
||||
kexcurve25519_comb_key(param, ecdh_qs, svr_opts.hostkey);
|
||||
kexcurve25519_comb_key(param, q_c, svr_opts.hostkey);
|
||||
|
||||
buf_putstring(ses.writepayload, param->pub, CURVE25519_LEN);
|
||||
free_kexcurve25519_param(param);
|
||||
@@ -252,7 +252,7 @@ static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) {
|
||||
case DROPBEAR_KEX_PQHYBRID:
|
||||
{
|
||||
struct kex_pqhybrid_param *param = gen_kexpqhybrid_param();
|
||||
kexpqhybrid_comb_key(param, ecdh_qs, svr_opts.hostkey);
|
||||
kexpqhybrid_comb_key(param, q_c, svr_opts.hostkey);
|
||||
|
||||
buf_putbufstring(ses.writepayload, param->concat_public);
|
||||
free_kexpqhybrid_param(param);
|
||||
|
||||
Reference in New Issue
Block a user