mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 22:10:52 +02:00
evp: check ivLen in wolfSSL_EVP_CIPHER_CTX_set_iv_length.
This commit is contained in:
+8
-3
@@ -8449,10 +8449,15 @@ void wolfSSL_EVP_init(void)
|
||||
int ivLen)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_EVP_CIPHER_CTX_set_iv_length");
|
||||
if (ctx)
|
||||
ctx->ivSz= ivLen;
|
||||
else
|
||||
if (ctx == NULL) {
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
||||
if (ivLen < 0 || ivLen > (int) sizeof(ctx->iv)) {
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
||||
ctx->ivSz = ivLen;
|
||||
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user