From e5528bd6cf629088862c1f62a90df7700fd0d51b Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 17 May 2024 16:18:47 -0700 Subject: [PATCH] Merge pull request #694 from JacobBarthelmeh/544 Key completion callback --- src/internal.c | 10 ++++++++++ src/ssh.c | 1 + 2 files changed, 11 insertions(+) diff --git a/src/internal.c b/src/internal.c index d7b8eb63f..9bdd5783a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -3673,6 +3673,7 @@ static INLINE byte KeySzForId(byte id) } enum wc_HashType HashForId(byte id) +INLINE enum wc_HashType HashForId(byte id) { switch (id) { @@ -5677,6 +5678,15 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx) * length which is at LENGTH_SZ offset ahead of pubKey. */ ret = HashUpdate(hash, hashId, pubKey - LENGTH_SZ, pubKeySz + LENGTH_SZ); + ssh->rxCount = 0; + ssh->highwaterFlag = 0; + ssh->isKeying = 0; + HandshakeInfoFree(ssh->handshake, ssh->ctx->heap); + ssh->handshake = NULL; + WLOG(WS_LOG_DEBUG, "Keying completed"); + + if (ssh->ctx->keyingCompletionCb) + ssh->ctx->keyingCompletionCb(ssh->keyingCompletionCtx); } if (ret == WS_SUCCESS) diff --git a/src/ssh.c b/src/ssh.c index e25037925..3fa154f6f 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -2995,6 +2995,7 @@ size_t wolfSSH_GetText(WOLFSSH *ssh, WS_Text id, char *str, size_t strSz) #ifndef WOLFSSH_NO_ECDH_NISTP256_KYBER_LEVEL1_SHA256 case ID_ECDH_NISTP256_KYBER_LEVEL1_SHA256: ret = WSNPRINTF(str, strSz, "%s", "ECDH-KYBER512"); + ret = WSNPRINTF(str, strSz, "%s", "Kyber1"); break; #endif