diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-02-25 09:08:54 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2021-03-18 17:52:37 +1000 |
commit | 9500c8234d8e99396717b9e43f10cc518e8bf668 (patch) | |
tree | 51975e210b7900643c21d2ad67b3a65a902fc591 /crypto | |
parent | e4bec869104cf4ba51cbb1effb0f5437e327ecd8 (diff) |
Fix misc external ossl_ symbols.
Partial fix for #12964
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14473)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/dh/dh_key.c | 2 | ||||
-rw-r--r-- | crypto/err/err_prn.c | 3 | ||||
-rw-r--r-- | crypto/http/http_client.c | 35 | ||||
-rw-r--r-- | crypto/http/http_lib.c | 8 | ||||
-rw-r--r-- | crypto/http/http_local.h | 28 | ||||
-rw-r--r-- | crypto/o_str.c | 10 | ||||
-rw-r--r-- | crypto/rsa/rsa_lib.c | 4 | ||||
-rw-r--r-- | crypto/rsa/rsa_sp800_56b_gen.c | 3 | ||||
-rw-r--r-- | crypto/x509/v3_ncons.c | 4 | ||||
-rw-r--r-- | crypto/x509/v3_san.c | 4 | ||||
-rw-r--r-- | crypto/x509/v3_utl.c | 2 | ||||
-rw-r--r-- | crypto/x509/x509_vpm.c | 2 |
12 files changed, 54 insertions, 51 deletions
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index f282a12b4c..3617e61e23 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -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)) diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 4a82a8880b..3ba86b3d9b 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -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); diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index 2f59cb421a..1d08c41052 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -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, diff --git a/crypto/http/http_lib.c b/crypto/http/http_lib.c index 8b300a9db0..ebb2af9b2e 100644 --- a/crypto/http/http_lib.c +++ b/crypto/http/http_lib.c @@ -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; } diff --git a/crypto/http/http_local.h b/crypto/http/http_local.h index 3f52e0772f..1dfa03ce8e 100644 --- a/crypto/http/http_local.h +++ b/crypto/http/http_local.h @@ -13,18 +13,20 @@ # 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) */ diff --git a/crypto/o_str.c b/crypto/o_str.c index dbecf4841c..ec8f3512d3 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -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) diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 530fdaa035..dfc74ec951 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -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) diff --git a/crypto/rsa/rsa_sp800_56b_gen.c b/crypto/rsa/rsa_sp800_56b_gen.c index 63cd9afc2f..077c32f1e9 100644 --- a/crypto/rsa/rsa_sp800_56b_gen.c +++ b/crypto/rsa/rsa_sp800_56b_gen.c @@ -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) { diff --git a/crypto/x509/v3_ncons.c b/crypto/x509/v3_ncons.c index 0eddfd07f6..1aa698cdd7 100644 --- a/crypto/x509/v3_ncons.c +++ b/crypto/x509/v3_ncons.c @@ -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; diff --git a/crypto/x509/v3_san.c b/crypto/x509/v3_san.c index 2367c52400..7ad8ef30bb 100644 --- a/crypto/x509/v3_san.c +++ b/crypto/x509/v3_san.c @@ -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); diff --git a/crypto/x509/v3_utl.c b/crypto/x509/v3_utl.c index 4a8380d362..a238d01619 100644 --- a/crypto/x509/v3_utl.c +++ b/crypto/x509/v3_utl.c @@ -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 diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c index 07615de7d7..2a34fce93e 100644 --- a/crypto/x509/x509_vpm.c +++ b/crypto/x509/x509_vpm.c @@ -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, |