rename OSSL_HTTP_REQ_CTX_header to OSSL_HTTP_REQ_CTX_set_request_line
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Mon, 18 Jan 2021 11:17:31 +0000 (12:17 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Sat, 23 Jan 2021 14:25:04 +0000 (15:25 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13898)

CHANGES.md
crypto/http/http_client.c
doc/man3/OSSL_HTTP_REQ_CTX.pod
include/openssl/http.h
include/openssl/ocsp.h.in
util/libcrypto.num

index a298a0590cbf36374ab5a8adea92a497d5b1b701..63d41c3911cb8301ed2a3bcae4b7a143b3ee393d 100644 (file)
@@ -23,15 +23,15 @@ OpenSSL 3.0
 
 ### Changes between 1.1.1 and 3.0 [xx XXX xxxx]
 
- * Deprecated the type OCSP_REQ_CTX and the functions OCSP_REQ_CTX_new(), 
+ * Deprecated the type OCSP_REQ_CTX and the functions OCSP_REQ_CTX_new(),
    OCSP_REQ_CTX_free(), OCSP_REQ_CTX_http(), OCSP_REQ_CTX_add1_header(),
    OCSP_REQ_CTX_i2d(), OCSP_REQ_CTX_nbio(), OCSP_REQ_CTX_nbio_d2i(),
    OCSP_REQ_CTX_get0_mem_bio() and OCSP_set_max_response_length().  These
    were used to collect all necessary data to form a HTTP request, and to
    perform the HTTP transfer with that request.  With OpenSSL 3.0, the
    type is OSSL_HTTP_REQ_CTX, and the deprecated functions are replaced
-   with OSSL_HTTP_REQ_CTX_new(), OSSL_HTTP_REQ_CTX_free(), 
-   OSSL_HTTP_REQ_CTX_header(), OSSL_HTTP_REQ_CTX_add1_header(),
+   with OSSL_HTTP_REQ_CTX_new(), OSSL_HTTP_REQ_CTX_free(),
+   OSSL_HTTP_REQ_CTX_set_request_line(), OSSL_HTTP_REQ_CTX_add1_header(),
    OSSL_HTTP_REQ_CTX_i2d(), OSSL_HTTP_REQ_CTX_nbio(),
    OSSL_HTTP_REQ_CTX_sendreq_d2i(), OSSL_HTTP_REQ_CTX_get0_mem_bio() and
    OSSL_HTTP_REQ_CTX_set_max_response_length().
index 731142b16138f953bded2f1ac32ef7ab3816a9fc..9cde88d2e6c17ce6b80e8695bdad70684f3e5fbe 100644 (file)
@@ -138,11 +138,12 @@ void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx,
 }
 
 /*
- * Create HTTP header using given op and path (or "/" in case path is NULL).
+ * Create request line using |ctx| and |path| (or "/" in case |path| is NULL).
  * Server name (and port) must be given if and only if plain HTTP proxy is used.
  */
-int OSSL_HTTP_REQ_CTX_header(OSSL_HTTP_REQ_CTX *rctx, const char *server,
-                             const char *port, const char *path)
+int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx,
+                                       const char *server, const char *port,
+                                       const char *path)
 {
     if (rctx == NULL) {
         ERR_raise(ERR_LIB_HTTP, ERR_R_PASSED_NULL_PARAMETER);
@@ -309,8 +310,9 @@ OSSL_HTTP_REQ_CTX *HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int use_http_proxy,
         == NULL)
         return NULL;
 
-    if (OSSL_HTTP_REQ_CTX_header(rctx, use_http_proxy ? server : NULL,
-                                 port, path)
+    if (OSSL_HTTP_REQ_CTX_set_request_line(rctx,
+                                           use_http_proxy ? server : NULL, port,
+                                           path)
         && OSSL_HTTP_REQ_CTX_add1_headers(rctx, headers, server)
         && (req_mem == NULL
             || OSSL_HTTP_REQ_CTX_content(rctx, content_type, req_mem)))
index b75bac5f8c9133151da406bb6b4328849e320cbf..dc7020c8267524f518be05fd4a99d9d00b23b439 100644 (file)
@@ -5,7 +5,7 @@
 OSSL_HTTP_REQ_CTX,
 OSSL_HTTP_REQ_CTX_new,
 OSSL_HTTP_REQ_CTX_free,
-OSSL_HTTP_REQ_CTX_header,
+OSSL_HTTP_REQ_CTX_set_request_line,
 OSSL_HTTP_REQ_CTX_add1_header,
 OSSL_HTTP_REQ_CTX_i2d,
 OSSL_HTTP_REQ_CTX_nbio,
@@ -28,9 +28,9 @@ OSSL_HTTP_REQ_CTX_set_max_response_length
                                           int expect_asn1);
  void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
 
- int OSSL_HTTP_REQ_CTX_header(OSSL_HTTP_REQ_CTX *rctx,
-                              const char *server,
-                              const char *port, const char *path);
+ int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx,
+                                        const char *server, const char *port,
+                                        const char *path);
  int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
                                    const char *name, const char *value);
 
