From: Pauli Date: Tue, 20 Oct 2020 03:32:08 +0000 (+1000) Subject: dsa: fuzzer deprecation changes X-Git-Tag: openssl-3.0.0-alpha10~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=575b36ecefca4eff181210ff1eeb3a3dcfbf5456;p=thirdparty%2Fopenssl.git dsa: fuzzer deprecation changes Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/13638) --- diff --git a/fuzz/asn1.c b/fuzz/asn1.c index a6f1405881e..b0d2ecd14ef 100644 --- a/fuzz/asn1.c +++ b/fuzz/asn1.c @@ -337,9 +337,11 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) #endif #ifndef OPENSSL_NO_DSA DO_TEST_NO_PRINT(DSA_SIG, d2i_DSA_SIG, i2d_DSA_SIG); +# ifndef OPENSSL_NO_DEPRECATED_3_0 DO_TEST_NO_PRINT(DSA, d2i_DSAPrivateKey, i2d_DSAPrivateKey); DO_TEST_NO_PRINT(DSA, d2i_DSAPublicKey, i2d_DSAPublicKey); DO_TEST_NO_PRINT(DSA, d2i_DSAparams, i2d_DSAparams); +# endif #endif #ifndef OPENSSL_NO_DEPRECATED_3_0 DO_TEST_NO_PRINT(RSA, d2i_RSAPublicKey, i2d_RSAPublicKey); diff --git a/fuzz/server.c b/fuzz/server.c index 26c1c172cfc..dc2ade686dd 100644 --- a/fuzz/server.c +++ b/fuzz/server.c @@ -292,7 +292,7 @@ static const char ECDSACertPEM[] = { }; #endif -#ifndef OPENSSL_NO_DSA +#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DEPRECATED_3_0) /* * -----BEGIN DSA PRIVATE KEY----- * MIIBuwIBAAKBgQDdkFKzNABLOha7Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXP @@ -512,7 +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) +#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DSA) \ + || !defined(OPENSSL_NO_DEPRECATED_3_0) BIO *bio_buf; #endif SSL_CTX *ctx; @@ -529,7 +530,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) #ifndef OPENSSL_NO_EC EC_KEY *ecdsakey = NULL; #endif -#ifndef OPENSSL_NO_DSA +#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DEPRECATED_3_0) DSA *dsakey = NULL; #endif uint8_t opt; @@ -592,7 +593,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len) X509_free(cert); #endif -#ifndef OPENSSL_NO_DSA +#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));