diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-01-28 22:10:47 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-03-01 10:30:43 +0100 |
commit | 7932982b88f5095f60397fe727d27ddf7234f4d6 (patch) | |
tree | 791fa288ead387d06147ae627169996e093c115d /include | |
parent | e60e974414a7e637ff2f946dc2aa24c381a32cc2 (diff) | |
download | openssl-new-7932982b88f5095f60397fe727d27ddf7234f4d6.tar.gz |
OSSL_HTTP_parse_url(): Handle any userinfo, query, and fragment components
Now handle [http[s]://][userinfo@]host[:port][/path][?query][#frag]
by optionally providing any userinfo, query, and frag components.
All usages of this function, which are client-only,
silently ignore userinfo and frag components,
while the query component is taken as part of the path.
Update and extend the unit tests and all affected documentation.
Document and deprecat OCSP_parse_url().
Fixes an issue that came up when discussing FR #14001.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14009)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/http.h | 14 | ||||
-rw-r--r-- | include/openssl/ocsp.h.in | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/openssl/http.h b/include/openssl/http.h index 6c3ddd8ce8..508428a986 100644 --- a/include/openssl/http.h +++ b/include/openssl/http.h @@ -41,8 +41,7 @@ typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail) OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int method_GET, int maxline, unsigned long max_resp_len, - int timeout, - const char *expected_content_type, + int timeout, const char *expected_ct, int expect_asn1); void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx); int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, @@ -64,15 +63,15 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy, OSSL_HTTP_bio_cb_t bio_update_fn, void *arg, const STACK_OF(CONF_VALUE) *headers, int maxline, unsigned long max_resp_len, int timeout, - const char *expected_content_type, int expect_asn1); + const char *expected_ct, int expect_asn1); ASN1_VALUE *OSSL_HTTP_get_asn1(const char *url, const char *proxy, const char *no_proxy, BIO *bio, BIO *rbio, OSSL_HTTP_bio_cb_t bio_update_fn, void *arg, const STACK_OF(CONF_VALUE) *headers, int maxline, unsigned long max_resp_len, - int timeout, const char *expected_content_type, - const ASN1_ITEM *it); + int timeout, const char *expected_ct, + const ASN1_ITEM *rsp_it); ASN1_VALUE *OSSL_HTTP_post_asn1(const char *server, const char *port, const char *path, int use_ssl, const char *proxy, const char *no_proxy, @@ -97,8 +96,9 @@ int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port, const char *proxyuser, const char *proxypass, int timeout, BIO *bio_err, const char *prog); -int OSSL_HTTP_parse_url(const char *url, char **phost, char **pport, - int *pport_num, char **ppath, int *pssl); +int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost, + char **pport, int *pport_num, + char **ppath, char **pquery, char **pfrag); # ifdef __cplusplus } diff --git a/include/openssl/ocsp.h.in b/include/openssl/ocsp.h.in index 3c5de15494..5e11987dc5 100644 --- a/include/openssl/ocsp.h.in +++ b/include/openssl/ocsp.h.in @@ -260,7 +260,7 @@ int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags); # define OCSP_parse_url(url, host, port, path, ssl) \ - OSSL_HTTP_parse_url(url, host, port, NULL, path, ssl) /* backward compat */ + OSSL_HTTP_parse_url(url, ssl, NULL, host, port, NULL, path, NULL, NULL) int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b); int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b); |