Add ossl_provider symbols
authorShane Lontis <shane.lontis@oracle.com>
Tue, 9 Mar 2021 05:26:17 +0000 (15:26 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Thu, 18 Mar 2021 07:52:38 +0000 (17:52 +1000)
Partial fix for #12964

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14473)

12 files changed:
crypto/http/http_local.h
crypto/provider_core.c
crypto/provider_local.h
crypto/provider_predefined.c
providers/common/capabilities.c
providers/common/include/prov/providercommon.h
providers/defltprov.c
providers/fips/fipsprov.c
providers/implementations/ciphers/cipher_aes_xts.c
providers/implementations/ciphers/cipher_aes_xts.h
providers/implementations/ciphers/cipher_aes_xts_fips.c
test/curve448_internal_test.c

index 1dfa03ce8efac5cde2c0fdc58e32a05cc9605f88..3164f62a77668c65c6a2188ccc2e956501f66ad1 100644 (file)
@@ -14,6 +14,7 @@
 # include <openssl/ocsp.h>
 
 BIO *ossl_http_asn1_item2bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
+
 OSSL_HTTP_REQ_CTX
 *ossl_http_req_ctx_new(BIO *wbio, BIO *rbio, int use_http_proxy,
                        const char *server, const char *port,
index cd295809be4b875533f21614b55bd6a12a213d13..4d77108c3361fdecd28b6278d23de81175132c93 100644 (file)
@@ -157,7 +157,7 @@ static void *provider_store_new(OSSL_LIB_CTX *ctx)
     }
     store->use_fallbacks = 1;
 
-    for (p = predefined_providers; p->name != NULL; p++) {
+    for (p = ossl_predefined_providers; p->name != NULL; p++) {
         OSSL_PROVIDER *prov = NULL;
 
         /*
index e4c649a7361f36a2c48d0cb0f5dc18776531742c..b0130eadc5a3ae12f57364b5d4f671f4ce822c24 100644 (file)
@@ -15,4 +15,4 @@ struct predefined_providers_st {
     unsigned int is_fallback:1;
 };
 
-extern const struct predefined_providers_st predefined_providers[];
+extern const struct predefined_providers_st ossl_predefined_providers[];
index 6acf2ea1af9ad5909aeba20e37d609e59e711db4..cfb67d9fe34a89e78cfb5519594d135a859e6db0 100644 (file)
 OSSL_provider_init_fn ossl_default_provider_init;
 OSSL_provider_init_fn ossl_base_provider_init;
 OSSL_provider_init_fn ossl_null_provider_init;
-OSSL_provider_init_fn fips_intern_provider_init;
+OSSL_provider_init_fn ossl_fips_intern_provider_init;
 #ifdef STATIC_LEGACY
 OSSL_provider_init_fn ossl_legacy_provider_init;
 #endif
-const struct predefined_providers_st predefined_providers[] = {
+const struct predefined_providers_st ossl_predefined_providers[] = {
 #ifdef FIPS_MODULE
-    { "fips", fips_intern_provider_init, 1 },
+    { "fips", ossl_fips_intern_provider_init, 1 },
 #else
     { "default", ossl_default_provider_init, 1 },
 # ifdef STATIC_LEGACY
index d455d498ea3293b80c580c9586dd5fa8b1441507..781acae8db6f8cff6c4af9e7cd5ba36eec82d255 100644 (file)
@@ -214,8 +214,8 @@ static int tls_group_capability(OSSL_CALLBACK *cb, void *arg)
     return 1;
 }
 
-int provider_get_capabilities(void *provctx, const char *capability,
-                              OSSL_CALLBACK *cb, void *arg)
+int ossl_prov_get_capabilities(void *provctx, const char *capability,
+                               OSSL_CALLBACK *cb, void *arg)
 {
     if (strcasecmp(capability, "TLS-GROUP") == 0)
         return tls_group_capability(cb, arg);
index 33bd8bd732f6304820ba76e96e9f7450b84c76d3..6906554b0eae0ff16bf8f580b99b961c20e5c315 100644 (file)
@@ -15,7 +15,7 @@ const OSSL_CORE_HANDLE *FIPS_get_core_handle(OSSL_LIB_CTX *ctx);
 int ossl_cipher_capable_aes_cbc_hmac_sha1(void);
 int ossl_cipher_capable_aes_cbc_hmac_sha256(void);
 
-OSSL_FUNC_provider_get_capabilities_fn provider_get_capabilities;
+OSSL_FUNC_provider_get_capabilities_fn ossl_prov_get_capabilities;
 
 /* Set the error state if this is a FIPS module */
 void ossl_set_error_state(const char *type);
index 01e3f9ced41b157b0668bf628fcfb1241c5ce6bf..63e8f675099ae1611ea86b395cd924c3d03bf09e 100644 (file)
@@ -512,7 +512,8 @@ static const OSSL_DISPATCH deflt_dispatch_table[] = {
     { OSSL_FUNC_PROVIDER_GETTABLE_PARAMS, (void (*)(void))deflt_gettable_params },
     { OSSL_FUNC_PROVIDER_GET_PARAMS, (void (*)(void))deflt_get_params },
     { OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))deflt_query },
-    { OSSL_FUNC_PROVIDER_GET_CAPABILITIES, (void (*)(void))provider_get_capabilities },
+    { OSSL_FUNC_PROVIDER_GET_CAPABILITIES,
+      (void (*)(void))ossl_prov_get_capabilities },
     { 0, NULL }
 };
 
