]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix safestack issues in crmf.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 14:45:01 +0000 (15:45 +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)

.gitignore
build.info
crypto/cmp/cmp_client.c
crypto/cmp/cmp_msg.c
crypto/cmp/cmp_server.c
crypto/crmf/crmf_lib.c
crypto/crmf/crmf_local.h
include/openssl/crmf.h.in [moved from include/openssl/crmf.h with 97% similarity]
test/cmp_vfy_test.c

index f228f23604536b40af5dfe96be42173f1d7e226c..aca011b2c165f57b55fcfc55bc9ac6a1da3d081b 100644 (file)
@@ -26,6 +26,7 @@
 /include/openssl/cmp.h
 /include/openssl/cms.h
 /include/openssl/configuration.h
+/include/openssl/crmf.h
 /include/openssl/fipskey.h
 /include/openssl/ocsp.h
 /include/openssl/opensslv.h
index 669ccf4c3a2718c55947d01b9e49f66627bc3868..828918c6c6c68e28b05f26f58e38d6228cc3aa41 100644 (file)
@@ -17,6 +17,7 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/cmp.h \
          include/openssl/cms.h \
          include/openssl/configuration.h \
+         include/openssl/crmf.h \
          include/openssl/fipskey.h \
          include/openssl/opensslv.h \
          include/openssl/ocsp.h \
@@ -31,9 +32,10 @@ DEPEND[]=include/openssl/asn1.h \
          doc/man7/openssl_user_macros.pod
 
 GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
-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/configuration.h]=include/openssl/configuration.h.in
+GENERATE[include/openssl/crmf.h]=include/openssl/crmf.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
index ad34b978c7c3a162a5bda9ff065879543c42f589..ef256e6c72179e4980c440dcbf9985dcd6601495 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "openssl/cmp_util.h"
 
-DEFINE_STACK_OF(OSSL_CRMF_CERTID)
-
 #define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \
                         || (t) == OSSL_CMP_PKIBODY_KUP)
 
index 73246ffaee5d51c08ad7558657c9efda8f38c162..5ff8e9fc5299571ecaa7a0727608bb8651e169c8 100644 (file)
@@ -21,9 +21,6 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h" /* for x509_set0_libctx() */
 
-DEFINE_STACK_OF(OSSL_CRMF_MSG)
-DEFINE_STACK_OF(OSSL_CRMF_CERTID)
-
 OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)
 {
     if (msg == NULL) {
index 94aa9aac8b38b54b1da9e80eb864a8812ef8d1ba..e9ddf496f265c3cf7c19c5cb9c9ee9fcf86e7a91 100644 (file)
@@ -19,8 +19,6 @@
 #include <openssl/cmp.h>
 #include <openssl/err.h>
 
-DEFINE_STACK_OF(OSSL_CRMF_MSG)
-
 /* the context for the generic CMP server */
 struct ossl_cmp_srv_ctx_st
 {
index 5c3acaf4b25754836c40fd663b3124cfe2831199..5a6cdb7e82c2556826988ab6ed6c5736e54c0db9 100644 (file)
@@ -36,8 +36,6 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>
 
-DEFINE_STACK_OF(OSSL_CRMF_MSG)
-
 /*-
  * atyp = Attribute Type
  * valt = Value Type
index b4d669875c1310a3de4a11ed615be3d8993f898c..ee1ec7b07a3a4d6a141d2525685cfa4cf422f9bd 100644 (file)
@@ -389,5 +389,4 @@ struct ossl_crmf_msg_st {
     /* 1 */
     STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *regInfo;
 } /* OSSL_CRMF_MSG */;
-/* DEFINE_STACK_OF(OSSL_CRMF_MSG) */
 #endif
similarity index 97%
rename from include/openssl/crmf.h
rename to include/openssl/crmf.h.in
index 022f0bb9d21175f41fc3e0462686d8ed8f59c204..bc81bf591a86ccc3bea754d74625cb75831db526 100644 (file)
@@ -1,4 +1,6 @@
 /*-
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  * CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
  */
 
+{-
+use OpenSSL::stackhash qw(generate_stack_macros);
+-}
+
 #ifndef OPENSSL_CRMF_H
 # define OPENSSL_CRMF_H
 
@@ -44,7 +50,9 @@ DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
 typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
 DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
-DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_MSG)
+{-
+    generate_stack_macros("OSSL_CRMF_MSG");
+-}
 typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
 typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
@@ -53,7 +61,9 @@ typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
 typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
 DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
-DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_CERTID)
+{-
+    generate_stack_macros("OSSL_CRMF_CERTID");
+-}
 
 typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
index 93d57dd8bb5ce8eff941347ff9be02b7bea1ac27..0559ec47c3d2b3c3daed1b7d21050f1186f66d45 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "cmp_testlib.h"
 #include "../crypto/crmf/crmf_local.h" /* for manipulating POPO signature */
-DEFINE_STACK_OF(OSSL_CRMF_MSG)
 
 static const char *server_f;
 static const char *client_f;