@@ -72,7 +72,7 @@ OSSL_HTTP_REQ_CTX_free() frees up the HTTP request context I<rctx>.
 The I<wbio> and I<rbio> are not free'd and it is up to the application
 to do so.
 
-OSSL_HTTP_REQ_CTX_header() adds an HTTP request line to the request context.
+OSSL_HTTP_REQ_CTX_set_request_line() adds the HTTP request line to the context.
 The request command itself becomes C<GET> or C<POST> depending on the value
 of I<method_GET> in the OSSL_HTTP_REQ_CTX_new() call.  I<server> and I<port>
 may be set to indicate a proxy server and port that the request should go
@@ -129,7 +129,7 @@ Then, the HTTP request must be prepared with request data:
 
 =item 1.
 
-Calling OSSL_HTTP_REQ_CTX_header().  This must be done exactly once.
+Calling OSSL_HTTP_REQ_CTX_set_request_line().  This must be done exactly once.
 
 =item 2.
 
@@ -146,7 +146,7 @@ exactly once in that case.
 When the request context is fully prepared, the HTTP exchange may be performed
 with OSSL_HTTP_REQ_CTX_nbio() or OSSL_HTTP_REQ_CTX_sendreq_d2i().
 
-Furthermore, all calls of OSSL_HTTP_REQ_CTX_header() and
+Furthermore, all calls of OSSL_HTTP_REQ_CTX_set_request_line() and
 OSSL_HTTP_REQ_CTX_add1_header() must be done before any call to
 int OSSL_HTTP_REQ_CTX_nbio() or OSSL_HTTP_REQ_CTX_sendreq_d2i().
 
@@ -158,7 +158,7 @@ on error.
 OSSL_HTTP_REQ_CTX_free() and OSSL_HTTP_REQ_CTX_set_max_response_length()
 do not return values.
 
-OSSL_HTTP_REQ_CTX_header(), OSSL_HTTP_REQ_CTX_add1_header(),
+OSSL_HTTP_REQ_CTX_set_request_line(), OSSL_HTTP_REQ_CTX_add1_header(),
 OSSL_HTTP_REQ_CTX_i2d() and OSSL_HTTP_REQ_CTX_nbio return 1 for success and 0
 for failure.
 
index 0bd32e514e17c3f1e082defadba5a55587e14189..84a106f57a6aaa42cb162bd5a6981a6ee111c2d1 100644 (file)
@@ -42,9 +42,9 @@ OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio,
                                          const char *expected_content_type,
                                          int expect_asn1);
 void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
-int OSSL_HTTP_REQ_CTX_header(OSSL_HTTP_REQ_CTX *rctx,
-                             const char *server,
-                             const char *port, const char *path);
+int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx,
+                                       const char *server, const char *port,
+                                       const char *path);
 int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
                                   const char *name, const char *value);
 int OSSL_HTTP_REQ_CTX_i2d(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
index c3a0b0e26731d9041d002957d72b15b225c22bde..76f7c1602ac917038e4a19b72b555b4eb8b75ab6 100644 (file)
@@ -184,8 +184,8 @@ int OCSP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const OCSP_REQUEST *req);
         OSSL_HTTP_REQ_CTX_new(wb, rb, m, ml, mrl, t, ect, ea)
 #   define OCSP_REQ_CTX_free(r) \
         OSSL_HTTP_REQ_CTX_free(r)
-#   define OCSP_REQ_CTX_http(r, s, po, pa) \
-        OSSL_HTTP_REQ_CTX_header(r, s, po, pa)
+#   define OCSP_REQ_CTX_http(r, s, p, path) \
+        OSSL_HTTP_REQ_CTX_set_request_line(r, s, p, path)
 #   define OCSP_REQ_CTX_add1_header(r, n, v) \
         OSSL_HTTP_REQ_CTX_add1_header(r, n, v)
 #   define OCSP_REQ_CTX_i2d(r, c, i, req) \
index 1cd4b86f4d09584a0a6abb043c424897c6eeb02a..be5bed741a82c52e1c5905a149fcc0658a8e85c9 100644 (file)
@@ -1379,7 +1379,7 @@ BIO_set_ex_data                         1411      3_0_0   EXIST::FUNCTION:
 SHA512                                  1412   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3_0
 X509_STORE_CTX_get_explicit_policy      1413   3_0_0   EXIST::FUNCTION:
 EVP_DecodeBlock                         1414   3_0_0   EXIST::FUNCTION:
-OSSL_HTTP_REQ_CTX_header                1415   3_0_0   EXIST::FUNCTION:
+OSSL_HTTP_REQ_CTX_set_request_line      1415   3_0_0   EXIST::FUNCTION:
 EVP_MD_CTX_reset                        1416   3_0_0   EXIST::FUNCTION:
 X509_NAME_new                           1417   3_0_0   EXIST::FUNCTION:
 ASN1_item_pack                          1418   3_0_0   EXIST::FUNCTION: