aboutsummaryrefslogtreecommitdiff
path: root/src/kex.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2019-03-12 18:24:36 -0400
committerAndreas Schneider <asn@cryptomilk.org>2019-04-04 08:00:15 +0200
commit2f38af1559691e6151c60533848479e96e8965bb (patch)
tree4f2af76f29a1c0ff912458b0348f6bb8781999bb /src/kex.c
parent997fe4d418eafff8ace27e07141bdb5e4dee1753 (diff)
downloadlibssh-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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kex.c b/src/kex.c
index 750996b3..618ec88e 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -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;