|
| 1 | +From 3359e3e182a24722d601dfa5e4652143817ef24f Mon Sep 17 00:00:00 2001 |
| 2 | +From: "Tobias Brick (he/him)" <tobiasb@microsoft.com> |
| 3 | +Date: Mon, 16 Sep 2024 15:34:19 +0000 |
| 4 | +Subject: [PATCH] set debug_skip_body for OCSP requests in openssl tls provider |
| 5 | + |
| 6 | +--- |
| 7 | + include/wget/wget.h | 1 + |
| 8 | + libwget/http_highlevel.c | 6 ++++++ |
| 9 | + libwget/ssl_openssl.c | 1 + |
| 10 | + 3 files changed, 8 insertions(+) |
| 11 | + |
| 12 | +diff --git a/include/wget/wget.h b/include/wget/wget.h |
| 13 | +index 62ec38364..2dfe56968 100644 |
| 14 | +--- a/include/wget/wget.h |
| 15 | ++++ b/include/wget/wget.h |
| 16 | +@@ -250,6 +250,7 @@ WGET_BEGIN_DECLS |
| 17 | + #define WGET_HTTP_BODY_SAVEAS 2018 |
| 18 | + #define WGET_HTTP_USER_DATA 2019 |
| 19 | + #define WGET_HTTP_RESPONSE_IGNORELENGTH 2020 |
| 20 | ++#define WGET_HTTP_DEBUG_SKIP_BODY 2021 |
| 21 | + |
| 22 | + // definition of error conditions |
| 23 | + typedef enum { |
| 24 | +diff --git a/libwget/http_highlevel.c b/libwget/http_highlevel.c |
| 25 | +index 14c5bea72..3971f8ed0 100644 |
| 26 | +--- a/libwget/http_highlevel.c |
| 27 | ++++ b/libwget/http_highlevel.c |
| 28 | +@@ -83,6 +83,7 @@ wget_http_response *wget_http_get(int first_key, ...) |
| 29 | + size_t bodylen = 0; |
| 30 | + const void *body = NULL; |
| 31 | + void *header_user_data = NULL, *body_user_data = NULL; |
| 32 | ++ bool debug_skip_body = 0; |
| 33 | + |
| 34 | + struct { |
| 35 | + bool |
| 36 | +@@ -157,6 +158,9 @@ wget_http_response *wget_http_get(int first_key, ...) |
| 37 | + body = va_arg(args, const void *); |
| 38 | + bodylen = va_arg(args, size_t); |
| 39 | + break; |
| 40 | ++ case WGET_HTTP_DEBUG_SKIP_BODY: |
| 41 | ++ debug_skip_body = 1; |
| 42 | ++ break; |
| 43 | + default: |
| 44 | + error_printf(_("Unknown option %d\n"), key); |
| 45 | + va_end(args); |
| 46 | +@@ -239,6 +243,8 @@ wget_http_response *wget_http_get(int first_key, ...) |
| 47 | + if (body && bodylen) |
| 48 | + wget_http_request_set_body(req, NULL, wget_memdup(body, bodylen), bodylen); |
| 49 | + |
| 50 | ++ req->debug_skip_body = debug_skip_body; |
| 51 | ++ |
| 52 | + rc = wget_http_send_request(conn, req); |
| 53 | + |
| 54 | + if (rc == 0) { |
| 55 | +diff --git a/libwget/ssl_openssl.c b/libwget/ssl_openssl.c |
| 56 | +index 6cac6ecb0..7a52792d8 100644 |
| 57 | +--- a/libwget/ssl_openssl.c |
| 58 | ++++ b/libwget/ssl_openssl.c |
| 59 | +@@ -762,6 +762,7 @@ static OCSP_REQUEST *send_ocsp_request(const char *uri, |
| 60 | + WGET_HTTP_HEADER_ADD, "Content-Type", "application/ocsp-request", |
| 61 | + WGET_HTTP_MAX_REDIRECTIONS, 5, |
| 62 | + WGET_HTTP_BODY, ocspreq_bytes, ocspreq_bytes_len, |
| 63 | ++ WGET_HTTP_DEBUG_SKIP_BODY, |
| 64 | + 0); |
| 65 | + |
| 66 | + OPENSSL_free(ocspreq_bytes); |
0 commit comments