Fix misc external ossl_ symbols.
authorShane Lontis <shane.lontis@oracle.com>
Wed, 24 Feb 2021 23:08:54 +0000 (09:08 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Thu, 18 Mar 2021 07:52:37 +0000 (17:52 +1000)
Partial fix for #12964

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

34 files changed:
crypto/dh/dh_key.c
crypto/err/err_prn.c
crypto/http/http_client.c
crypto/http/http_lib.c
crypto/http/http_local.h
crypto/o_str.c
crypto/rsa/rsa_lib.c
crypto/rsa/rsa_sp800_56b_gen.c
crypto/x509/v3_ncons.c
crypto/x509/v3_san.c
crypto/x509/v3_utl.c
crypto/x509/x509_vpm.c
include/crypto/security_bits.h
include/internal/cryptlib.h
providers/baseprov.c
providers/common/bio_prov.c
providers/common/include/prov/bio.h
providers/defltprov.c
providers/implementations/encode_decode/decode_der2key.c
providers/implementations/encode_decode/decode_ms2key.c
providers/implementations/encode_decode/decode_pem2der.c
providers/implementations/encode_decode/encode_key2any.c
providers/implementations/encode_decode/encode_key2blob.c
providers/implementations/encode_decode/encode_key2ms.c
providers/implementations/encode_decode/encode_key2text.c
providers/implementations/exchange/kdf_exch.c
providers/implementations/include/prov/kdfexchange.h
providers/implementations/kdfs/pbkdf2.c
providers/implementations/kdfs/pbkdf2.h
providers/implementations/kdfs/pbkdf2_fips.c
providers/implementations/keymgmt/kdf_legacy_kmgmt.c
providers/implementations/storemgmt/file_store.c
providers/implementations/storemgmt/file_store_der2obj.c
test/hexstr_test.c

index f282a12b4c2751ed9d38ab4f1492c3868b67b3ee..3617e61e23baea17f727fa28969b464b827db05c 100644 (file)
@@ -290,7 +290,7 @@ static int generate_key(DH *dh)
         /* Is it an approved safe prime ?*/
         if (DH_get_nid(dh) != NID_undef) {
             int max_strength =
-                    ifc_ffc_compute_security_bits(BN_num_bits(dh->params.p));
+                    ossl_ifc_ffc_compute_security_bits(BN_num_bits(dh->params.p));
 
             if (dh->params.q == NULL
                 || dh->length > BN_num_bits(dh->params.q))
index 4a82a8880bb05684a15de8516f435341f01a5537..3ba86b3d9bd3697b507e1e1ded05a25787700da0 100644 (file)
@@ -34,8 +34,7 @@ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
         if ((flags & ERR_TXT_STRING) == 0)
             data = "";
 
-        hex = openssl_buf2hexstr_sep((const unsigned char *)&tid, sizeof(tid),
-                                     '\0');
+        hex = ossl_buf2hexstr_sep((const unsigned char *)&tid, sizeof(tid), '\0');
         BIO_snprintf(buf, sizeof(buf), "%s:", hex == NULL ? "<null>" : hex);
         offset = strlen(buf);
         ossl_err_string_int(l, func, buf + offset, sizeof(buf) - offset);
index 2f59cb421a1da8757eb073f11b9da26312cd2339..1d08c410525c0e983baae717a5e21afb4a4b6c96 100644 (file)
@@ -229,7 +229,7 @@ static int OSSL_HTTP_REQ_CTX_set_content(OSSL_HTTP_REQ_CTX *rctx,
         && BIO_write(rctx->mem, req, req_len) == (int)req_len;
 }
 
-BIO *HTTP_asn1_item2bio(const ASN1_ITEM *it, const ASN1_VALUE *val)
+BIO *ossl_http_asn1_item2bio(const ASN1_ITEM *it, const ASN1_VALUE *val)
 {
     BIO *res;
 
@@ -258,7 +258,7 @@ int OSSL_HTTP_REQ_CTX_i2d(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
         return 0;
     }
 
-    res = (mem = HTTP_asn1_item2bio(it, req)) != NULL
+    res = (mem = ossl_http_asn1_item2bio(it, req)) != NULL
         && OSSL_HTTP_REQ_CTX_set_content(rctx, content_type, mem);
     BIO_free(mem);
     return res;
@@ -290,14 +290,15 @@ static int OSSL_HTTP_REQ_CTX_add1_headers(OSSL_HTTP_REQ_CTX *rctx,
  * If !use_http_proxy then the 'server' and 'port' parameters are ignored.
  * If req_mem == NULL then use GET and ignore content_type, else POST.
  */
-OSSL_HTTP_REQ_CTX *HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int use_http_proxy,
-                                    const char *server, const char *port,
-                                    const char *path,
-                                    const STACK_OF(CONF_VALUE) *headers,
-                                    const char *content_type, BIO *req_mem,
-                                    int maxline, unsigned long max_resp_len,
-                                    int timeout,
-                                    const char *expected_ct, int expect_asn1)
+OSSL_HTTP_REQ_CTX
+*ossl_http_req_ctx_new(BIO *wbio, BIO *rbio, int use_http_proxy,
+                       const char *server, const char *port,
+                       const char *path,
+                       const STACK_OF(CONF_VALUE) *headers,
+                       const char *content_type, BIO *req_mem,
+                       int maxline, unsigned long max_resp_len,
+                       int timeout,
+                       const char *expected_ct, int expect_asn1)
 {
     OSSL_HTTP_REQ_CTX *rctx;
 
@@ -868,7 +869,7 @@ BIO *OSSL_HTTP_transfer(const char *server, const char *port, const char *path,
             port = NULL;
         if (port == NULL && strchr(server, ':') == NULL)
             port = use_ssl ? OSSL_HTTPS_PORT : OSSL_HTTP_PORT;
-        proxy = http_adapt_proxy(proxy, no_proxy, server, use_ssl);
+        proxy = ossl_http_adapt_proxy(proxy, no_proxy, server, use_ssl);
         if ((cbio = HTTP_new_bio(server, port, proxy)) == NULL)
             return NULL;
 #else
@@ -893,11 +894,11 @@ BIO *OSSL_HTTP_transfer(const char *server, const char *port, const char *path,
         }
     }
 
-    rctx = HTTP_REQ_CTX_new(cbio, rbio != NULL ? rbio : cbio,
-                            !use_ssl && proxy != NULL, server, port, path,
-                            headers, content_type, req_mem, maxline,
-                            max_resp_len, update_timeout(timeout, start_time),
-                            expected_ct, expect_asn1);
+    rctx = ossl_http_req_ctx_new(cbio, rbio != NULL ? rbio : cbio,
+                                 !use_ssl && proxy != NULL, server, port, path,
+                                 headers, content_type, req_mem, maxline,
+                                 max_resp_len, update_timeout(timeout, start_time),
+                                 expected_ct, expect_asn1);
     if (rctx == NULL)
         goto end;
 
@@ -1090,7 +1091,7 @@ ASN1_VALUE *OSSL_HTTP_post_asn1(const char *server, const char *port,
     }
     /* remaining parameters are checked indirectly */
 
-    req_mem = HTTP_asn1_item2bio(req_it, req);
+    req_mem = ossl_http_asn1_item2bio(req_it, req);
     res_mem = OSSL_HTTP_transfer(server, port, path, use_ssl, proxy, no_proxy,
                                  bio, rbio,
                                  bio_update_fn, arg, headers, content_type,
index 8b300a9db0cee83ccd440edafcc7015eeee5da4a..ebb2af9b2efcd3100ab944fe27cced914b904106 100644 (file)
@@ -239,7 +239,7 @@ int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost,
     return 0;
 }
 
-int http_use_proxy(const char *no_proxy, const char *server)
+int ossl_http_use_proxy(const char *no_proxy, const char *server)
 {
     size_t sl;
     const char *found = NULL;
@@ -265,8 +265,8 @@ int http_use_proxy(const char *no_proxy, const char *server)
     return found == NULL;
 }
 
-const char *http_adapt_proxy(const char *proxy, const char *no_proxy,
-                             const char *server, int use_ssl)
+const char *ossl_http_adapt_proxy(const char *proxy, const char *no_proxy,
+                                  const char *server, int use_ssl)
 {
     const int http_len = strlen(OSSL_HTTP_PREFIX);
     const int https_len = strlen(OSSL_HTTPS_PREFIX);
@@ -289,7 +289,7 @@ const char *http_adapt_proxy(const char *proxy, const char *no_proxy,
     else if (strncmp(proxy, OSSL_HTTPS_PREFIX, https_len) == 0)
         proxy += https_len;
 
-    if (*proxy == '\0' || !http_use_proxy(no_proxy, server))
+    if (*proxy == '\0' || !ossl_http_use_proxy(no_proxy, server))
         return NULL;
     return proxy;
 }
index 3f52e0772fd0ec6905f57882bab4398f26c9489e..1dfa03ce8efac5cde2c0fdc58e32a05cc9605f88 100644 (file)
 
 # include <openssl/ocsp.h>
 
-BIO *HTTP_asn1_item2bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
-OSSL_HTTP_REQ_CTX *HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int use_http_proxy,
-                                    const char *server, const char *port,
-                                    const char *path,
-                                    const STACK_OF(CONF_VALUE) *headers,
-                                    const char *content_type, BIO *req_mem,
-                                    int maxline, unsigned long max_resp_len,
-                                    int timeout,
-                                    const char *expected_content_type,
-                                    int expect_asn1);
-int http_use_proxy(const char *no_proxy, const char *server);
-const char *http_adapt_proxy(const char *proxy, const char *no_proxy,
-                             const char *server, int use_ssl);
+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,
+                       const char *path,
+                       const STACK_OF(CONF_VALUE) *headers,
+                       const char *content_type, BIO *req_mem,
+                       int maxline, unsigned long max_resp_len,
+                       int timeout,
+                       const char *expected_content_type,
+                       int expect_asn1);
+
+int ossl_http_use_proxy(const char *no_proxy, const char *server);
+const char *ossl_http_adapt_proxy(const char *proxy, const char *no_proxy,
+                                  const char *server, int use_ssl);
 
 #endif /* !defined(OSSL_CRYPTO_HTTP_LOCAL_H) */
index dbecf4841c1073c4e080984c9c8f2c352487679c..ec8f3512d3ea3dc50f63b42be72545150e0878f7 100644 (file)
@@ -181,8 +181,8 @@ int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen,
     return hexstr2buf_sep(buf, buf_n, buflen, str, sep);
 }
 
-unsigned char *openssl_hexstr2buf_sep(const char *str, long *buflen,
-                                      const char sep)
+unsigned char *ossl_hexstr2buf_sep(const char *str, long *buflen,
+                                   const char sep)
 {
     unsigned char *buf;
     size_t buf_n, tmp_buflen;
@@ -212,7 +212,7 @@ unsigned char *openssl_hexstr2buf_sep(const char *str, long *buflen,
 
 unsigned char *OPENSSL_hexstr2buf(const char *str, long *buflen)
 {
-    return openssl_hexstr2buf_sep(str, buflen, DEFAULT_SEPARATOR);
+    return ossl_hexstr2buf_sep(str, buflen, DEFAULT_SEPARATOR);
 }
 
 static int buf2hexstr_sep(char *str, size_t str_n, size_t *strlen,
@@ -260,7 +260,7 @@ int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlen,
     return buf2hexstr_sep(str, str_n, strlen, buf, buflen, sep);
 }
 
-char *openssl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep)
+char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep)
 {
     char *tmp;
     size_t tmp_n;
@@ -288,7 +288,7 @@ char *openssl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep)
  */
 char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen)
 {
-    return openssl_buf2hexstr_sep(buf, buflen, ':');
+    return ossl_buf2hexstr_sep(buf, buflen, ':');
 }
 
 int openssl_strerror_r(int errnum, char *buf, size_t buflen)
index 530fdaa035f2d0c2cbaf9b7135210d91b5deb188..dfc74ec95145bc5baeb4c782830f1d8f29a829af 100644 (file)
@@ -309,7 +309,7 @@ static uint32_t ilog_e(uint64_t v)
  *           \cdot(log_e(nBits \cdot log_e(2))^{2/3} - 4.69}{log_e(2)}
  * The two cube roots are merged together here.
  */
-uint16_t ifc_ffc_compute_security_bits(int n)
+uint16_t ossl_ifc_ffc_compute_security_bits(int n)
 {
     uint64_t x;
     uint32_t lx;
@@ -361,7 +361,7 @@ int RSA_security_bits(const RSA *rsa)
             return 0;
     }
 #endif
-    return ifc_ffc_compute_security_bits(bits);
+    return ossl_ifc_ffc_compute_security_bits(bits);
 }
 
 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
