summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-09-03 16:35:20 +0100
committerMatt Caswell <matt@openssl.org>2020-09-13 11:11:21 +0100
commitadd339272773072e0d8995362c6167e515377c7f (patch)
tree2ff7010f293d72c4a210d69969edc0f477f5c65e
parent15c3dcfc78553c70439d816a9c5471b8d5a6c54f (diff)
Fix safestack issues in pkcs12.h
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
-rw-r--r--.gitignore1
-rw-r--r--apps/pkcs12.c2
-rw-r--r--build.info2
-rw-r--r--crypto/pkcs12/p12_crt.c2
-rw-r--r--crypto/pkcs12/p12_kiss.c2
-rw-r--r--crypto/pkcs12/p12_npas.c2
-rw-r--r--include/openssl/pkcs12.h.in (renamed from include/openssl/pkcs12.h)10
-rw-r--r--test/pkcs12_helper.c2
8 files changed, 12 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index e7e924d74a..a173bbfe13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index fd626d9d05..b0f03232a7 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -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
diff --git a/build.info b/build.info
index 091c4791d6..a5f6498ac2 100644
--- a/build.info
+++ b/build.info
@@ -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
diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c
index d673c8b293..88571fd165 100644
--- a/crypto/pkcs12/p12_crt.c
+++ b/crypto/pkcs12/p12_crt.c
@@ -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);
diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c
index a43091380c..126a6ce94b 100644
--- a/crypto/pkcs12/p12_kiss.c
+++ b/crypto/pkcs12/p12_kiss.c
@@ -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,
diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c
index 99e21489ad..ee35c45abb 100644
--- a/crypto/pkcs12/p12_npas.c
+++ b/crypto/pkcs12/p12_npas.c
@@ -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);
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h.in
index 46e95c11b6..f829dc7439 100644
--- a/include/openssl/pkcs12.h
+++ b/include/openssl/pkcs12.h.in
@@ -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;
diff --git a/test/pkcs12_helper.c b/test/pkcs12_helper.c
index d3b7a63917..dd64a2a716 100644
--- a/test/pkcs12_helper.c
+++ b/test/pkcs12_helper.c
@@ -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;