diff options
Diffstat (limited to 'include/openssl/http.h')
-rw-r--r-- | include/openssl/http.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/openssl/http.h b/include/openssl/http.h index c63762b70deb..d7aa57072505 100644 --- a/include/openssl/http.h +++ b/include/openssl/http.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2025 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 @@ -33,9 +33,18 @@ extern "C" { # define OPENSSL_HTTP_PROXY "HTTP_PROXY" # define OPENSSL_HTTPS_PROXY "HTTPS_PROXY" -# define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024) -# define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024) -# define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024) +/* We want to have this even in case of OPENSSL_NO_HTTP */ +int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, + char **pport, int *pport_num, + char **ppath, char **pquery, char **pfrag); + +# ifndef OPENSSL_NO_HTTP + +# define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024) +# define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024) +# define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024) +# define OSSL_HTTP_DEFAULT_MAX_RESP_HDR_LINES 256 + /* Low-level HTTP API */ OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size); @@ -58,6 +67,8 @@ BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx); size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx); void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx, unsigned long len); +void OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(OSSL_HTTP_REQ_CTX *rctx, + size_t count); int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx); /* High-level HTTP API */ @@ -95,15 +106,13 @@ BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx, int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok); /* Auxiliary functions */ -int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, - char **pport, int *pport_num, - char **ppath, char **pquery, char **pfrag); 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); const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy, const char *server, int use_ssl); +# endif /* !defined(OPENSSL_NO_HTTP) */ # ifdef __cplusplus } # endif |