diff options
author | Matt Caswell <matt@openssl.org> | 2020-09-03 16:31:44 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-09-13 12:10:41 +0200 |
commit | 22fbfe6a7d13c7c9417f8a10103d28fe70991e94 (patch) | |
tree | bcbfa0c2846db8b42679a5a84e9e97787b687765 | |
parent | Fix safestack issues in pkcs7.h (diff) | |
download | openssl-22fbfe6a7d13c7c9417f8a10103d28fe70991e94.tar.xz openssl-22fbfe6a7d13c7c9417f8a10103d28fe70991e94.zip |
Fix safestack issues in srp.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-- | .gitignore | 1 | ||||
-rw-r--r-- | build.info | 2 | ||||
-rw-r--r-- | crypto/srp/srp_vfy.c | 4 | ||||
-rw-r--r-- | include/openssl/srp.h.in (renamed from include/openssl/srp.h) | 20 | ||||
-rw-r--r-- | test/sslapitest.c | 2 |
5 files changed, 20 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore index 263a748e3a..4a29456053 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/build.info b/build.info index 876135a6c7..722d886911 100644 --- a/build.info +++ b/build.info @@ -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 diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index f0ed6da6f6..6c50d06457 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c @@ -25,10 +25,6 @@ # 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 diff --git a/include/openssl/srp.h b/include/openssl/srp.h.in index 5c8f5368f8..7ea855d9a0 100644 --- a/include/openssl/srp.h +++ b/include/openssl/srp.h.in @@ -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. * @@ -11,6 +13,10 @@ * 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); diff --git a/test/sslapitest.c b/test/sslapitest.c index 7f444c5456..75d3c6fbfc 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -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; |