mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
This commit is contained in:
@ -3119,6 +3119,12 @@ int SetKeysSide(WOLFSSL* ssl, enum encrypt_side side)
|
||||
if (copy) {
|
||||
int clientCopy = 0;
|
||||
|
||||
/* Sanity check that keys == ssl->secure_renegotiation->tmp_keys.
|
||||
* Otherwise the memcpy calls would copy overlapping memory
|
||||
* and cause UB. Fail early. */
|
||||
if (keys == &ssl->keys)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (ssl->options.side == WOLFSSL_CLIENT_END && wc_encrypt)
|
||||
clientCopy = 1;
|
||||
else if (ssl->options.side == WOLFSSL_SERVER_END && wc_decrypt)
|
||||
|
Reference in New Issue
Block a user