]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix safestack issues in ocsp.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 14:05:30 +0000 (15:05 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:10:41 +0000 (11:10 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12781)

12 files changed:
.gitignore
apps/ocsp.c
build.info
crypto/ocsp/ocsp_cl.c
crypto/ocsp/ocsp_prn.c
crypto/ocsp/ocsp_srv.c
crypto/ocsp/ocsp_vfy.c
include/openssl/ocsp.h.in [moved from include/openssl/ocsp.h with 98% similarity]
ssl/ssl_lib.c
ssl/statem/extensions_clnt.c
ssl/statem/extensions_srvr.c
test/sslapitest.c

index f0c19f434fdf71b72be4f0e681ebddf8cfaaac18..6d6850c104b0b5d4380fc4d58bd41a437316b370 100644 (file)
@@ -27,6 +27,7 @@
 /include/openssl/cms.h
 /include/openssl/configuration.h
 /include/openssl/fipskey.h
+/include/openssl/ocsp.h
 /include/openssl/opensslv.h
 /include/openssl/safestack.h
 /include/openssl/ssl.h
index 6943267bdeb93f2180593dae439e54c79eec7c23..2540ce118ee228e3382ed817d0ed5b0528b9ad8c 100644 (file)
@@ -33,7 +33,6 @@
 #include <openssl/bn.h>
 #include <openssl/x509v3.h>
 
-DEFINE_STACK_OF(OCSP_CERTID)
 DEFINE_STACK_OF(CONF_VALUE)
 
 #if defined(__TANDEM)
index 8729d6c5aa82a189c30ffb83020aca0de0d69bfd..406ce29af072ee5143fea24b337283a6daeabc43 100644 (file)
@@ -19,6 +19,7 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/configuration.h \
          include/openssl/fipskey.h \
          include/openssl/opensslv.h \
+         include/openssl/ocsp.h \
          include/openssl/safestack.h \
          include/openssl/ssl.h \
          include/openssl/x509.h \
@@ -31,6 +32,7 @@ GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
 GENERATE[include/openssl/cmp.h]=include/openssl/cmp.h.in
 GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
 GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
+GENERATE[include/openssl/ocsp.h]=include/openssl/ocsp.h.in
 GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
 GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
 GENERATE[include/openssl/ssl.h]=include/openssl/ssl.h.in
index b977e88d038c87b3d096cff42841f6449ae423f0..33d77af42651e72805f403205c991ddadc94c32a 100644 (file)
@@ -18,9 +18,6 @@
 #include <openssl/ocsp.h>
 #include "ocsp_local.h"
 
-DEFINE_STACK_OF(OCSP_ONEREQ)
-DEFINE_STACK_OF(OCSP_SINGLERESP)
-
 /*
  * Utility functions related to sending OCSP requests and extracting relevant
  * information from the response.
index c4917ee18460bf2a3b8686505efcc22d6ca02287..654ddbc7fff3d9e4fba25bb863bf6cf8d55fb0ce 100644 (file)
@@ -14,9 +14,6 @@
 #include "internal/cryptlib.h"
 #include <openssl/pem.h>
 
-DEFINE_STACK_OF(OCSP_ONEREQ)
-DEFINE_STACK_OF(OCSP_SINGLERESP)
-
 static int ocsp_certid_print(BIO *bp, OCSP_CERTID *a, int indent)
 {
     BIO_printf(bp, "%*sCertificate ID:\n", indent, "");
index a87fea892d59ad914fb09b1789f60906f0b5d7dd..ee0e8a612c6020223c5d22827283322919f690ce 100644 (file)
@@ -16,9 +16,6 @@
 #include <openssl/ocsp.h>
 #include "ocsp_local.h"
 
-DEFINE_STACK_OF(OCSP_ONEREQ)
-DEFINE_STACK_OF(OCSP_SINGLERESP)
-
 /*
  * Utility functions related to sending OCSP responses and extracting
  * relevant information from the request.
index 35a01c444dfdcf5fd74cc7866a036cc30e8ec0e8..3138716a0a6a608ebd42d0658216ae74be3a8736 100644 (file)
@@ -12,9 +12,6 @@
 #include <openssl/err.h>
 #include <string.h>
 
-DEFINE_STACK_OF(OCSP_ONEREQ)
-DEFINE_STACK_OF(OCSP_SINGLERESP)
-
 static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
                             STACK_OF(X509) *certs, unsigned long flags);
 static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id);
similarity index 98%
rename from include/openssl/ocsp.h
rename to include/openssl/ocsp.h.in
index 939a90877d4c4fda476c72f69ac673cf8bbbaf61..bf1e5a37fddf26c256c9f6d8afb5889ccf88f41d 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -7,6 +9,10 @@
  * https://www.openssl.org/source/license.html
  */
 
+{-
+use OpenSSL::stackhash qw(generate_stack_macros);
+-}
+
 #ifndef OPENSSL_OCSP_H
 # define OPENSSL_OCSP_H
 # pragma once
@@ -110,8 +116,10 @@ typedef struct ocsp_req_info_st OCSP_REQINFO;
 typedef struct ocsp_signature_st OCSP_SIGNATURE;
 typedef struct ocsp_request_st OCSP_REQUEST;
 
-DEFINE_OR_DECLARE_STACK_OF(OCSP_CERTID)
-DEFINE_OR_DECLARE_STACK_OF(OCSP_ONEREQ)
+{-
+    generate_stack_macros("OCSP_CERTID")
+    .generate_stack_macros("OCSP_ONEREQ");
+-}
 
 #  define OCSP_RESPONSE_STATUS_SUCCESSFUL           0
 #  define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST     1
@@ -125,7 +133,9 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
 #  define V_OCSP_RESPID_NAME 0
 #  define V_OCSP_RESPID_KEY  1
 
-DEFINE_OR_DECLARE_STACK_OF(OCSP_RESPID)
+{-
+    generate_stack_macros("OCSP_RESPID");
+-}
 
 typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
 
@@ -136,7 +146,9 @@ typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
 typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
 typedef struct ocsp_single_response_st OCSP_SINGLERESP;
 
-DEFINE_OR_DECLARE_STACK_OF(OCSP_SINGLERESP)
+{-
+    generate_stack_macros("OCSP_SINGLERESP");
+-}
 
 typedef struct ocsp_response_data_st OCSP_RESPDATA;
 
index ccb0a6087fde2854c39a16f477ead6ed8f9ee4c1..e4cc6efa7683a2d959f1dd98f3f0514d4a95fc93 100644 (file)
@@ -28,7 +28,6 @@
 #include "internal/refcount.h"
 #include "internal/ktls.h"
 
-DEFINE_STACK_OF(OCSP_RESPID)
 DEFINE_STACK_OF(SCT)
 
 static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t,
index f8ae0612e3ab8c76231e21c4d3f9288b1fea0b3a..189e2c9e5edb00e0c5b84422b9a2e6fbe7061058 100644 (file)
@@ -12,8 +12,6 @@
 #include "internal/cryptlib.h"
 #include "statem_local.h"
 
-DEFINE_STACK_OF(OCSP_RESPID)
-
 EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt,
                                           unsigned int context, X509 *x,
                                           size_t chainidx)
index 6adb9cab8211a098873f1fd6cc68822550ef3424..46a8e44442ff1e9a1f09daceec08fe4a31f971e0 100644 (file)
@@ -12,8 +12,6 @@
 #include "statem_local.h"
 #include "internal/cryptlib.h"
 
-DEFINE_STACK_OF(OCSP_RESPID)
-
 #define COOKIE_STATE_FORMAT_VERSION     0
 
 /*
index 2451f3f83268c67454b1b962f0bb8d1898f4ff5b..7f444c545623a38c04a6b3a521f553be3480db22 100644 (file)
@@ -47,7 +47,6 @@ int tls_provider_init(const OSSL_CORE_HANDLE *handle,
                       const OSSL_DISPATCH *in,
                       const OSSL_DISPATCH **out,
                       void **provctx);
-DEFINE_STACK_OF(OCSP_RESPID)
 
 static OPENSSL_CTX *libctx = NULL;
 static OSSL_PROVIDER *defctxnull = NULL;