From: Dr. David von Oheimb Date: Mon, 25 Jan 2021 18:25:18 +0000 (+0100) Subject: Fix not backwards-compat X509_http_nbio() and X509_CRL_http_nbio() X-Git-Tag: openssl-3.0.0-alpha12~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e716147971971beb9ce747c74822abd24c6be13;p=thirdparty%2Fopenssl.git Fix not backwards-compat X509_http_nbio() and X509_CRL_http_nbio() Provides partial fix of #13127. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/13960) --- diff --git a/doc/man3/X509_load_http.pod b/doc/man3/X509_load_http.pod index 483597b5b80..47a0e74760f 100644 --- a/doc/man3/X509_load_http.pod +++ b/doc/man3/X509_load_http.pod @@ -15,8 +15,8 @@ X509_CRL_http_nbio X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); - #define X509_http_nbio(url) - #define X509_CRL_http_nbio(url) + #define X509_http_nbio(rctx, pcert) + #define X509_CRL_http_nbio(rctx, pcrl) =head1 DESCRIPTION diff --git a/include/openssl/x509.h.in b/include/openssl/x509.h.in index bb22abef6b7..8a3cb2e4d0d 100644 --- a/include/openssl/x509.h.in +++ b/include/openssl/x509.h.in @@ -403,9 +403,13 @@ int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md, unsigned int *len); X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); -# define X509_http_nbio(url) X509_load_http(url, NULL, NULL, 0) +# define X509_http_nbio(rctx, pcert) \ + OSSL_HTTP_REQ_CTX_sendreq_d2i(rctx, (ASN1_VALUE **)(pcert), \ + ASN1_ITEM_rptr(X509)) X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); -# define X509_CRL_http_nbio(url) X509_CRL_load_http(url, NULL, NULL, 0) +# define X509_CRL_http_nbio(rctx, pcrl) \ + OSSL_HTTP_REQ_CTX_sendreq_d2i(rctx, (ASN1_VALUE **)(pcrl), \ + ASN1_ITEM_rptr(X509_CRL)) # ifndef OPENSSL_NO_STDIO X509 *d2i_X509_fp(FILE *fp, X509 **x509);