diff options
author | Richard Levitte <levitte@openssl.org> | 2020-12-18 13:17:33 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-12-19 17:02:12 +0100 |
commit | 6ed4022cd1e4b066ddc6131ca659d8a260944a76 (patch) | |
tree | eb1d3a9b53ce8f9f2821a6ce0f2b5b0916dc07db /fuzz | |
parent | a5f2782ceca7af2480c86562e8952b2980251e4e (diff) | |
download | openssl-6ed4022cd1e4b066ddc6131ca659d8a260944a76.tar.gz |
Fix 'no-deprecated'
Some of the handling of no-deprecated stuff wasn't quite complete, or
even plain wrong.
This restores i2d_PublicKey() to be able to handle EVP_PKEYs with
legacy internal keys.
This also refactors the DSA key tests in test/evp_extra_test.c to use
EVP functionality entirely.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13706)
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/server.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fuzz/server.c b/fuzz/server.c index dc2ade686d..ead9fc1105 100644 --- a/fuzz/server.c +++ b/fuzz/server.c @@ -292,7 +292,7 @@ static const char ECDSACertPEM[] = { }; #endif -#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DEPRECATED_3_0) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) /* * -----BEGIN DSA PRIVATE KEY----- * MIIBuwIBAAKBgQDdkFKzNABLOha7Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXP @@ -512,8 +512,8 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) SSL *server; BIO *in; BIO *out; -#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DSA) \ - || !defined(OPENSSL_NO_DEPRECATED_3_0) +#if !defined(OPENSSL_NO_EC) \ + || (!defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)) BIO *bio_buf; #endif SSL_CTX *ctx; @@ -522,15 +522,16 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) RSA *privkey; #endif const uint8_t *bufp; -#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_EC) \ - || !defined(OPENSSL_NO_DEPRECATED_3_0) +#if !defined(OPENSSL_NO_DEPRECATED_3_0) \ + || !defined(OPENSSL_NO_DSA) \ + || !defined(OPENSSL_NO_EC) EVP_PKEY *pkey; #endif X509 *cert; #ifndef OPENSSL_NO_EC EC_KEY *ecdsakey = NULL; #endif -#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DEPRECATED_3_0) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) DSA *dsakey = NULL; #endif uint8_t opt; @@ -593,7 +594,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) X509_free(cert); #endif -#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DEPRECATED_3_0) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0) /* DSA */ bio_buf = BIO_new(BIO_s_mem()); OPENSSL_assert((size_t)BIO_write(bio_buf, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)) == sizeof(DSAPrivateKeyPEM)); |