mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Do not add DH padding on failure.
This commit is contained in:
@ -2344,14 +2344,14 @@ static int SetupKeys(const byte* input, int* sslBytes, SnifferSession* session,
|
|||||||
} while (ret == WC_PENDING_E);
|
} while (ret == WC_PENDING_E);
|
||||||
|
|
||||||
wc_FreeDhKey(&dhKey);
|
wc_FreeDhKey(&dhKey);
|
||||||
|
|
||||||
|
|
||||||
#ifdef WOLFSSL_SNIFFER_STATS
|
#ifdef WOLFSSL_SNIFFER_STATS
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
INC_STAT(SnifferStats.sslKeyFails);
|
INC_STAT(SnifferStats.sslKeyFails);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* left-padded with zeros up to the size of the prime */
|
/* left-padded with zeros up to the size of the prime */
|
||||||
if (params->p_len > session->sslServer->arrays->preMasterSz) {
|
if (ret == 0 && params->p_len > session->sslServer->arrays->preMasterSz) {
|
||||||
word32 diff = params->p_len - session->sslServer->arrays->preMasterSz;
|
word32 diff = params->p_len - session->sslServer->arrays->preMasterSz;
|
||||||
XMEMMOVE(session->sslServer->arrays->preMasterSecret + diff,
|
XMEMMOVE(session->sslServer->arrays->preMasterSecret + diff,
|
||||||
session->sslServer->arrays->preMasterSecret,
|
session->sslServer->arrays->preMasterSecret,
|
||||||
|
Reference in New Issue
Block a user