]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix safestack issues in pkcs12.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 15:35:20 +0000 (16:35 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:11:21 +0000 (11:11 +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
apps/pkcs12.c
build.info
crypto/pkcs12/p12_crt.c
crypto/pkcs12/p12_kiss.c
crypto/pkcs12/p12_npas.c
include/openssl/pkcs12.h.in [moved from include/openssl/pkcs12.h with 98% similarity]
test/pkcs12_helper.c

index e7e924d74a62aacb5eb7741621eb3c9f6cd0234c..a173bbfe13951a8fdc741ad02b26fef7512d540e 100644 (file)
@@ -36,6 +36,7 @@
 /include/openssl/fipskey.h
 /include/openssl/ocsp.h
 /include/openssl/opensslv.h
+/include/openssl/pkcs12.h
 /include/openssl/pkcs7.h
 /include/openssl/safestack.h
 /include/openssl/srp.h
index fd626d9d0570df03372ca8dda420c8fdaa004efe..b0f03232a7555450f4b448898f933d60537b0391 100644 (file)
@@ -20,8 +20,6 @@
 #include <openssl/pkcs12.h>
 #include <openssl/provider.h>
 
-DEFINE_STACK_OF(PKCS12_SAFEBAG)
-
 #define NOKEYS          0x1
 #define NOCERTS         0x2
 #define INFO            0x4
index 091c4791d6b21d7319d912711780d9f8889ec6ce..a5f6498ac205fed311dbef7eb10a7badc024212a 100644 (file)
@@ -27,6 +27,7 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/fipskey.h \
          include/openssl/opensslv.h \
          include/openssl/ocsp.h \
+         include/openssl/pkcs12.h \
          include/openssl/pkcs7.h \
          include/openssl/safestack.h \
          include/openssl/srp.h \
@@ -51,6 +52,7 @@ GENERATE[include/openssl/ess.h]=include/openssl/ess.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/pkcs12.h]=include/openssl/pkcs12.h.in
 GENERATE[include/openssl/pkcs7.h]=include/openssl/pkcs7.h.in
 GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
 GENERATE[include/openssl/srp.h]=include/openssl/srp.h.in
index d673c8b293c500c1cc28145c1a5048da7242c8e5..88571fd165440b1ea546bce51c0e538787e21517 100644 (file)
@@ -12,8 +12,6 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"
 
-DEFINE_STACK_OF(PKCS12_SAFEBAG)
-
 static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
                           PKCS12_SAFEBAG *bag);
 
index a43091380cb0c2815133162991c39ffadc57d4f0..126a6ce94b3bc0f19321815467a193bd8f75b97f 100644 (file)
@@ -12,8 +12,6 @@
 #include <openssl/pkcs12.h>
 #include "crypto/x509.h" /* for X509_add_cert_new() */
 
-DEFINE_STACK_OF(PKCS12_SAFEBAG)
-
 /* Simplified PKCS#12 routines */
 
 static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,
index 99e21489adb69f752fddd395fb91b881a30b880b..ee35c45abb45fd6db8725a8f7ac85fd4fe8ae62c 100644 (file)
@@ -15,8 +15,6 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"
 
-DEFINE_STACK_OF(PKCS12_SAFEBAG)
-
 /* PKCS#12 password change routine */
 
 static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);
similarity index 98%
rename from include/openssl/pkcs12.h
rename to include/openssl/pkcs12.h.in
index 46e95c11b6d192cdb917a0277e8ab2ecb4660cfd..f829dc74394cd58549e4a311600d8b3f277f3026 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 1999-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_PKCS12_H
 # define OPENSSL_PKCS12_H
 # pragma once
@@ -52,7 +58,9 @@ typedef struct PKCS12_st PKCS12;
 
 typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
 
-DEFINE_OR_DECLARE_STACK_OF(PKCS12_SAFEBAG)
+{-
+    generate_stack_macros("PKCS12_SAFEBAG");
+-}
 
 typedef struct pkcs12_bag_st PKCS12_BAGS;
 
index d3b7a63917659db5c3fcbdbe7fd064a9af044490..dd64a2a716ab47afd4c7527f5a80110872ec380b 100644 (file)
@@ -21,8 +21,6 @@
 #include "testutil.h"
 #include "pkcs12_helper.h"
 
-DEFINE_STACK_OF(PKCS12_SAFEBAG)
-
 /* Set this to > 0 write test data to file */
 int write_files = 0;