index 63cd9afc2fe2dae6c022690e231e26dd64110366..077c32f1e9de8afd8b46a6bfe7d7a0033e00fafe 100644 (file)
@@ -171,7 +171,8 @@ err:
  */
 int ossl_rsa_sp800_56b_validate_strength(int nbits, int strength)
 {
-    int s = (int)ifc_ffc_compute_security_bits(nbits);
+    int s = (int)ossl_ifc_ffc_compute_security_bits(nbits);
+
 #ifdef FIPS_MODULE
     if (s < RSA_FIPS1864_MIN_KEYGEN_STRENGTH
             || s > RSA_FIPS1864_MAX_KEYGEN_STRENGTH) {
index 0eddfd07f6e63504f301e36ab057298eee367bd3..1aa698cdd74ffbc2233a3e01930a9893cc40bd3c 100644 (file)
@@ -193,8 +193,8 @@ static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip)
     /* ip->length should be 8 or 32 and len1 == len2 == 4 or len1 == len2 == 16 */
     int len1 = ip->length >= 16 ? 16 : ip->length >= 4 ? 4 : ip->length;
     int len2 = ip->length - len1;
-    char *ip1 = ipaddr_to_asc(ip->data, len1);
-    char *ip2 = ipaddr_to_asc(ip->data + len1, len2);
+    char *ip1 = ossl_ipaddr_to_asc(ip->data, len1);
+    char *ip2 = ossl_ipaddr_to_asc(ip->data + len1, len2);
     int ret = ip1 != NULL && ip2 != NULL
         && BIO_printf(bp, "IP:%s/%s", ip1, ip2) > 0;
 
index 2367c524008dc890f549a2ceb9754f3cc8954ea7..7ad8ef30bb179ac980bbeaee97f3d8546bac610f 100644 (file)
@@ -178,7 +178,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
         break;
 
     case GEN_IPADD:
-        tmp = ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
+        tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
         if (tmp == NULL || !X509V3_add_value("IP Address", tmp, &ret))
             ret = NULL;
         OPENSSL_free(tmp);
@@ -267,7 +267,7 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
         break;
 
     case GEN_IPADD:
-        tmp = ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
+        tmp = ossl_ipaddr_to_asc(gen->d.ip->data, gen->d.ip->length);
         if (tmp == NULL)
             return 0;
         BIO_printf(out, "IP Address:%s", tmp);
index 4a8380d362377f0d3abfef4d4be31f92c9b1fe57..a238d0161961add449e80c72968073b3fa344566 100644 (file)
@@ -978,7 +978,7 @@ int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags)
     return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL);
 }
 
