diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-06-12 17:43:15 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-16 14:36:01 +0100 |
commit | ab9d67efa4c2a4ee6787430a447de675cb78c8e2 (patch) | |
tree | 8a7a336f91247b9f45e13f48980084a4ed2a68ce /crypto | |
parent | eefdb8e013fa9d0881566b41291c5725a77b332a (diff) |
HTTP client: fix use of OSSL_HTTP_adapt_proxy(), which is needed also in cmp.c
For this reason, export this function, which allows removing http_local.h
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15764)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/http/http_client.c | 4 | ||||
-rw-r--r-- | crypto/http/http_lib.c | 9 | ||||
-rw-r--r-- | crypto/http/http_local.h | 18 | ||||
-rw-r--r-- | crypto/ocsp/ocsp_http.c | 1 |
4 files changed, 4 insertions, 28 deletions
diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index 03c42ab38e..648b02255f 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -23,8 +23,6 @@ #include "internal/sockets.h" #include "internal/cryptlib.h" /* for ossl_assert() */ -#include "http_local.h" - #define HTTP_PREFIX "HTTP/" #define HTTP_VERSION_PATT "1." /* allow 1.x */ #define HTTP_PREFIX_VERSION HTTP_PREFIX""HTTP_VERSION_PATT @@ -897,7 +895,7 @@ OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port, port = NULL; if (port == NULL && strchr(server, ':') == NULL) port = use_ssl ? OSSL_HTTPS_PORT : OSSL_HTTP_PORT; - proxy = ossl_http_adapt_proxy(proxy, no_proxy, server, use_ssl); + proxy = OSSL_HTTP_adapt_proxy(proxy, no_proxy, server, use_ssl); if (proxy != NULL && !OSSL_HTTP_parse_url(proxy, NULL /* use_ssl */, NULL /* user */, &proxy_host, &proxy_port, NULL /* num */, diff --git a/crypto/http/http_lib.c b/crypto/http/http_lib.c index 2aa0736ac5..bd9c096b98 100644 --- a/crypto/http/http_lib.c +++ b/crypto/http/http_lib.c @@ -15,8 +15,6 @@ #include <openssl/err.h> #include "internal/cryptlib.h" /* for ossl_assert() */ -#include "http_local.h" - static void init_pstring(char **pstr) { if (pstr != NULL) { @@ -241,7 +239,7 @@ int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost, } /* Respect no_proxy, taking default value from environment variable(s) */ -int ossl_http_use_proxy(const char *no_proxy, const char *server) +static int use_proxy(const char *no_proxy, const char *server) { size_t sl; const char *found = NULL; @@ -269,7 +267,7 @@ int ossl_http_use_proxy(const char *no_proxy, const char *server) } /* Take default value from environment variable(s), respect no_proxy */ -const char *ossl_http_adapt_proxy(const char *proxy, const char *no_proxy, +const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy, const char *server, int use_ssl) { /* @@ -282,8 +280,7 @@ const char *ossl_http_adapt_proxy(const char *proxy, const char *no_proxy, proxy = getenv(use_ssl ? OPENSSL_HTTP_PROXY : OPENSSL_HTTPS_PROXY); - if (proxy == NULL || *proxy == '\0' - || !ossl_http_use_proxy(no_proxy, server)) + if (proxy == NULL || *proxy == '\0' || !use_proxy(no_proxy, server)) return NULL; return proxy; } diff --git a/crypto/http/http_local.h b/crypto/http/http_local.h deleted file mode 100644 index 16f7f7c8a5..0000000000 --- a/crypto/http/http_local.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved. - * Copyright Siemens AG 2018-2020 - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OSSL_CRYPTO_HTTP_LOCAL_H -# define OSSL_CRYPTO_HTTP_LOCAL_H - -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/ocsp/ocsp_http.c b/crypto/ocsp/ocsp_http.c index f19047aa08..28166d3a17 100644 --- a/crypto/ocsp/ocsp_http.c +++ b/crypto/ocsp/ocsp_http.c @@ -9,7 +9,6 @@ #include <openssl/ocsp.h> #include <openssl/http.h> -#include "../http/http_local.h" #ifndef OPENSSL_NO_OCSP |