diff options
author | Matt Caswell <matt@openssl.org> | 2019-11-07 09:24:18 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-11-11 09:39:05 +0000 |
commit | f650ab4738107d01925bd4d9043e18bf27ba2dcd (patch) | |
tree | 64e0599c29200a6665d0a0c5a2406862031801fe | |
parent | 8fece3355a76bf9c82d13b5389f88a3649c1e547 (diff) |
Fix no-dsa
Make sure we don't try and load a DSA key in the tests if DSA has been
disabled.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10375)
-rw-r--r-- | test/evp_extra_test.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index e7409619fd..f4e792fb1d 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -88,6 +88,7 @@ static const unsigned char kExampleRSAKeyDER[] = { * kExampleDSAKeyDER is a DSA private key in ASN.1, DER format. Of course, you * should never use this key anywhere but in an example. */ +#ifndef OPENSSL_NO_DSA static const unsigned char kExampleDSAKeyDER[] = { 0x30, 0x82, 0x01, 0xba, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0x9a, 0x05, 0x6d, 0x33, 0xcd, 0x5d, 0x78, 0xa1, 0xbb, 0xcb, 0x7d, 0x5b, 0x8d, @@ -128,6 +129,7 @@ static const unsigned char kExampleDSAKeyDER[] = { 0xf1, 0x8c, 0x82, 0x97, 0xf2, 0xf4, 0x19, 0xba, 0x2b, 0xf3, 0x16, 0xbe, 0x40, 0x48 }; +#endif /* * kExampleBadRSAKeyDER is an RSA private key in ASN.1, DER format. The private @@ -422,6 +424,7 @@ end: return ret; } +#ifndef OPENSSL_NO_DSA static EVP_PKEY *load_example_dsa_key(void) { EVP_PKEY *ret = NULL; @@ -445,7 +448,7 @@ end: return ret; } - +#endif static int test_EVP_Enveloped(void) { @@ -525,8 +528,13 @@ static int test_EVP_DigestSignInit(int tst) if (!TEST_ptr(pkey = load_example_rsa_key())) goto out; } else { +#ifndef OPENSSL_NO_DSA if (!TEST_ptr(pkey = load_example_dsa_key())) goto out; +#else + ret = 1; + goto out; +#endif } if (!TEST_true(EVP_DigestSignInit(md_ctx, NULL, EVP_sha256(), NULL, pkey))) |