-char *ipaddr_to_asc(unsigned char *p, int len)
+char *ossl_ipaddr_to_asc(unsigned char *p, int len)
 {
     /*
      * 40 is enough space for the longest IPv6 address + nul terminator byte
index 07615de7d79265adbdf756bdc33463cc8442375a..2a34fce93e9fc757f6fce0d574a56313fa80b1d3 100644 (file)
@@ -455,7 +455,7 @@ char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param)
     size_t iplen;
     unsigned char *ip = int_X509_VERIFY_PARAM_get0_ip(param, &iplen);
 
-    return  ip == NULL ? NULL : ipaddr_to_asc(ip, iplen);
+    return  ip == NULL ? NULL : ossl_ipaddr_to_asc(ip, iplen);
 }
 
 int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
index 3dc9e26ff3172e908e6e2195e747c2999aabe237..58f49681dc63b16d7be2e54df2703840a86ad1e7 100644 (file)
@@ -11,6 +11,6 @@
 # define OSSL_SECURITY_BITS_H
 # pragma once
 
-uint16_t ifc_ffc_compute_security_bits(int n);
+uint16_t ossl_ifc_ffc_compute_security_bits(int n);
 
 #endif
index 663c3ef80831b6039360280b11d8411425121a97..26862310d86056530fdf055a8bb6f7b1bd585985 100644 (file)
@@ -249,11 +249,11 @@ static ossl_inline void ossl_sleep(unsigned long millis)
 
 char *sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text, const char *sep,
                               size_t max_len);
-char *ipaddr_to_asc(unsigned char *p, int len);
+char *ossl_ipaddr_to_asc(unsigned char *p, int len);
 
-char *openssl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep);
-unsigned char *openssl_hexstr2buf_sep(const char *str, long *buflen,
-                                      const char sep);
+char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep);
+unsigned char *ossl_hexstr2buf_sep(const char *str, long *buflen,
+                                   const char sep);
 
 static ossl_inline int ossl_ends_with_dirsep(const char *path)
 {
index c63f1fb2570d8ba0f9ce3aacb770618023f4ac05..249d12cb6349e9e7ccc5b14db21b4cab2e68852d 100644 (file)
@@ -162,7 +162,7 @@ int ossl_base_provider_init(const OSSL_CORE_HANDLE *handle,
      * create their own library context.
      */
     if ((*provctx = ossl_prov_ctx_new()) == NULL
-            || (corebiometh = bio_prov_init_bio_method()) == NULL) {
+            || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
         ossl_prov_ctx_free(*provctx);
         *provctx = NULL;
         return 0;
index 4db224ba0563211847bdc71fa2f281522eae3f47..baf923c7b3c60e2e18cd7a46c3f5905ebb6f24e0 100644 (file)
@@ -203,7 +203,7 @@ static int bio_core_free(BIO *bio)
     return 1;
 }
 
-BIO_METHOD *bio_prov_init_bio_method(void)
+BIO_METHOD *ossl_bio_prov_init_bio_method(void)
 {
     BIO_METHOD *corebiometh = NULL;
 
@@ -223,7 +223,7 @@ BIO_METHOD *bio_prov_init_bio_method(void)
     return corebiometh;
 }
 
-BIO *bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio)
+BIO *ossl_bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio)
 {
     BIO *outbio;
     BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
index 18c0f9a752cafd262665a6e1fb6fe4ad71b1c790..da7e7e87f593c1dda7c7f1a03b1bbc6593d5d8ab 100644 (file)
@@ -28,5 +28,5 @@ int ossl_prov_bio_free(OSSL_CORE_BIO *bio);
 int ossl_prov_bio_vprintf(OSSL_CORE_BIO *bio, const char *format, va_list ap);
 int ossl_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...);
 
