]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/evp_lib.c
Add gcm ciphers (aes and aria) to providers.
[thirdparty/openssl.git] / crypto / evp / evp_lib.c
index e6daf684bebeb9f50b8ec50f0effd292e37ffc33..d112eaf65a3e6d00c5db005dababaaa09ee31850 100644 (file)
@@ -315,7 +315,13 @@ int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
 
 int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
 {
-    return EVP_CIPHER_iv_length(ctx->cipher);
+    int ok, v = EVP_CIPHER_iv_length(ctx->cipher);
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    params[0] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_IVLEN, &v);
+    ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->provctx, params);
+
+    return ok != 0 ? v : -1;
 }
 
 const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx)