prov: prefix all OSSL_DISPATCH tables names with ossl_
[openssl.git] / providers / implementations / ciphers / cipher_tdes_wrap.c
index 73d00a58d53acad2a219ee05c4464a4480c00f72..9007e403a4ce671679109ee1e63eb0a92fbbb22a 100644 (file)
@@ -18,6 +18,7 @@
 #include "cipher_tdes_default.h"
 #include "crypto/evp.h"
 #include "prov/implementations.h"
+#include "prov/providercommon.h"
 #include "prov/providercommonerr.h"
 
 /* TODO (3.0) Figure out what flags are required */
@@ -133,6 +134,9 @@ static int tdes_wrap_cipher(void *vctx,
     int ret;
 
     *outl = 0;
+    if (!ossl_prov_is_running())
+        return 0;
+
     if (outsize < inl) {
         PROVerr(0, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
         return 0;
@@ -179,7 +183,7 @@ static int tdes_wrap_get_params(OSSL_PARAM params[])                           \
     return cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags,        \
                                      kbits, blkbits, ivbits);                  \
 }                                                                              \
-const OSSL_DISPATCH tdes_wrap_cbc_functions[] =                                \
+const OSSL_DISPATCH ossl_tdes_wrap_cbc_functions[] =                           \
 {                                                                              \
     { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void)) tdes_einit },            \
     { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void)) tdes_dinit },            \
@@ -201,5 +205,5 @@ const OSSL_DISPATCH tdes_wrap_cbc_functions[] =                                \
     { 0, NULL }                                                                \
 }
 
-/* tdes_wrap_cbc_functions */
+/* ossl_tdes_wrap_cbc_functions */
 IMPLEMENT_WRAP_CIPHER(TDES_WRAP_FLAGS, 64*3, 64, 0);