aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-07-13 22:56:07 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2013-07-13 22:56:07 +0200
commitdd6a0b51acea0e7b24eea800fd27b3f96c0ed8cb (patch)
treebd0d7e850aa66722a7b4ca1f3b6912d23119b167 /src/pki.c
parent3b81da21c2a515cac146bdf164ccc32ad83fc069 (diff)
downloadlibssh-dd6a0b51acea0e7b24eea800fd27b3f96c0ed8cb.tar.gz
libssh-dd6a0b51acea0e7b24eea800fd27b3f96c0ed8cb.tar.xz
libssh-dd6a0b51acea0e7b24eea800fd27b3f96c0ed8cb.zip
Server: fix rekeying
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pki.c b/src/pki.c
index a3616c2f..10998270 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1381,18 +1381,18 @@ ssh_string ssh_srv_pki_do_sign_sessionid(ssh_session session,
if (session == NULL || privkey == NULL || !ssh_key_is_private(privkey)) {
return NULL;
}
- crypto = session->current_crypto ? session->current_crypto :
- session->next_crypto;
+ crypto = session->next_crypto ? session->next_crypto :
+ session->current_crypto;
ctx = sha1_init();
if (ctx == NULL) {
return NULL;
}
- if (crypto->session_id == NULL){
- ssh_set_error(session,SSH_FATAL,"Missing session_id");
+ if (crypto->secret_hash == NULL){
+ ssh_set_error(session,SSH_FATAL,"Missing secret_hash");
return NULL;
}
- sha1_update(ctx, crypto->session_id, crypto->digest_len);
+ sha1_update(ctx, crypto->secret_hash, crypto->digest_len);
sha1_final(hash, ctx);
#ifdef DEBUG_CRYPTO