Fix safestack issues in srp.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 14:31:44 +0000 (15:31 +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/srp/srp_vfy.c
include/openssl/srp.h.in [moved from include/openssl/srp.h with 95% similarity]
test/sslapitest.c

index 263a748e3a7bc97b6660938a7f34c82226392b81..4a29456053c280b695354b17bde923d05cc06704 100644 (file)
@@ -31,6 +31,7 @@
 /include/openssl/opensslv.h
 /include/openssl/pkcs7.h
 /include/openssl/safestack.h
+/include/openssl/srp.h
 /include/openssl/ssl.h
 /include/openssl/x509.h
 /include/openssl/x509v3.h
index 876135a6c7b86dcd972863f6c16a5225a5582753..722d886911321474304c58d11910b0efc8e4c8e2 100644 (file)
@@ -22,6 +22,7 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/ocsp.h \
          include/openssl/pkcs7.h \
          include/openssl/safestack.h \
+         include/openssl/srp.h \
          include/openssl/ssl.h \
          include/openssl/x509.h \
          include/openssl/x509v3.h \
@@ -37,6 +38,7 @@ GENERATE[include/openssl/ocsp.h]=include/openssl/ocsp.h.in
 GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.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
 GENERATE[include/openssl/ssl.h]=include/openssl/ssl.h.in
 GENERATE[include/openssl/x509.h]=include/openssl/x509.h.in
 GENERATE[include/openssl/x509v3.h]=include/openssl/x509v3.h.in
index f0ed6da6f6fd7c203aab490bc915fb25ab8d7069..6c50d064578cd0bad0f20e9046b04beb77b850a8 100644 (file)
 # define SRP_RANDOM_SALT_LEN 20
 # define MAX_LEN 2500
 
-DEFINE_STACK_OF(SRP_user_pwd)
-DEFINE_STACK_OF(SRP_gN_cache)
-DEFINE_STACK_OF(SRP_gN)
-
 /*
  * Note that SRP uses its own variant of base 64 encoding. A different base64
  * alphabet is used and no padding '=' characters are added. Instead we pad to
similarity index 95%
rename from include/openssl/srp.h
rename to include/openssl/srp.h.in
index 5c8f5368f88a9a7bc3cbebe12a705ce42e092733..7ea855d9a0feb09ae87a12b9ae4f115ef578fdac 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2004, EdelKey Project. All Rights Reserved.
  *
  * for the EdelKey project.
  */
 
+{-
+use OpenSSL::stackhash qw(generate_stack_macros);
+-}
+
 #ifndef OPENSSL_SRP_H
 # define OPENSSL_SRP_H
 # pragma once
@@ -37,7 +43,10 @@ typedef struct SRP_gN_cache_st {
     char *b64_bn;
     BIGNUM *bn;
 } SRP_gN_cache;
-DEFINE_OR_DECLARE_STACK_OF(SRP_gN_cache)
+{-
+    generate_stack_macros("SRP_gN_cache");
+-}
+
 
 typedef struct SRP_user_pwd_st {
     /* Owned by us. */
@@ -50,7 +59,9 @@ typedef struct SRP_user_pwd_st {
     /* Owned by us. */
     char *info;
 } SRP_user_pwd;
-DEFINE_OR_DECLARE_STACK_OF(SRP_user_pwd)
+{-
+    generate_stack_macros("SRP_user_pwd");
+-}
 
 SRP_user_pwd *SRP_user_pwd_new(void);
 void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
@@ -76,7 +87,10 @@ typedef struct SRP_gN_st {
     const BIGNUM *g;
     const BIGNUM *N;
 } SRP_gN;
-DEFINE_OR_DECLARE_STACK_OF(SRP_gN)
+{-
+    generate_stack_macros("SRP_gN");
+-}
+
 
 SRP_VBASE *SRP_VBASE_new(char *seed_key);
 void SRP_VBASE_free(SRP_VBASE *vb);
index 7f444c545623a38c04a6b3a521f553be3480db22..75d3c6fbfc95608dbb656c3ad7239958d1ceac9a 100644 (file)
@@ -5939,8 +5939,6 @@ static int test_pha_key_update(void)
 
 static SRP_VBASE *vbase = NULL;
 
-DEFINE_STACK_OF(SRP_user_pwd)
-
 static int ssl_srp_cb(SSL *s, int *ad, void *arg)
 {
     int ret = SSL3_AL_FATAL;