-BIO_METHOD *bio_prov_init_bio_method(void);
-BIO *bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio);
+BIO_METHOD *ossl_bio_prov_init_bio_method(void);
+BIO *ossl_bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio);
index 2649972c82a2e1c1487d1c9776edd9e0752d6b02..01e3f9ced41b157b0668bf628fcfb1241c5ce6bf 100644 (file)
@@ -558,7 +558,7 @@ int ossl_default_provider_init(const OSSL_CORE_HANDLE *handle,
      * create their own library context.
      */
     if ((*provctx = ossl_prov_ctx_new()) == NULL
-            || (corebiometh = bio_prov_init_bio_method()) == NULL) {
+            || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
         ossl_prov_ctx_free(*provctx);
         *provctx = NULL;
         return 0;
index c8a467fb5b3b2cdb2d2a320dd3d7e94cfd8fa787..459c67287590156cd5d0fe516a4ac6b7cd97c455 100644 (file)
@@ -59,7 +59,7 @@ static int read_der(PROV_CTX *provctx, OSSL_CORE_BIO *cin,
                     unsigned char **data, long *len)
 {
     BUF_MEM *mem = NULL;
-    BIO *in = bio_new_from_core_bio(provctx, cin);
+    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
     int ok = (asn1_d2i_read_bio(in, &mem) >= 0);
 
     if (ok) {
index 5635a70960a0fd474a13693e882ba3912b308ee8..f38717cbb31b1cb08102cd3c10b00bdcca2d2913 100644 (file)
@@ -30,7 +30,7 @@
 
 static EVP_PKEY *read_msblob(PROV_CTX *provctx, OSSL_CORE_BIO *cin, int *ispub)
 {
-    BIO *in = bio_new_from_core_bio(provctx, cin);
+    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
     EVP_PKEY *pkey = ossl_b2i_bio(in, ispub);
 
     BIO_free(in);
@@ -48,7 +48,7 @@ static EVP_PKEY *read_pvk(PROV_CTX *provctx, OSSL_CORE_BIO *cin,
     if (!ossl_pw_set_ossl_passphrase_cb(&pwdata, pw_cb, pw_cbarg))
         return NULL;
 
-    in = bio_new_from_core_bio(provctx, cin);
+    in = ossl_bio_new_from_core_bio(provctx, cin);
     pkey = b2i_PVK_bio(in, ossl_pw_pem_password, &pwdata);
     BIO_free(in);
 
index 895015a56ba654ba239e3a456c8accf9440591e9..fe6839965d8f7c04e607e728c655d0d5bcbad49b 100644 (file)
@@ -32,7 +32,7 @@ static int read_pem(PROV_CTX *provctx, OSSL_CORE_BIO *cin,
                     char **pem_name, char **pem_header,
                     unsigned char **data, long *len)
 {
-    BIO *in = bio_new_from_core_bio(provctx, cin);
+    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
     int ok = (PEM_read_bio(in, pem_name, pem_header, data, len) > 0);
 
     BIO_free(in);
index 32d99837b23c7930d223d479ddb1677041aa4b9f..1647b9fdb5601ee303560f6252ff6269c8b9363f 100644 (file)
@@ -1014,7 +1014,7 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout,
         ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
     } else if (writer != NULL
                && (checker == NULL || checker(key, type))) {
-        BIO *out = bio_new_from_core_bio(ctx->provctx, cout);
+        BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout);
 
         if (out != NULL
             && (pwcb == NULL
index 2e5e581391fb3077a6d676a2c03893833526455a..c58940b0a62b0f2feab87dbc8f22069b60ee3da6 100644 (file)
@@ -29,7 +29,7 @@
 static int write_blob(void *provctx, OSSL_CORE_BIO *cout,
                       void *data, int len)
 {
-    BIO *out = bio_new_from_core_bio(provctx, cout);
+    BIO *out = ossl_bio_new_from_core_bio(provctx, cout);
     int ret = BIO_write(out, data, len);
 
     BIO_free(out);
index c2b08981a7fc3adcfa558c6400bdeeb5048b3e1e..cbd629dfe4c3c8e563c4c112cb089d7892782992 100644 (file)
@@ -38,7 +38,7 @@ struct key2ms_ctx_st {
 static int write_msblob(struct key2ms_ctx_st *ctx, OSSL_CORE_BIO *cout,
                         EVP_PKEY *pkey, int ispub)
 {
-    BIO *out = bio_new_from_core_bio(ctx->provctx, cout);
+    BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout);
     int ret =
         ispub ? i2b_PublicKey_bio(out, pkey) : i2b_PrivateKey_bio(out, pkey);
 
@@ -53,7 +53,7 @@ static int write_pvk(struct key2ms_ctx_st *ctx, OSSL_CORE_BIO *cout,
     BIO *out = NULL;
     int ret = 0;
 
-    out = bio_new_from_core_bio(ctx->provctx, cout);
+    out = ossl_bio_new_from_core_bio(ctx->provctx, cout);
     ret = i2b_PVK_bio(out, pkey, ctx->pvk_encr_level,
                       ossl_pw_pem_password, &ctx->pwdata);
     BIO_free(out);
index 2c6c5d70db600d056fceea4f0526acd72147789b..f913a9bb149411e730c80758f2e807882966676a 100644 (file)
@@ -833,7 +833,7 @@ static int key2text_encode(void *vctx, const void *key, int selection,
                                            int selection),
                            OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg)
 {
-    BIO *out = bio_new_from_core_bio(vctx, cout);
+    BIO *out = ossl_bio_new_from_core_bio(vctx, cout);
     int ret;
 
     if (out == NULL)
index d61c04354c07668a8ea3fbb72745a38087c5992d..38631b45d16de3db84f7e96ccdc2b366aa65b3e8 100644 (file)
@@ -81,7 +81,7 @@ static int kdf_init(void *vpkdfctx, void *vkdf, const OSSL_PARAM params[])
     if (!ossl_prov_is_running()
             || pkdfctx == NULL
             || vkdf == NULL
-            || !kdf_data_up_ref(vkdf))
+            || !ossl_kdf_data_up_ref(vkdf))
         return 0;
     pkdfctx->kdfdata = vkdf;
 
@@ -109,7 +109,7 @@ static void kdf_freectx(void *vpkdfctx)
     PROV_KDF_CTX *pkdfctx = (PROV_KDF_CTX *)vpkdfctx;
 
     EVP_KDF_CTX_free(pkdfctx->kdfctx);
-    kdf_data_free(pkdfctx->kdfdata);
+    ossl_kdf_data_free(pkdfctx->kdfdata);
 
     OPENSSL_free(pkdfctx);
 }
@@ -133,7 +133,7 @@ static void *kdf_dupctx(void *vpkdfctx)
         OPENSSL_free(dstctx);
         return NULL;
     }
-    if (!kdf_data_up_ref(dstctx->kdfdata)) {
+    if (!ossl_kdf_data_up_ref(dstctx->kdfdata)) {
         EVP_KDF_CTX_free(dstctx->kdfctx);
         OPENSSL_free(dstctx);
         return NULL;
index 3770487bffeaf4d2c003709c53d6d5a78db97d6d..b7cd4cbafdac6c48154bdc57d2556681839b2f48 100644 (file)
@@ -19,6 +19,6 @@ struct kdf_data_st {
 
 typedef struct kdf_data_st KDF_DATA;
 
-KDF_DATA *kdf_data_new(void *provctx);
-void kdf_data_free(KDF_DATA *kdfdata);
-int kdf_data_up_ref(KDF_DATA *kdfdata);
+KDF_DATA *ossl_kdf_data_new(void *provctx);
+void ossl_kdf_data_free(KDF_DATA *kdfdata);
+int ossl_kdf_data_up_ref(KDF_DATA *kdfdata);
index eb7b15de59eda74a1a01cade5e70f517ac847604..14c78b518c4b7537397b290b4becdd34beefc9fe 100644 (file)
@@ -119,7 +119,7 @@ static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
         /* This is an error, but there is no way to indicate such directly */
         ossl_prov_digest_reset(&ctx->digest);
     ctx->iter = PKCS5_DEFAULT_ITER;
-    ctx->lower_bound_checks = kdf_pbkdf2_default_checks;
+    ctx->lower_bound_checks = ossl_kdf_pbkdf2_default_checks;
 }
 
 static int pbkdf2_set_membuf(unsigned char **buffer, size_t *buflen,
index c8c2e5b8a7b76a63427b503fc116e5c3415e7ce1..c0848e26fc98923dd0a39e700e7ac0b90412e733 100644 (file)
@@ -11,4 +11,4 @@
  * Available in pbkdfe_fips.c, and compiled with different values depending
  * on we're in the FIPS module or not.
  */
-extern const int kdf_pbkdf2_default_checks;
+extern const int ossl_kdf_pbkdf2_default_checks;
index be60be1fa0edbf7ca70b3044f047c943220aefc7..916d9ef078025ebcf1af11a873417f0a7c6c1d5f 100644 (file)
@@ -14,7 +14,7 @@
  * Extra checks are done by default in fips mode only.
  */
 #ifdef FIPS_MODULE
-const int kdf_pbkdf2_default_checks = 1;
+const int ossl_kdf_pbkdf2_default_checks = 1;
 #else
-const int kdf_pbkdf2_default_checks = 0;
+const int ossl_kdf_pbkdf2_default_checks = 0;
 #endif /* FIPS_MODULE */
index 16d5f971cc31f5b1a9f4d46f115ea6dd51195c4c..698107927b565333e9333ff33181fef68b775f12 100644 (file)
@@ -26,7 +26,7 @@ static OSSL_FUNC_keymgmt_new_fn kdf_newdata;
 static OSSL_FUNC_keymgmt_free_fn kdf_freedata;
 static OSSL_FUNC_keymgmt_has_fn kdf_has;
 
-KDF_DATA *kdf_data_new(void *provctx)
+KDF_DATA *ossl_kdf_data_new(void *provctx)
 {
     KDF_DATA *kdfdata;
 
@@ -48,7 +48,7 @@ KDF_DATA *kdf_data_new(void *provctx)
     return kdfdata;
 }
 
-void kdf_data_free(KDF_DATA *kdfdata)
+void ossl_kdf_data_free(KDF_DATA *kdfdata)
 {
     int ref = 0;
 
@@ -63,7 +63,7 @@ void kdf_data_free(KDF_DATA *kdfdata)
     OPENSSL_free(kdfdata);
 }
 
-int kdf_data_up_ref(KDF_DATA *kdfdata)
+int ossl_kdf_data_up_ref(KDF_DATA *kdfdata)
 {
     int ref = 0;
 
@@ -83,12 +83,12 @@ int kdf_data_up_ref(KDF_DATA *kdfdata)
 
 static void *kdf_newdata(void *provctx)
 {
-    return kdf_data_new(provctx);
+    return ossl_kdf_data_new(provctx);
 }
 
 static void kdf_freedata(void *kdfdata)
 {
-    kdf_data_free(kdfdata);
+    ossl_kdf_data_free(kdfdata);
 }
 
 static int kdf_has(const void *keydata, int selection)
index f4ac6e0c83fb12830b9a101ff1d9a16e64441f35..e12105254597f5e408885c22d6cd894944450bc8 100644 (file)
@@ -294,7 +294,7 @@ static void *file_open(void *provctx, const char *uri)
 void *file_attach(void *provctx, OSSL_CORE_BIO *cin)
 {
     struct file_ctx_st *ctx;
-    BIO *new_bio = bio_new_from_core_bio(provctx, cin);
+    BIO *new_bio = ossl_bio_new_from_core_bio(provctx, cin);
 
     if (new_bio == NULL)
         return NULL;
index 854a720f600eeb10eaca474c976267dd44011bc2..74fa40df9f2ecf5d83e6d4506441c18ac0c66df9 100644 (file)
@@ -85,7 +85,7 @@ static int der2obj_decode(void *provctx, OSSL_CORE_BIO *cin, int selection,
      * We're called from file_store.c, so we know that OSSL_CORE_BIO is a
      * BIO in this case.
      */
-    BIO *in = bio_new_from_core_bio(provctx, cin);
+    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
     BUF_MEM *mem = NULL;
     int err, ok;
 
index c03b58ef03950c92f40b53eb7ae4296eddbaea07..ffad66fe4f49677f16cd9c326023a01a6bc46f35 100644 (file)
@@ -68,9 +68,9 @@ static int test_hexstr_sep_to_from(int test_index)
     char *out = NULL;
     struct testdata *test = &tbl_testdata[test_index];
 
-    if (!TEST_ptr(buf = openssl_hexstr2buf_sep(test->in, &len, test->sep))
+    if (!TEST_ptr(buf = ossl_hexstr2buf_sep(test->in, &len, test->sep))
         || !TEST_mem_eq(buf, len, test->expected, test->expected_len)
-        || !TEST_ptr(out = openssl_buf2hexstr_sep(buf, len, test->sep))
+        || !TEST_ptr(out = ossl_buf2hexstr_sep(buf, len, test->sep))
         || !TEST_str_eq(out, test->in))
        goto err;