• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TLS/SSL and crypto library


Commit MetaInfo

Revision98c35dc48d36664c404fec2e12ce405ac0fbecc0 (tree)
Zeit2020-09-13 19:10:41
AutorMatt Caswell <matt@open...>
CommiterMatt Caswell

Log Message

Fix safestack issues in crmf.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)

Ändern Zusammenfassung

Diff

--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@
2626 /include/openssl/cmp.h
2727 /include/openssl/cms.h
2828 /include/openssl/configuration.h
29+/include/openssl/crmf.h
2930 /include/openssl/fipskey.h
3031 /include/openssl/ocsp.h
3132 /include/openssl/opensslv.h
--- a/build.info
+++ b/build.info
@@ -17,6 +17,7 @@ DEPEND[]=include/openssl/asn1.h \
1717 include/openssl/cmp.h \
1818 include/openssl/cms.h \
1919 include/openssl/configuration.h \
20+ include/openssl/crmf.h \
2021 include/openssl/fipskey.h \
2122 include/openssl/opensslv.h \
2223 include/openssl/ocsp.h \
@@ -31,9 +32,10 @@ DEPEND[]=include/openssl/asn1.h \
3132 doc/man7/openssl_user_macros.pod
3233
3334 GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
34-GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
3535 GENERATE[include/openssl/cmp.h]=include/openssl/cmp.h.in
3636 GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
37+GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
38+GENERATE[include/openssl/crmf.h]=include/openssl/crmf.h.in
3739 GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
3840 GENERATE[include/openssl/ocsp.h]=include/openssl/ocsp.h.in
3941 GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
--- a/crypto/cmp/cmp_client.c
+++ b/crypto/cmp/cmp_client.c
@@ -21,8 +21,6 @@
2121
2222 #include "openssl/cmp_util.h"
2323
24-DEFINE_STACK_OF(OSSL_CRMF_CERTID)
25-
2624 #define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \
2725 || (t) == OSSL_CMP_PKIBODY_KUP)
2826
--- a/crypto/cmp/cmp_msg.c
+++ b/crypto/cmp/cmp_msg.c
@@ -21,9 +21,6 @@
2121 #include <openssl/x509.h>
2222 #include "crypto/x509.h" /* for x509_set0_libctx() */
2323
24-DEFINE_STACK_OF(OSSL_CRMF_MSG)
25-DEFINE_STACK_OF(OSSL_CRMF_CERTID)
26-
2724 OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)
2825 {
2926 if (msg == NULL) {
--- a/crypto/cmp/cmp_server.c
+++ b/crypto/cmp/cmp_server.c
@@ -19,8 +19,6 @@
1919 #include <openssl/cmp.h>
2020 #include <openssl/err.h>
2121
22-DEFINE_STACK_OF(OSSL_CRMF_MSG)
23-
2422 /* the context for the generic CMP server */
2523 struct ossl_cmp_srv_ctx_st
2624 {
--- a/crypto/crmf/crmf_lib.c
+++ b/crypto/crmf/crmf_lib.c
@@ -36,8 +36,6 @@
3636 #include <openssl/err.h>
3737 #include <openssl/evp.h>
3838
39-DEFINE_STACK_OF(OSSL_CRMF_MSG)
40-
4139 /*-
4240 * atyp = Attribute Type
4341 * valt = Value Type
--- a/crypto/crmf/crmf_local.h
+++ b/crypto/crmf/crmf_local.h
@@ -389,5 +389,4 @@ struct ossl_crmf_msg_st {
389389 /* 1 */
390390 STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *regInfo;
391391 } /* OSSL_CRMF_MSG */;
392-/* DEFINE_STACK_OF(OSSL_CRMF_MSG) */
393392 #endif
--- a/include/openssl/crmf.h
+++ b/include/openssl/crmf.h.in
@@ -1,4 +1,6 @@
11 /*-
2+ * {- join("\n * ", @autowarntext) -}
3+ *
24 * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
35 * Copyright Nokia 2007-2019
46 * Copyright Siemens AG 2015-2019
@@ -11,6 +13,10 @@
1113 * CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
1214 */
1315
16+{-
17+use OpenSSL::stackhash qw(generate_stack_macros);
18+-}
19+
1420 #ifndef OPENSSL_CRMF_H
1521 # define OPENSSL_CRMF_H
1622
@@ -44,7 +50,9 @@ DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
4450 typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
4551 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
4652 DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
47-DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_MSG)
53+{-
54+ generate_stack_macros("OSSL_CRMF_MSG");
55+-}
4856 typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
4957 typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
5058 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
@@ -53,7 +61,9 @@ typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
5361 typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
5462 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
5563 DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
56-DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_CERTID)
64+{-
65+ generate_stack_macros("OSSL_CRMF_CERTID");
66+-}
5767
5868 typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
5969 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
--- a/test/cmp_vfy_test.c
+++ b/test/cmp_vfy_test.c
@@ -11,7 +11,6 @@
1111
1212 #include "cmp_testlib.h"
1313 #include "../crypto/crmf/crmf_local.h" /* for manipulating POPO signature */
14-DEFINE_STACK_OF(OSSL_CRMF_MSG)
1514
1615 static const char *server_f;
1716 static const char *client_f;