mirror of
https://github.com/openssl/openssl.git
synced 2024-12-03 23:14:37 +08:00
Avoid deprecated function in evp_lib.c
Use EVP_CIPHER_CTX_get_iv() to implement EVP_CIPHER_set_asn1_iv(), rather than the deprecated EVP_CIPHER_CTX_original_iv(). Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12233)
This commit is contained in:
parent
2f5c405a16
commit
f43c947dd9
@ -203,10 +203,9 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
|
||||
{
|
||||
int i = 0;
|
||||
unsigned int j;
|
||||
unsigned char *oiv = NULL;
|
||||
unsigned char oiv[EVP_MAX_IV_LENGTH];
|
||||
|
||||
if (type != NULL) {
|
||||
oiv = (unsigned char *)EVP_CIPHER_CTX_original_iv(c);
|
||||
if (type != NULL && EVP_CIPHER_CTX_get_iv(c, oiv, sizeof(oiv))) {
|
||||
j = EVP_CIPHER_CTX_iv_length(c);
|
||||
OPENSSL_assert(j <= sizeof(c->iv));
|
||||
i = ASN1_TYPE_set_octetstring(type, oiv, j);
|
||||
|
Loading…
Reference in New Issue
Block a user