index 70826181e532a11f64cbdec4b80bed19fbcfdb53..56892aa4c82881c157d086b6c0b4fa9860e24455 100644 (file)
@@ -477,7 +477,7 @@ static const OSSL_DISPATCH fips_dispatch_table[] = {
     { OSSL_FUNC_PROVIDER_GET_PARAMS, (void (*)(void))fips_get_params },
     { OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))fips_query },
     { OSSL_FUNC_PROVIDER_GET_CAPABILITIES,
-      (void (*)(void))provider_get_capabilities },
+      (void (*)(void))ossl_prov_get_capabilities },
     { OSSL_FUNC_PROVIDER_SELF_TEST, (void (*)(void))fips_self_test },
     { 0, NULL }
 };
@@ -647,11 +647,11 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
  * the provider context of this inner instance with the same library context
  * that was used in the EVP call that initiated this recursive call.
  */
-OSSL_provider_init_fn fips_intern_provider_init;
-int fips_intern_provider_init(const OSSL_CORE_HANDLE *handle,
-                              const OSSL_DISPATCH *in,
-                              const OSSL_DISPATCH **out,
-                              void **provctx)
+OSSL_provider_init_fn ossl_fips_intern_provider_init;
+int ossl_fips_intern_provider_init(const OSSL_CORE_HANDLE *handle,
+                                   const OSSL_DISPATCH *in,
+                                   const OSSL_DISPATCH **out,
+                                   void **provctx)
 {
     OSSL_FUNC_core_get_libctx_fn *c_internal_get_libctx = NULL;
 
index 5cfb22778ec4b7daf60e2105dbafd9e7ced25350..dce2032986b175c9111eb9a540b943fd9b9638a4 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;
index 95b5c9074c11769a72d4b49e1a41bbebbaa5451c..8fca63bc4bfeffab3e2e8eaef002f271bf238a67 100644 (file)
@@ -15,7 +15,7 @@
  * Available in cipher_fips.c, and compiled with different values depending
  * on we're in the FIPS module or not.
  */
-extern const int allow_insecure_decrypt;
+extern const int ossl_aes_xts_allow_insecure_decrypt;
 
 PROV_CIPHER_FUNC(void, xts_stream,
                  (const unsigned char *in, unsigned char *out, size_t len,
index b294bdecaf61037c25de3acd8ce26ae0f8211773..60d4d0772a726ba25b64478dfc4055ea0fa242ca 100644 (file)
@@ -17,7 +17,7 @@
 #include "cipher_aes_xts.h"
 
 #ifdef FIPS_MODULE
-const int allow_insecure_decrypt = 0;
+const int ossl_aes_xts_allow_insecure_decrypt = 0;
 #else
-const int allow_insecure_decrypt = 1;
+const int ossl_aes_xts_allow_insecure_decrypt = 1;
 #endif /* FIPS_MODULE */
index 561ab71e8fcf8bba00365c5078e57e343f716610..bcf3f87389ee0edb5ac25ed42c7793c6ed641fa3 100644 (file)
@@ -629,14 +629,16 @@ static int test_ed448(void)
             || !TEST_true(ossl_ed448_sign(NULL, outsig, msg9, sizeof(msg9),
                                           pubkey9, privkey9, NULL, 0, NULL))
             || !TEST_int_eq(memcmp(sig9, outsig, sizeof(sig9)), 0)
-            || !TEST_true(ossl_ed448ph_sign(NULL, outsig, dohash(hashctx, phmsg1,
-                                            sizeof(phmsg1)), phpubkey1,
-                                            phprivkey1, NULL, 0, NULL))
+            || !TEST_true(ossl_ed448ph_sign(NULL, outsig,
+                                            dohash(hashctx, phmsg1,
+                                                   sizeof(phmsg1)), phpubkey1,
+                                                   phprivkey1, NULL, 0, NULL))
             || !TEST_int_eq(memcmp(phsig1, outsig, sizeof(phsig1)), 0)
-            || !TEST_true(ossl_ed448ph_sign(NULL, outsig, dohash(hashctx, phmsg2,
-                                            sizeof(phmsg2)), phpubkey2,
-                                            phprivkey2, phcontext2,
-                                            sizeof(phcontext2), NULL))
+            || !TEST_true(ossl_ed448ph_sign(NULL, outsig,
+                                            dohash(hashctx, phmsg2,
+                                                   sizeof(phmsg2)), phpubkey2,
+                                                   phprivkey2, phcontext2,
+                                                   sizeof(phcontext2), NULL))
             || !TEST_int_eq(memcmp(phsig2, outsig, sizeof(phsig2)), 0)) {
         EVP_MD_CTX_free(hashctx);
         return 0;