diff options
author | Simo Sorce <simo@redhat.com> | 2019-03-12 18:24:36 -0400 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-04-04 08:00:15 +0200 |
commit | 2f38af1559691e6151c60533848479e96e8965bb (patch) | |
tree | 4f2af76f29a1c0ff912458b0348f6bb8781999bb /src/kex.c | |
parent | 997fe4d418eafff8ace27e07141bdb5e4dee1753 (diff) | |
download | libssh-2f38af1559691e6151c60533848479e96e8965bb.tar.gz libssh-2f38af1559691e6151c60533848479e96e8965bb.tar.xz libssh-2f38af1559691e6151c60533848479e96e8965bb.zip |
dh: Rename variables for DH key exchange
Rename and refactor how some variables are held in ssh_crypto_struct.
Refactor allocation of dh exchange public keys.
This is in preparation for switching the code to use openssl native DH
handling and allowed to better reason about the code and the overall API.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/kex.c')
-rw-r--r-- | src/kex.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1123,8 +1123,8 @@ int ssh_make_sessionid(ssh_session session) case SSH_KEX_DH_GROUP18_SHA512: rc = ssh_buffer_pack(buf, "BB", - session->next_crypto->e, - session->next_crypto->f); + session->next_crypto->dh_ctx->client.pub_key, + session->next_crypto->dh_ctx->server.pub_key); if (rc != SSH_OK) { goto error; } @@ -1137,10 +1137,10 @@ int ssh_make_sessionid(ssh_session session) session->next_crypto->dh_pmin, session->next_crypto->dh_pn, session->next_crypto->dh_pmax, - session->next_crypto->p, - session->next_crypto->g, - session->next_crypto->e, - session->next_crypto->f); + session->next_crypto->dh_ctx->modulus, + session->next_crypto->dh_ctx->generator, + session->next_crypto->dh_ctx->client.pub_key, + session->next_crypto->dh_ctx->server.pub_key); if (rc != SSH_OK) { goto error; } @@ -1180,7 +1180,7 @@ int ssh_make_sessionid(ssh_session session) break; #endif } - rc = ssh_buffer_pack(buf, "B", session->next_crypto->k); + rc = ssh_buffer_pack(buf, "B", session->next_crypto->shared_secret); if (rc != SSH_OK) { goto error; } @@ -1365,7 +1365,7 @@ int ssh_generate_session_keys(ssh_session session) size_t intkey_srv_to_cli_len = 0; int rc = -1; - k_string = ssh_make_bignum_string(crypto->k); + k_string = ssh_make_bignum_string(crypto->shared_secret); if (k_string == NULL) { ssh_set_error_oom(session); goto error; |