Stop raising ERR_R_MALLOC_FAILURE in most places
[openssl.git] / providers / implementations / ciphers / cipher_aes_xts.c
index 5cfb22778ec4b7daf60e2105dbafd9e7ced25350..ecd9f02ac2d715d3247773390c1fabf6bb57b525 100644 (file)
@@ -54,7 +54,7 @@ static OSSL_FUNC_cipher_settable_ctx_params_fn aes_xts_settable_ctx_params;
 static int aes_xts_check_keys_differ(const unsigned char *key, size_t bytes,
                                      int enc)
 {
-    if ((!allow_insecure_decrypt || enc)
+    if ((!ossl_aes_xts_allow_insecure_decrypt || enc)
             && CRYPTO_memcmp(key, key + bytes, bytes) == 0) {
         ERR_raise(ERR_LIB_PROV, PROV_R_XTS_DUPLICATED_KEYS);
         return 0;
@@ -146,10 +146,8 @@ static void *aes_xts_dupctx(void *vctx)
             return NULL;
     }
     ret = OPENSSL_malloc(sizeof(*ret));
-    if (ret == NULL) {
-        ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
+    if (ret == NULL)
         return NULL;
-    }
     in->base.hw->copyctx(&ret->base, &in->base);
     return ret;
 }