[openssl] master update

Richard Levitte levitte at openssl.org
Fri Dec 4 19:48:18 UTC 2020


The branch master has been updated
       via  76191c7999e0d1f709ea468950457f71cea378c4 (commit)
       via  3c667d9888bc719169e74cb797a0783da3893122 (commit)
       via  f2e94543641f45ace6e960cd7d8592bf537fb55d (commit)
       via  3be1dc50aa9d5394fd545adf792c17ccc3dbaec5 (commit)
       via  2b3f59fd494145fffa41943b003025887e8aec7d (commit)
       via  033b8d5ee0863228718aa17c241f2adea30092d5 (commit)
       via  0038fff07d39515acfbd123b85c45c877350db0a (commit)
       via  632fb5259f066b1b3a5971905da350a1743cde84 (commit)
       via  17fbbe7727f62d288c5ade9576228fce5390714a (commit)
       via  53a14afee9a2a595fd567f9fefdbeae43fe02c75 (commit)
       via  1b6d1f51b40d95bc6bd6fae67f906ca856b1aa7a (commit)
       via  00639486b0ab66d9cd89ab47fc56a3ac6cb40084 (commit)
       via  be8e9b39a32d6eae59f8b7eab48e9535bd4e9bb2 (commit)
       via  be5b2b64a559628dff876cfdf028308cbe6c7e2d (commit)
       via  5fb0f3178fc23739781c5ba219180e64a82a2314 (commit)
       via  4ea7e4e013e8159816cfb9928460a8f3f6044a1d (commit)
       via  0c5f728456e5bb726d14f6423d120e4d01da661d (commit)
       via  4b361f87a98a3ad2f78eee9308dfc56c428d302b (commit)
       via  ba21405888340f1e2038939468669b9c1bc0313b (commit)
       via  306265819b106c27251d66f41ecc8f572ad66ced (commit)
       via  f6be9ae210669b505e6ab8300d17f819658551e9 (commit)
       via  d43788bd207dd7e9ff0feb9dc981496b217809bb (commit)
       via  27147678ca7779d20fef5bb93a4d1cd0abccc573 (commit)
       via  05cb22388ffe71b59c048c94c90affe4413d3f2b (commit)
       via  7f7c856c66709a419136b6bf4cde7ef0bf7b7ede (commit)
       via  db617a4a6bdd35baadc62af84eca6bb698b55677 (commit)
       via  ebafdfac737e1f49ac1ed5307edff99c061c82a1 (commit)
       via  0294097253fcdafb97085de70a757b908e346bf2 (commit)
       via  4b66e5256f515c53e95c55a1598862ec529cb5f8 (commit)
       via  6638749f0f168d5219ae311bcf14048ff4dd4429 (commit)
       via  894fe6e1d68216b8c656c4f5e6cde157747b7ae0 (commit)
       via  d1b99dd905b2405c77243fcf17f3390512d7731a (commit)
       via  0016a034a7da28df038c9b4a5fd0417b0d9a52af (commit)
      from  d7cdb8b60650e29c1f3c3990f3f86b51fde1c308 (commit)


- Log -----------------------------------------------------------------
commit 76191c7999e0d1f709ea468950457f71cea378c4
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:10:06 2020 +0100

    Switch deprecation method for X.509
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 3c667d9888bc719169e74cb797a0783da3893122
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:09:55 2020 +0100

    Switch deprecation method for Whirlpool
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit f2e94543641f45ace6e960cd7d8592bf537fb55d
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:09:42 2020 +0100

    Switch deprecation method for OSSL_STORE
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 3be1dc50aa9d5394fd545adf792c17ccc3dbaec5
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:09:29 2020 +0100

    Switch deprecation method for SSL
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 2b3f59fd494145fffa41943b003025887e8aec7d
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:09:15 2020 +0100

    Switch deprecation method for SRP
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 033b8d5ee0863228718aa17c241f2adea30092d5
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:09:06 2020 +0100

    Switch deprecation method for SHA
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 0038fff07d39515acfbd123b85c45c877350db0a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:58 2020 +0100

    Switch deprecation method for SEED
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 632fb5259f066b1b3a5971905da350a1743cde84
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:49 2020 +0100

    Switch deprecation method for RIPEMD
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 17fbbe7727f62d288c5ade9576228fce5390714a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:33 2020 +0100

    Switch deprecation method for RC5
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 53a14afee9a2a595fd567f9fefdbeae43fe02c75
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:27 2020 +0100

    Switch deprecation method for RC4
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 1b6d1f51b40d95bc6bd6fae67f906ca856b1aa7a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:18 2020 +0100

    Switch deprecation method for RC2
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 00639486b0ab66d9cd89ab47fc56a3ac6cb40084
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:08:03 2020 +0100

    Switch deprecation method for RAND
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit be8e9b39a32d6eae59f8b7eab48e9535bd4e9bb2
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:07:54 2020 +0100

    Switch deprecation method for PKCS#12
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit be5b2b64a559628dff876cfdf028308cbe6c7e2d
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:07:40 2020 +0100

    Switch deprecation method for MDC2
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 5fb0f3178fc23739781c5ba219180e64a82a2314
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:07:31 2020 +0100

    Switch deprecation method for MD5
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 4ea7e4e013e8159816cfb9928460a8f3f6044a1d
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:07:24 2020 +0100

    Switch deprecation method for MD4
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 0c5f728456e5bb726d14f6423d120e4d01da661d
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:07:10 2020 +0100

    Switch deprecation method for MD2
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 4b361f87a98a3ad2f78eee9308dfc56c428d302b
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:06:40 2020 +0100

    Switch deprecation method for IDEA
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit ba21405888340f1e2038939468669b9c1bc0313b
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:06:32 2020 +0100

    Switch deprecation method for HMAC
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 306265819b106c27251d66f41ecc8f572ad66ced
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:06:23 2020 +0100

    Switch deprecation method for EVP
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit f6be9ae210669b505e6ab8300d17f819658551e9
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:06:13 2020 +0100

    Switch deprecation method for ERR
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit d43788bd207dd7e9ff0feb9dc981496b217809bb
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:05:22 2020 +0100

    Switch deprecation method for ENGINE
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 27147678ca7779d20fef5bb93a4d1cd0abccc573
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:05:12 2020 +0100

    Switch deprecation method for DES
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 05cb22388ffe71b59c048c94c90affe4413d3f2b
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:05:04 2020 +0100

    Switch deprecation method for CRYPTO
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 7f7c856c66709a419136b6bf4cde7ef0bf7b7ede
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:04:55 2020 +0100

    Switch deprecation method for CONF
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit db617a4a6bdd35baadc62af84eca6bb698b55677
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:04:42 2020 +0100

    Switch deprecation method for CMAC
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit ebafdfac737e1f49ac1ed5307edff99c061c82a1
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:04:30 2020 +0100

    Switch deprecation method for CAST
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 0294097253fcdafb97085de70a757b908e346bf2
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:04:19 2020 +0100

    Switch deprecation method for Camellia
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 4b66e5256f515c53e95c55a1598862ec529cb5f8
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:04:09 2020 +0100

    Switch deprecation method for BIGNUM
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 6638749f0f168d5219ae311bcf14048ff4dd4429
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:03:59 2020 +0100

    Switch deprecation method for Blowfish
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 894fe6e1d68216b8c656c4f5e6cde157747b7ae0
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:03:07 2020 +0100

    Switch deprecation method for BIO
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit d1b99dd905b2405c77243fcf17f3390512d7731a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:02:51 2020 +0100

    Switch deprecation method for ASN.1
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

commit 0016a034a7da28df038c9b4a5fd0417b0d9a52af
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Nov 20 10:02:27 2020 +0100

    Switch deprecation method for AES
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13460)

-----------------------------------------------------------------------

Summary of changes:
 include/openssl/aes.h       | 113 ++++++-----
 include/openssl/asn1.h.in   |   8 +-
 include/openssl/bio.h.in    |  13 +-
 include/openssl/blowfish.h  |  46 ++---
 include/openssl/bn.h        |  56 +++---
 include/openssl/camellia.h  | 105 ++++++-----
 include/openssl/cast.h      |  53 +++---
 include/openssl/cmac.h      |  28 +--
 include/openssl/conf.h.in   |   9 +-
 include/openssl/crypto.h.in |  43 +++--
 include/openssl/des.h       | 206 ++++++++++----------
 include/openssl/engine.h    | 384 ++++++++++++++++++++++----------------
 include/openssl/err.h.in    |  17 +-
 include/openssl/evp.h       | 444 ++++++++++++++++++++++----------------------
 include/openssl/hmac.h      |  49 ++---
 include/openssl/idea.h      |  47 ++---
 include/openssl/md2.h       |  17 +-
 include/openssl/md4.h       |  15 +-
 include/openssl/md5.h       |  15 +-
 include/openssl/mdc2.h      |  15 +-
 include/openssl/pkcs12.h.in |   6 +-
 include/openssl/rand.h      |  11 +-
 include/openssl/rc2.h       |  42 +++--
 include/openssl/rc4.h       |  14 +-
 include/openssl/rc5.h       |  45 ++---
 include/openssl/ripemd.h    |  19 +-
 include/openssl/seed.h      |  61 +++---
 include/openssl/sha.h       |  73 ++++----
 include/openssl/srp.h.in    |   5 +-
 include/openssl/ssl.h.in    |  66 ++++---
 include/openssl/store.h     | 104 ++++++-----
 include/openssl/whrlpool.h  |  19 +-
 include/openssl/x509.h.in   |  27 +--
 33 files changed, 1154 insertions(+), 1021 deletions(-)

diff --git a/include/openssl/aes.h b/include/openssl/aes.h
index c4320cf23a..d0f9dfc6f1 100644
--- a/include/openssl/aes.h
+++ b/include/openssl/aes.h
@@ -45,68 +45,63 @@ struct aes_key_st {
 typedef struct aes_key_st AES_KEY;
 
 # endif
-
-DEPRECATEDIN_3_0(const char *AES_options(void))
-
-DEPRECATEDIN_3_0(int
-                 AES_set_encrypt_key(const unsigned char *userKey,
-                                     const int bits, AES_KEY *key))
-DEPRECATEDIN_3_0(int
-                 AES_set_decrypt_key(const unsigned char *userKey,
-                                     const int bits, AES_KEY *key))
-
-DEPRECATEDIN_3_0(void
-                 AES_encrypt(const unsigned char *in, unsigned char *out,
-                             const AES_KEY *key))
-DEPRECATEDIN_3_0(void
-                 AES_decrypt(const unsigned char *in, unsigned char *out,
-                             const AES_KEY *key))
-
-DEPRECATEDIN_3_0(void
-                 AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
-                                 const AES_KEY *key, const int enc))
-DEPRECATEDIN_3_0(void
-                 AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
-                                 size_t length, const AES_KEY *key,
-                                 unsigned char *ivec, const int enc))
-DEPRECATEDIN_3_0(void
-                 AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
-                                    size_t length, const AES_KEY *key,
-                                    unsigned char *ivec, int *num,
-                                    const int enc))
-DEPRECATEDIN_3_0(void
-                 AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
-                                  size_t length, const AES_KEY *key,
-                                  unsigned char *ivec, int *num, const int enc))
-DEPRECATEDIN_3_0(void
-                 AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
-                                  size_t length, const AES_KEY *key,
-                                  unsigned char *ivec, int *num, const int enc))
-DEPRECATEDIN_3_0(void
-                 AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
-                                    size_t length, const AES_KEY *key,
-                                    unsigned char *ivec, int *num))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
+OSSL_DEPRECATEDIN_3_0
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+                        AES_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+                        AES_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+void AES_encrypt(const unsigned char *in, unsigned char *out,
+                 const AES_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+void AES_decrypt(const unsigned char *in, unsigned char *out,
+                 const AES_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
+                     const AES_KEY *key, const int enc);
+OSSL_DEPRECATEDIN_3_0
+void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+                     size_t length, const AES_KEY *key,
+                     unsigned char *ivec, const int enc);
+OSSL_DEPRECATEDIN_3_0
+void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+                        size_t length, const AES_KEY *key,
+                        unsigned char *ivec, int *num, const int enc);
+OSSL_DEPRECATEDIN_3_0
+void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+                      size_t length, const AES_KEY *key,
+                      unsigned char *ivec, int *num, const int enc);
+OSSL_DEPRECATEDIN_3_0
+void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+                      size_t length, const AES_KEY *key,
+                      unsigned char *ivec, int *num, const int enc);
+OSSL_DEPRECATEDIN_3_0
+void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+                        size_t length, const AES_KEY *key,
+                        unsigned char *ivec, int *num);
 
 /* NB: the IV is _two_ blocks long */
-DEPRECATEDIN_3_0(void
-                 AES_ige_encrypt(const unsigned char *in, unsigned char *out,
-                                 size_t length, const AES_KEY *key,
-                                 unsigned char *ivec, const int enc))
+OSSL_DEPRECATEDIN_3_0
+void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
+                     size_t length, const AES_KEY *key,
+                     unsigned char *ivec, const int enc);
 /* NB: the IV is _four_ blocks long */
-DEPRECATEDIN_3_0(void
-                 AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
-                                    size_t length, const AES_KEY *key,
-                                    const AES_KEY *key2,
-                                    const unsigned char *ivec, const int enc))
-
-DEPRECATEDIN_3_0(int
-                 AES_wrap_key(AES_KEY *key, const unsigned char *iv,
-                              unsigned char *out, const unsigned char *in,
-                              unsigned int inlen))
-DEPRECATEDIN_3_0(int
-                 AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
-                                unsigned char *out, const unsigned char *in,
-                                unsigned int inlen))
+OSSL_DEPRECATEDIN_3_0
+void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
+                        size_t length, const AES_KEY *key, const AES_KEY *key2,
+                        const unsigned char *ivec, const int enc);
+OSSL_DEPRECATEDIN_3_0
+int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
+                 unsigned char *out, const unsigned char *in,
+                 unsigned int inlen);
+OSSL_DEPRECATEDIN_3_0
+int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
+                   unsigned char *out, const unsigned char *in,
+                   unsigned int inlen);
+# endif
 
 
 # ifdef  __cplusplus
diff --git a/include/openssl/asn1.h.in b/include/openssl/asn1.h.in
index 27476a215f..6a00b3e7f7 100644
--- a/include/openssl/asn1.h.in
+++ b/include/openssl/asn1.h.in
@@ -572,9 +572,13 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
 int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
 void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
 int ASN1_STRING_length(const ASN1_STRING *x);
-DEPRECATEDIN_3_0(void ASN1_STRING_length_set(ASN1_STRING *x, int n))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
+# endif
 int ASN1_STRING_type(const ASN1_STRING *x);
-DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
+# endif
 const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
 
 DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
diff --git a/include/openssl/bio.h.in b/include/openssl/bio.h.in
index d52392def8..6bb4876022 100644
--- a/include/openssl/bio.h.in
+++ b/include/openssl/bio.h.in
@@ -731,12 +731,13 @@ int BIO_sock_init(void);
 #  define BIO_sock_cleanup() while(0) continue
 # endif
 int BIO_set_tcp_ndelay(int sock, int turn_on);
-
-DEPRECATEDIN_1_1_0(struct hostent *BIO_gethostbyname(const char *name))
-DEPRECATEDIN_1_1_0(int BIO_get_port(const char *str, unsigned short *port_ptr))
-DEPRECATEDIN_1_1_0(int BIO_get_host_ip(const char *str, unsigned char *ip))
-DEPRECATEDIN_1_1_0(int BIO_get_accept_socket(char *host_port, int mode))
-DEPRECATEDIN_1_1_0(int BIO_accept(int sock, char **ip_port))
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 struct hostent *BIO_gethostbyname(const char *name);
+OSSL_DEPRECATEDIN_1_1_0 int BIO_get_port(const char *str, unsigned short *port_ptr);
+OSSL_DEPRECATEDIN_1_1_0 int BIO_get_host_ip(const char *str, unsigned char *ip);
+OSSL_DEPRECATEDIN_1_1_0 int BIO_get_accept_socket(char *host_port, int mode);
+OSSL_DEPRECATEDIN_1_1_0 int BIO_accept(int sock, char **ip_port);
+# endif
 
 union BIO_sock_info_u {
     BIO_ADDR *addr;
diff --git a/include/openssl/blowfish.h b/include/openssl/blowfish.h
index 0c00993ca3..667d642391 100644
--- a/include/openssl/blowfish.h
+++ b/include/openssl/blowfish.h
@@ -46,29 +46,29 @@ typedef struct bf_key_st {
 } BF_KEY;
 
 # endif /* OPENSSL_NO_DEPRECATED_3_0 */
-
-DEPRECATEDIN_3_0(void BF_set_key(BF_KEY *key, int len,
-                                 const unsigned char *data))
-
-DEPRECATEDIN_3_0(void BF_encrypt(BF_LONG *data, const BF_KEY *key))
-DEPRECATEDIN_3_0(void BF_decrypt(BF_LONG *data, const BF_KEY *key))
-
-DEPRECATEDIN_3_0(void BF_ecb_encrypt(const unsigned char *in,
-                                     unsigned char *out, const BF_KEY *key,
-                                     int enc))
-DEPRECATEDIN_3_0(void BF_cbc_encrypt(const unsigned char *in,
-                                     unsigned char *out, long length,
-                                     const BF_KEY *schedule,
-                                     unsigned char *ivec, int enc))
-DEPRECATEDIN_3_0(void BF_cfb64_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       long length, const BF_KEY *schedule,
-                                       unsigned char *ivec, int *num, int enc))
-DEPRECATEDIN_3_0(void BF_ofb64_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       long length, const BF_KEY *schedule,
-                                       unsigned char *ivec, int *num))
-DEPRECATEDIN_3_0(const char *BF_options(void))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len,
+                                      const unsigned char *data);
+OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in,
+                                          unsigned char *out, const BF_KEY *key,
+                                          int enc);
+OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in,
+                                          unsigned char *out, long length,
+                                          const BF_KEY *schedule,
+                                          unsigned char *ivec, int enc);
+OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in,
+                                            unsigned char *out,
+                                            long length, const BF_KEY *schedule,
+                                            unsigned char *ivec, int *num,
+                                            int enc);
+OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in,
+                                            unsigned char *out,
+                                            long length, const BF_KEY *schedule,
+                                            unsigned char *ivec, int *num);
+OSSL_DEPRECATEDIN_3_0 const char *BF_options(void);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/bn.h b/include/openssl/bn.h
index 9f019ba86e..c15fa3054f 100644
--- a/include/openssl/bn.h
+++ b/include/openssl/bn.h
@@ -339,29 +339,33 @@ BIGNUM *BN_mod_sqrt(BIGNUM *ret,
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
 
 /* Deprecated versions */
-DEPRECATEDIN_0_9_8(BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
-                                             const BIGNUM *add,
-                                             const BIGNUM *rem,
-                                             void (*callback) (int, int,
-                                                               void *),
-                                             void *cb_arg))
-DEPRECATEDIN_0_9_8(int
-                   BN_is_prime(const BIGNUM *p, int nchecks,
-                               void (*callback) (int, int, void *),
-                               BN_CTX *ctx, void *cb_arg))
-DEPRECATEDIN_0_9_8(int
-                   BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
-                                        void (*callback) (int, int, void *),
-                                        BN_CTX *ctx, void *cb_arg,
-                                        int do_trial_division))
-
-DEPRECATEDIN_3_0(int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb))
-DEPRECATEDIN_3_0(int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
-                            int do_trial_division, BN_GENCB *cb))
+# ifndef OPENSSL_NO_DEPRECATED_0_9_8
+OSSL_DEPRECATEDIN_0_9_8
+BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
+                          const BIGNUM *add, const BIGNUM *rem,
+                          void (*callback) (int, int, void *),
+                          void *cb_arg);
+OSSL_DEPRECATEDIN_0_9_8
+int BN_is_prime(const BIGNUM *p, int nchecks,
+                void (*callback) (int, int, void *),
+                BN_CTX *ctx, void *cb_arg);
+OSSL_DEPRECATEDIN_0_9_8
+int BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
+                         void (*callback) (int, int, void *),
+                         BN_CTX *ctx, void *cb_arg,
+                         int do_trial_division);
+# endif
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
+OSSL_DEPRECATEDIN_3_0
+int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
+                            int do_trial_division, BN_GENCB *cb);
+# endif
 /* Newer versions */
 int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe,
-                         const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb,
-                         BN_CTX *ctx);
+                          const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb,
+                          BN_CTX *ctx);
 int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
                          const BIGNUM *rem, BN_GENCB *cb);
 int BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb);
@@ -418,10 +422,12 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
                                                          BN_CTX *ctx,
                                                          BN_MONT_CTX *m_ctx),
                                       BN_MONT_CTX *m_ctx);
-
-DEPRECATEDIN_0_9_8(void BN_set_params(int mul, int high, int low, int mont))
-DEPRECATEDIN_0_9_8(int BN_get_params(int which)) /* 0, mul, 1 high, 2 low, 3
-                                                  * mont */
+# ifndef OPENSSL_NO_DEPRECATED_0_9_8
+OSSL_DEPRECATEDIN_0_9_8
+void BN_set_params(int mul, int high, int low, int mont);
+OSSL_DEPRECATEDIN_0_9_8
+int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
+# endif
 
 BN_RECP_CTX *BN_RECP_CTX_new(void);
 void BN_RECP_CTX_free(BN_RECP_CTX *recp);
diff --git a/include/openssl/camellia.h b/include/openssl/camellia.h
index 897dd864cb..88c2279e90 100644
--- a/include/openssl/camellia.h
+++ b/include/openssl/camellia.h
@@ -54,61 +54,60 @@ struct camellia_key_st {
 typedef struct camellia_key_st CAMELLIA_KEY;
 
 # endif /* OPENSSL_NO_DEPRECATED_3_0 */
-
-DEPRECATEDIN_3_0(int Camellia_set_key(const unsigned char *userKey,
-                                      const int bits,
-                                      CAMELLIA_KEY *key))
-
-DEPRECATEDIN_3_0(void Camellia_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       const CAMELLIA_KEY *key))
-DEPRECATEDIN_3_0(void Camellia_decrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       const CAMELLIA_KEY *key))
-
-DEPRECATEDIN_3_0(void Camellia_ecb_encrypt(const unsigned char *in,
-                                           unsigned char *out,
-                                           const CAMELLIA_KEY *key,
-                                           const int enc))
-DEPRECATEDIN_3_0(void Camellia_cbc_encrypt(const unsigned char *in,
-                                           unsigned char *out,
-                                           size_t length, const
-                                           CAMELLIA_KEY *key,
-                                           unsigned char *ivec, const int enc))
-DEPRECATEDIN_3_0(void Camellia_cfb128_encrypt(const unsigned char *in,
-                                              unsigned char *out,
-                                              size_t length,
-                                              const CAMELLIA_KEY *key,
-                                              unsigned char *ivec,
-                                              int *num,
-                                              const int enc))
-DEPRECATEDIN_3_0(void Camellia_cfb1_encrypt(const unsigned char *in,
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int Camellia_set_key(const unsigned char *userKey,
+                                           const int bits,
+                                           CAMELLIA_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void Camellia_encrypt(const unsigned char *in,
                                             unsigned char *out,
-                                            size_t length,
-                                            const CAMELLIA_KEY *key,
-                                            unsigned char *ivec,
-                                            int *num,
-                                            const int enc))
-DEPRECATEDIN_3_0(void Camellia_cfb8_encrypt(const unsigned char *in,
+                                            const CAMELLIA_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void Camellia_decrypt(const unsigned char *in,
                                             unsigned char *out,
-                                            size_t length,
-                                            const CAMELLIA_KEY *key,
-                                            unsigned char *ivec,
-                                            int *num,
-                                            const int enc))
-DEPRECATEDIN_3_0(void Camellia_ofb128_encrypt(const unsigned char *in,
-                                              unsigned char *out,
-                                              size_t length,
-                                              const CAMELLIA_KEY *key,
-                                              unsigned char *ivec,
-                                              int *num))
-DEPRECATEDIN_3_0(void Camellia_ctr128_encrypt(const unsigned char *in,
-                                              unsigned char *out,
-                                              size_t length,
-                                              const CAMELLIA_KEY *key,
-                                              unsigned char ivec[CAMELLIA_BLOCK_SIZE],
-                                              unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
-                                              unsigned int *num))
+                                            const CAMELLIA_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void Camellia_ecb_encrypt(const unsigned char *in,
+                                                unsigned char *out,
+                                                const CAMELLIA_KEY *key,
+                                                const int enc);
+OSSL_DEPRECATEDIN_3_0 void Camellia_cbc_encrypt(const unsigned char *in,
+                                                unsigned char *out,
+                                                size_t length,
+                                                const CAMELLIA_KEY *key,
+                                                unsigned char *ivec,
+                                                const int enc);
+OSSL_DEPRECATEDIN_3_0 void Camellia_cfb128_encrypt(const unsigned char *in,
+                                                   unsigned char *out,
+                                                   size_t length,
+                                                   const CAMELLIA_KEY *key,
+                                                   unsigned char *ivec,
+                                                   int *num,
+                                                   const int enc);
+OSSL_DEPRECATEDIN_3_0 void Camellia_cfb1_encrypt(const unsigned char *in,
+                                                 unsigned char *out,
+                                                 size_t length,
+                                                 const CAMELLIA_KEY *key,
+                                                 unsigned char *ivec,
+                                                 int *num,
+                                                 const int enc);
+OSSL_DEPRECATEDIN_3_0 void Camellia_cfb8_encrypt(const unsigned char *in,
+                                                 unsigned char *out,
+                                                 size_t length,
+                                                 const CAMELLIA_KEY *key,
+                                                 unsigned char *ivec,
+                                                 int *num,
+                                                 const int enc);
+OSSL_DEPRECATEDIN_3_0 void Camellia_ofb128_encrypt(const unsigned char *in,
+                                                   unsigned char *out,
+                                                   size_t length,
+                                                   const CAMELLIA_KEY *key,
+                                                   unsigned char *ivec,
+                                                   int *num);
+OSSL_DEPRECATEDIN_3_0
+void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+                             size_t length, const CAMELLIA_KEY *key,
+                             unsigned char ivec[CAMELLIA_BLOCK_SIZE],
+                             unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
+                             unsigned int *num);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/cast.h b/include/openssl/cast.h
index 89c5e90bbb..0bf217beab 100644
--- a/include/openssl/cast.h
+++ b/include/openssl/cast.h
@@ -39,36 +39,29 @@ typedef struct cast_key_st {
 } CAST_KEY;
 
 # endif /* OPENSSL_NO_DEPRECATED_3_0 */
-
-DEPRECATEDIN_3_0(void CAST_set_key(CAST_KEY *key, int len,
-                                   const unsigned char *data))
-DEPRECATEDIN_3_0(void CAST_ecb_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       const CAST_KEY *key,
-                                       int enc))
-DEPRECATEDIN_3_0(void CAST_encrypt(CAST_LONG *data,
-                                   const CAST_KEY *key))
-DEPRECATEDIN_3_0(void CAST_decrypt(CAST_LONG *data,
-                                   const CAST_KEY *key))
-DEPRECATEDIN_3_0(void CAST_cbc_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       long length,
-                                       const CAST_KEY *ks,
-                                       unsigned char *iv,
-                                       int enc))
-DEPRECATEDIN_3_0(void CAST_cfb64_encrypt(const unsigned char *in,
-                                         unsigned char *out,
-                                         long length,
-                                         const CAST_KEY *schedule,
-                                         unsigned char *ivec,
-                                         int *num,
-                                         int enc))
-DEPRECATEDIN_3_0(void CAST_ofb64_encrypt(const unsigned char *in,
-                                         unsigned char *out,
-                                         long length,
-                                         const CAST_KEY *schedule,
-                                         unsigned char *ivec,
-                                         int *num))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+OSSL_DEPRECATEDIN_3_0
+void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
+                      const CAST_KEY *key, int enc);
+OSSL_DEPRECATEDIN_3_0
+void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
+OSSL_DEPRECATEDIN_3_0
+void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
+                      long length, const CAST_KEY *ks, unsigned char *iv,
+                      int enc);
+OSSL_DEPRECATEDIN_3_0
+void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+                        long length, const CAST_KEY *schedule,
+                        unsigned char *ivec, int *num, int enc);
+OSSL_DEPRECATEDIN_3_0
+void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+                        long length, const CAST_KEY *schedule,
+                        unsigned char *ivec, int *num);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/cmac.h b/include/openssl/cmac.h
index 732b1775a0..f50861836f 100644
--- a/include/openssl/cmac.h
+++ b/include/openssl/cmac.h
@@ -28,19 +28,21 @@ extern "C" {
 /* Opaque */
 typedef struct CMAC_CTX_st CMAC_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(CMAC_CTX *CMAC_CTX_new(void))
-DEPRECATEDIN_3_0(void CMAC_CTX_cleanup(CMAC_CTX *ctx))
-DEPRECATEDIN_3_0(void CMAC_CTX_free(CMAC_CTX *ctx))
-DEPRECATEDIN_3_0(EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx))
-DEPRECATEDIN_3_0(int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in))
-
-DEPRECATEDIN_3_0(int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
-              const EVP_CIPHER *cipher, ENGINE *impl))
-DEPRECATEDIN_3_0(int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen))
-DEPRECATEDIN_3_0(int CMAC_Final(CMAC_CTX *ctx, unsigned char *out,
-                                size_t *poutlen))
-DEPRECATEDIN_3_0(int CMAC_resume(CMAC_CTX *ctx))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void);
+OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_cleanup(CMAC_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_free(CMAC_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
+OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
+                                    const void *key, size_t keylen,
+                                    const EVP_CIPHER *cipher, ENGINE *impl);
+OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
+                                      const void *data, size_t dlen);
+OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
+                                     unsigned char *out, size_t *poutlen);
+OSSL_DEPRECATEDIN_3_0 int CMAC_resume(CMAC_CTX *ctx);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/conf.h.in b/include/openssl/conf.h.in
index c57c50a77f..b82a915626 100644
--- a/include/openssl/conf.h.in
+++ b/include/openssl/conf.h.in
@@ -101,8 +101,9 @@ void CONF_free(LHASH_OF(CONF_VALUE) *conf);
 int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
 #endif
 int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
-
-DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
+#ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
+#endif
 
 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
 # define OPENSSL_no_config() \
@@ -125,7 +126,9 @@ struct conf_st {
 CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
 CONF *NCONF_new(CONF_METHOD *meth);
 CONF_METHOD *NCONF_default(void);
-DEPRECATEDIN_3_0(CONF_METHOD *NCONF_WIN32(void))
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
+#endif
 void NCONF_free(CONF *conf);
 void NCONF_free_data(CONF *conf);
 
diff --git a/include/openssl/crypto.h.in b/include/openssl/crypto.h.in
index 1036da9a2b..f4f098b72e 100644
--- a/include/openssl/crypto.h.in
+++ b/include/openssl/crypto.h.in
@@ -354,27 +354,32 @@ void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
 #    define OPENSSL_mem_debug_pop() \
          CRYPTO_mem_debug_pop()
 #  endif
-DEPRECATEDIN_3_0(int CRYPTO_set_mem_debug(int flag))
-DEPRECATEDIN_3_0(int CRYPTO_mem_ctrl(int mode))
-DEPRECATEDIN_3_0(int CRYPTO_mem_debug_push(const char *info,
-                                           const char *file, int line))
-DEPRECATEDIN_3_0(int CRYPTO_mem_debug_pop(void))
-
-DEPRECATEDIN_3_0(void CRYPTO_mem_debug_malloc(void *addr, size_t num,
-                                              int flag,
-                                              const char *file, int line))
-DEPRECATEDIN_3_0(void CRYPTO_mem_debug_realloc(void *addr1, void *addr2,
-                                               size_t num, int flag,
-                                               const char *file, int line))
-DEPRECATEDIN_3_0(void CRYPTO_mem_debug_free(void *addr, int flag,
-                                            const char *file, int line))
-
-DEPRECATEDIN_3_0(int CRYPTO_mem_leaks_cb(
-                      int (*cb)(const char *str, size_t len, void *u), void *u))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_set_mem_debug(int flag);
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_ctrl(int mode);
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_push(const char *info,
+                                                const char *file, int line);
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_pop(void);
+OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_malloc(void *addr, size_t num,
+                                                   int flag,
+                                                   const char *file, int line);
+OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_realloc(void *addr1, void *addr2,
+                                                    size_t num, int flag,
+                                                    const char *file, int line);
+OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_free(void *addr, int flag,
+                                                 const char *file, int line);
+OSSL_DEPRECATEDIN_3_0
+int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u),
+                        void *u);
+#  endif
 #  ifndef OPENSSL_NO_STDIO
-DEPRECATEDIN_3_0(int CRYPTO_mem_leaks_fp(FILE *))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks_fp(FILE *);
 #  endif
-DEPRECATEDIN_3_0(int CRYPTO_mem_leaks(BIO *bio))
+#  endif
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks(BIO *bio);
+# endif
 # endif /* OPENSSL_NO_CRYPTO_MDEBUG */
 
 /* die if we have to */
diff --git a/include/openssl/des.h b/include/openssl/des.h
index c8f503d500..09798a616f 100644
--- a/include/openssl/des.h
+++ b/include/openssl/des.h
@@ -72,38 +72,39 @@ typedef struct DES_ks {
 
 #   define DES_fixup_key_parity DES_set_odd_parity
 #  endif
-
-DEPRECATEDIN_3_0(const char *DES_options(void))
-DEPRECATEDIN_3_0(void DES_ecb3_encrypt(const_DES_cblock *input,
-                                       DES_cblock *output,
-                                       DES_key_schedule *ks1,
-                                       DES_key_schedule *ks2,
-                                       DES_key_schedule *ks3, int enc))
-DEPRECATEDIN_3_0(DES_LONG DES_cbc_cksum(const unsigned char *input,
-                                        DES_cblock *output, long length,
-                                        DES_key_schedule *schedule,
-                                        const_DES_cblock *ivec))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *DES_options(void);
+OSSL_DEPRECATEDIN_3_0
+void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
+                      DES_key_schedule *ks1, DES_key_schedule *ks2,
+                      DES_key_schedule *ks3, int enc);
+OSSL_DEPRECATEDIN_3_0
+DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
+                       long length, DES_key_schedule *schedule,
+                       const_DES_cblock *ivec);
+#  endif
 /* DES_cbc_encrypt does not update the IV!  Use DES_ncbc_encrypt instead. */
-DEPRECATEDIN_3_0(void DES_cbc_encrypt(const unsigned char *input,
-                                      unsigned char *output, long length,
-                                      DES_key_schedule *schedule,
-                                      DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(void DES_ncbc_encrypt(const unsigned char *input,
-                                       unsigned char *output, long length,
-                                       DES_key_schedule *schedule,
-                                       DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(void DES_xcbc_encrypt(const unsigned char *input,
-                                       unsigned char *output, long length,
-                                       DES_key_schedule *schedule,
-                                       DES_cblock *ivec, const_DES_cblock *inw,
-                                       const_DES_cblock *outw, int enc))
-DEPRECATEDIN_3_0(void DES_cfb_encrypt(const unsigned char *in,
-                                      unsigned char *out, int numbits,
-                                      long length, DES_key_schedule *schedule,
-                                      DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(void DES_ecb_encrypt(const_DES_cblock *input,
-                                      DES_cblock *output, DES_key_schedule *ks,
-                                      int enc))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
+                     long length, DES_key_schedule *schedule, DES_cblock *ivec,
+                     int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
+                      long length, DES_key_schedule *schedule, DES_cblock *ivec,
+                      int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
+                      long length, DES_key_schedule *schedule, DES_cblock *ivec,
+                      const_DES_cblock *inw, const_DES_cblock *outw, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+                     long length, DES_key_schedule *schedule, DES_cblock *ivec,
+                     int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
+                     DES_key_schedule *ks, int enc);
+#  endif
 
 /*
  * This is the DES encryption function that gets called by just about every
@@ -115,8 +116,10 @@ DEPRECATEDIN_3_0(void DES_ecb_encrypt(const_DES_cblock *input,
  * long's and ks is the DES_key_schedule to use.  enc, is non zero specifies
  * encryption, zero if decryption.
  */
-DEPRECATEDIN_3_0(void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks,
-                                   int enc))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
+#  endif
 
 /*
  * This functions is the same as DES_encrypt1() except that the DES initial
@@ -126,78 +129,79 @@ DEPRECATEDIN_3_0(void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks,
  * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
  * DES_encrypt1() DES_encrypt1() except faster :-).
  */
-DEPRECATEDIN_3_0(void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks,
-                                   int enc))
-
-DEPRECATEDIN_3_0(void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
-                  DES_key_schedule *ks2, DES_key_schedule *ks3))
-DEPRECATEDIN_3_0(void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
-                  DES_key_schedule *ks2, DES_key_schedule *ks3))
-DEPRECATEDIN_3_0(void DES_ede3_cbc_encrypt(const unsigned char *input,
-                                           unsigned char *output, long length,
-                                           DES_key_schedule *ks1,
-                                           DES_key_schedule *ks2,
-                                           DES_key_schedule *ks3,
-                                           DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(void DES_ede3_cfb64_encrypt(const unsigned char *in,
-                                             unsigned char *out, long length,
-                                             DES_key_schedule *ks1,
-                                             DES_key_schedule *ks2,
-                                             DES_key_schedule *ks3,
-                                             DES_cblock *ivec, int *num,
-                                             int enc))
-DEPRECATEDIN_3_0(void DES_ede3_cfb_encrypt(const unsigned char *in,
-                                           unsigned char *out, int numbits,
-                                           long length, DES_key_schedule *ks1,
-                                           DES_key_schedule *ks2,
-                                           DES_key_schedule *ks3,
-                                           DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(void DES_ede3_ofb64_encrypt(const unsigned char *in,
-                                             unsigned char *out, long length,
-                                             DES_key_schedule *ks1,
-                                             DES_key_schedule *ks2,
-                                             DES_key_schedule *ks3,
-                                             DES_cblock *ivec, int *num))
-DEPRECATEDIN_3_0(char *DES_fcrypt(const char *buf, const char *salt, char *ret))
-DEPRECATEDIN_3_0(char *DES_crypt(const char *buf, const char *salt))
-DEPRECATEDIN_3_0(void DES_ofb_encrypt(const unsigned char *in,
-                                      unsigned char *out, int numbits,
-                                      long length, DES_key_schedule *schedule,
-                                      DES_cblock *ivec))
-DEPRECATEDIN_3_0(void DES_pcbc_encrypt(const unsigned char *input,
-                                       unsigned char *output, long length,
-                                       DES_key_schedule *schedule,
-                                       DES_cblock *ivec, int enc))
-DEPRECATEDIN_3_0(DES_LONG DES_quad_cksum(const unsigned char *input,
-                                         DES_cblock output[], long length,
-                                         int out_count, DES_cblock *seed))
-DEPRECATEDIN_3_0(int DES_random_key(DES_cblock *ret))
-DEPRECATEDIN_3_0(void DES_set_odd_parity(DES_cblock *key))
-DEPRECATEDIN_3_0(int DES_check_key_parity(const_DES_cblock *key))
-DEPRECATEDIN_3_0(int DES_is_weak_key(const_DES_cblock *key))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2,
+                  DES_key_schedule *ks3);
+OSSL_DEPRECATEDIN_3_0
+void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2,
+                  DES_key_schedule *ks3);
+OSSL_DEPRECATEDIN_3_0
+void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+                          long length, DES_key_schedule *ks1,
+                          DES_key_schedule *ks2, DES_key_schedule *ks3,
+                          DES_cblock *ivec, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+                            long length, DES_key_schedule *ks1,
+                            DES_key_schedule *ks2, DES_key_schedule *ks3,
+                            DES_cblock *ivec, int *num, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
+                          int numbits, long length, DES_key_schedule *ks1,
+                          DES_key_schedule *ks2, DES_key_schedule *ks3,
+                          DES_cblock *ivec, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+                            long length, DES_key_schedule *ks1,
+                            DES_key_schedule *ks2, DES_key_schedule *ks3,
+                            DES_cblock *ivec, int *num);
+OSSL_DEPRECATEDIN_3_0
+char *DES_fcrypt(const char *buf, const char *salt, char *ret);
+OSSL_DEPRECATEDIN_3_0
+char *DES_crypt(const char *buf, const char *salt);
+OSSL_DEPRECATEDIN_3_0
+void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+                     long length, DES_key_schedule *schedule, DES_cblock *ivec);
+OSSL_DEPRECATEDIN_3_0
+void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
+                      long length, DES_key_schedule *schedule,
+                      DES_cblock *ivec, int enc);
+OSSL_DEPRECATEDIN_3_0
+DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
+                        long length, int out_count, DES_cblock *seed);
+OSSL_DEPRECATEDIN_3_0 int DES_random_key(DES_cblock *ret);
+OSSL_DEPRECATEDIN_3_0 void DES_set_odd_parity(DES_cblock *key);
+OSSL_DEPRECATEDIN_3_0 int DES_check_key_parity(const_DES_cblock *key);
+OSSL_DEPRECATEDIN_3_0 int DES_is_weak_key(const_DES_cblock *key);
+#  endif
 /*
  * DES_set_key (= set_key = DES_key_sched = key_sched) calls
  * DES_set_key_checked
  */
-DEPRECATEDIN_3_0(int DES_set_key(const_DES_cblock *key,
-                                 DES_key_schedule *schedule))
-DEPRECATEDIN_3_0(int DES_key_sched(const_DES_cblock *key,
-                                   DES_key_schedule *schedule))
-DEPRECATEDIN_3_0(int DES_set_key_checked(const_DES_cblock *key,
-                                         DES_key_schedule *schedule))
-DEPRECATEDIN_3_0(void DES_set_key_unchecked(const_DES_cblock *key,
-                                            DES_key_schedule *schedule))
-DEPRECATEDIN_3_0(void DES_string_to_key(const char *str, DES_cblock *key))
-DEPRECATEDIN_3_0(void DES_string_to_2keys(const char *str, DES_cblock *key1,
-                                          DES_cblock *key2))
-DEPRECATEDIN_3_0(void DES_cfb64_encrypt(const unsigned char *in,
-                                        unsigned char *out, long length,
-                                        DES_key_schedule *schedule,
-                                        DES_cblock *ivec, int *num, int enc))
-DEPRECATEDIN_3_0(void DES_ofb64_encrypt(const unsigned char *in,
-                                        unsigned char *out, long length,
-                                        DES_key_schedule *schedule,
-                                        DES_cblock *ivec, int *num))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
+OSSL_DEPRECATEDIN_3_0
+int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
+OSSL_DEPRECATEDIN_3_0
+int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
+OSSL_DEPRECATEDIN_3_0
+void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
+OSSL_DEPRECATEDIN_3_0 void DES_string_to_key(const char *str, DES_cblock *key);
+OSSL_DEPRECATEDIN_3_0
+void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
+OSSL_DEPRECATEDIN_3_0
+void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+                       long length, DES_key_schedule *schedule,
+                       DES_cblock *ivec, int *num, int enc);
+OSSL_DEPRECATEDIN_3_0
+void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+                       long length, DES_key_schedule *schedule,
+                       DES_cblock *ivec, int *num);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/engine.h b/include/openssl/engine.h
index 51260e42a2..25c3cf7c19 100644
--- a/include/openssl/engine.h
+++ b/include/openssl/engine.h
@@ -314,17 +314,27 @@ typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
  */
 
 /* Get the first/last "ENGINE" type available. */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_first(void))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_last(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void);
+#  endif
 /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_next(ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_prev(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e);
+#  endif
 /* Add another "ENGINE" type into the array. */
-DEPRECATEDIN_3_0(int ENGINE_add(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e);
+#  endif
 /* Remove an existing "ENGINE" type from the array. */
-DEPRECATEDIN_3_0(int ENGINE_remove(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e);
+#  endif
 /* Retrieve an engine from the list by its unique "id" value. */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_by_id(const char *id))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
+#  endif
 
 #  ifndef OPENSSL_NO_DEPRECATED_1_1_0
 #   define ENGINE_load_openssl() \
@@ -344,14 +354,18 @@ DEPRECATEDIN_3_0(ENGINE *ENGINE_by_id(const char *id))
 #   define ENGINE_load_rdrand() \
         OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
 #  endif
-DEPRECATEDIN_3_0(void ENGINE_load_builtin_engines(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
+#  endif
 
 /*
  * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
  * "registry" handling.
  */
-DEPRECATEDIN_3_0(unsigned int ENGINE_get_table_flags(void))
-DEPRECATEDIN_3_0(void ENGINE_set_table_flags(unsigned int flags))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
+#  endif
 
 /*- Manage registration of ENGINEs per "table". For each type, there are 3
  * functions;
@@ -360,42 +374,35 @@ DEPRECATEDIN_3_0(void ENGINE_set_table_flags(unsigned int flags))
  *   ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
  * Cleanup is automatically registered from each table when required.
  */
-
-DEPRECATEDIN_3_0(int ENGINE_register_RSA(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_RSA(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_RSA(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_DSA(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_DSA(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_DSA(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_EC(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_EC(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_EC(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_DH(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_DH(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_DH(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_RAND(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_RAND(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_RAND(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_ciphers(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_ciphers(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_ciphers(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_digests(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_digests(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_digests(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_pkey_meths(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_pkey_meths(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_pkey_meths(void))
-
-DEPRECATEDIN_3_0(int ENGINE_register_pkey_asn1_meths(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_unregister_pkey_asn1_meths(ENGINE *e))
-DEPRECATEDIN_3_0(void ENGINE_register_all_pkey_asn1_meths(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
+#  endif
 
 /*
  * These functions register all support from the above categories. Note, use
@@ -403,8 +410,10 @@ DEPRECATEDIN_3_0(void ENGINE_register_all_pkey_asn1_meths(void))
  * may not need. If you only need a subset of functionality, consider using
  * more selective initialisation.
  */
-DEPRECATEDIN_3_0(int ENGINE_register_complete(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_register_all_complete(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
+#  endif
 
 /*
  * Send parameterised control commands to the engine. The possibilities to
@@ -416,8 +425,10 @@ DEPRECATEDIN_3_0(int ENGINE_register_all_complete(void))
  * commands that require an operational ENGINE, and only use functional
  * references in such situations.
  */
-DEPRECATEDIN_3_0(int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
-                                 void (*f) (void)))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
+                                      void (*f) (void));
+#  endif
 
 /*
  * This function tests if an ENGINE-specific command is usable as a
@@ -425,7 +436,9 @@ DEPRECATEDIN_3_0(int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
  * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
  * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
  */
-DEPRECATEDIN_3_0(int ENGINE_cmd_is_executable(ENGINE *e, int cmd))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
+#  endif
 
 /*
  * This function works like ENGINE_ctrl() with the exception of taking a
@@ -433,9 +446,11 @@ DEPRECATEDIN_3_0(int ENGINE_cmd_is_executable(ENGINE *e, int cmd))
  * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
  * on how to use the cmd_name and cmd_optional.
  */
-DEPRECATEDIN_3_0(int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
-                                     long i, void *p, void (*f) (void),
-                                     int cmd_optional))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
+                                          long i, void *p, void (*f) (void),
+                                          int cmd_optional);
+#  endif
 
 /*
  * This function passes a command-name and argument to an ENGINE. The
@@ -459,8 +474,11 @@ DEPRECATEDIN_3_0(int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
  * applications can work consistently with the same configuration for the
  * same ENGINE-enabled devices, across applications.
  */
-DEPRECATEDIN_3_0(int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name,
-                                            const char *arg, int cmd_optional))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
+                           int cmd_optional);
+#  endif
 
 /*
  * These functions are useful for manufacturing new ENGINE structures. They
@@ -470,43 +488,51 @@ DEPRECATEDIN_3_0(int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name,
  * These are also here so that the ENGINE structure doesn't have to be
  * exposed and break binary compatibility!
  */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_new(void))
-DEPRECATEDIN_3_0(int ENGINE_free(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_up_ref(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_id(ENGINE *e, const char *id))
-DEPRECATEDIN_3_0(int ENGINE_set_name(ENGINE *e, const char *name))
-DEPRECATEDIN_3_0(int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth))
-DEPRECATEDIN_3_0(int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth))
-DEPRECATEDIN_3_0(int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth))
-DEPRECATEDIN_3_0(int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth))
-DEPRECATEDIN_3_0(int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth))
-DEPRECATEDIN_3_0(int ENGINE_set_destroy_function
-                    (ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f))
-DEPRECATEDIN_3_0(int ENGINE_set_init_function
-                    (ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f))
-DEPRECATEDIN_3_0(int ENGINE_set_finish_function
-                    (ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f))
-DEPRECATEDIN_3_0(int ENGINE_set_ctrl_function
-                    (ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f))
-DEPRECATEDIN_3_0(int ENGINE_set_load_privkey_function
-                    (ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f))
-DEPRECATEDIN_3_0(int ENGINE_set_load_pubkey_function
-                    (ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f))
-DEPRECATEDIN_3_0(int ENGINE_set_load_ssl_client_cert_function
-                    (ENGINE *e, ENGINE_SSL_CLIENT_CERT_PTR loadssl_f))
-DEPRECATEDIN_3_0(int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f))
-DEPRECATEDIN_3_0(int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f))
-DEPRECATEDIN_3_0(int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f))
-DEPRECATEDIN_3_0(int ENGINE_set_pkey_asn1_meths(ENGINE *e,
-                                                ENGINE_PKEY_ASN1_METHS_PTR f))
-DEPRECATEDIN_3_0(int ENGINE_set_flags(ENGINE *e, int flags))
-DEPRECATEDIN_3_0(int ENGINE_set_cmd_defns(ENGINE *e,
-                                          const ENGINE_CMD_DEFN *defns))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_destroy_function(ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
+                                             ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,
+                                               const ENGINE_CMD_DEFN *defns);
+#  endif
 /* These functions allow control over any per-structure ENGINE data. */
 #  define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
     CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
-DEPRECATEDIN_3_0(int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg))
-DEPRECATEDIN_3_0(void *ENGINE_get_ex_data(const ENGINE *e, int idx))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
+OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
+# endif
 
 #  ifndef OPENSSL_NO_DEPRECATED_1_1_0
 /*
@@ -522,44 +548,55 @@ DEPRECATEDIN_3_0(void *ENGINE_get_ex_data(const ENGINE *e, int idx))
  * which you obtained. Using the result for functional purposes if you only
  * obtained a structural reference may be problematic!
  */
-DEPRECATEDIN_3_0(const char *ENGINE_get_id(const ENGINE *e))
-DEPRECATEDIN_3_0(const char *ENGINE_get_name(const ENGINE *e))
-DEPRECATEDIN_3_0(const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e))
-DEPRECATEDIN_3_0(const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e))
-DEPRECATEDIN_3_0(const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e))
-DEPRECATEDIN_3_0(const DH_METHOD *ENGINE_get_DH(const ENGINE *e))
-DEPRECATEDIN_3_0(const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e))
-DEPRECATEDIN_3_0(ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths
-                    (const ENGINE *e))
-DEPRECATEDIN_3_0(const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid))
-DEPRECATEDIN_3_0(const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid))
-DEPRECATEDIN_3_0(const EVP_PKEY_METHOD *ENGINE_get_pkey_meth
-                    (ENGINE *e, int nid))
-DEPRECATEDIN_3_0(const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth
-                    (ENGINE *e, int nid))
-DEPRECATEDIN_3_0(const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str
-                    (ENGINE *e, const char *str, int len))
-DEPRECATEDIN_3_0(const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str
-                    (ENGINE **pe, const char *str, int len))
-DEPRECATEDIN_3_0(const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_get_flags(const ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0
+const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
+OSSL_DEPRECATEDIN_3_0
+const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
+OSSL_DEPRECATEDIN_3_0
+const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
+OSSL_DEPRECATEDIN_3_0
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
+OSSL_DEPRECATEDIN_3_0
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
+                                                          const char *str,
+                                                          int len);
+OSSL_DEPRECATEDIN_3_0
+const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
+                                                      const char *str, int len);
+OSSL_DEPRECATEDIN_3_0
+const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
+#  endif
 
 /*
  * FUNCTIONAL functions. These functions deal with ENGINE structures that
@@ -579,29 +616,36 @@ DEPRECATEDIN_3_0(int ENGINE_get_flags(const ENGINE *e))
  * already in use). This will fail if the engine is not currently operational
  * and cannot initialise.
  */
-DEPRECATEDIN_3_0(int ENGINE_init(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
+#  endif
 /*
  * Free a functional reference to a engine type. This does not require a
  * corresponding call to ENGINE_free as it also releases a structural
  * reference.
  */
-DEPRECATEDIN_3_0(int ENGINE_finish(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
+#  endif
 
 /*
  * The following functions handle keys that are stored in some secondary
  * location, handled by the engine.  The storage may be on a card or
  * whatever.
  */
-DEPRECATEDIN_3_0(EVP_PKEY *ENGINE_load_private_key
-                    (ENGINE *e, const char *key_id, UI_METHOD *ui_method,
-                     void *callback_data))
-DEPRECATEDIN_3_0(EVP_PKEY *ENGINE_load_public_key
-                    (ENGINE *e, const char *key_id, UI_METHOD *ui_method,
-                     void *callback_data))
-DEPRECATEDIN_3_0(int ENGINE_load_ssl_client_cert
-                    (ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
-                     X509 **pcert, EVP_PKEY **ppkey, STACK_OF(X509) **pother,
-                     UI_METHOD *ui_method, void *callback_data))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
+                                  UI_METHOD *ui_method, void *callback_data);
+OSSL_DEPRECATEDIN_3_0
+EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
+                                 UI_METHOD *ui_method, void *callback_data);
+OSSL_DEPRECATEDIN_3_0
+int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
+                                X509 **pcert, EVP_PKEY **ppkey,
+                                STACK_OF(X509) **pother,
+                                UI_METHOD *ui_method, void *callback_data);
+#  endif
 
 /*
  * This returns a pointer for the current ENGINE structure that is (by
@@ -609,20 +653,26 @@ DEPRECATEDIN_3_0(int ENGINE_load_ssl_client_cert
  * incremented reference, so it should be free'd (ENGINE_finish) before it is
  * discarded.
  */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_default_RSA(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void);
+#  endif
 /* Same for the other "methods" */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_default_DSA(void))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_default_EC(void))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_default_DH(void))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_default_RAND(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void);
+#  endif
 /*
  * These functions can be used to get a functional reference to perform
  * ciphering or digesting corresponding to "nid".
  */
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_cipher_engine(int nid))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_digest_engine(int nid))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_pkey_meth_engine(int nid))
-DEPRECATEDIN_3_0(ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
+OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
+#  endif
 
 /*
  * This sets a new default ENGINE structure for performing RSA operations. If
@@ -630,17 +680,22 @@ DEPRECATEDIN_3_0(ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid))
  * its reference count up'd so the caller should still free their own
  * reference 'e'.
  */
-DEPRECATEDIN_3_0(int ENGINE_set_default_RSA(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_string(ENGINE *e, const char *def_list))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
+                                                    const char *def_list);
+#  endif
 /* Same for the other "methods" */
-DEPRECATEDIN_3_0(int ENGINE_set_default_DSA(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_EC(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_DH(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_RAND(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_ciphers(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_digests(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_pkey_meths(ENGINE *e))
-DEPRECATEDIN_3_0(int ENGINE_set_default_pkey_asn1_meths(ENGINE *e))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e);
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
+#  endif
 
 /*
  * The combination "set" - the flags are bitwise "OR"d from the
@@ -649,9 +704,10 @@ DEPRECATEDIN_3_0(int ENGINE_set_default_pkey_asn1_meths(ENGINE *e))
  * application requires only specific functionality, consider using more
  * selective functions.
  */
-DEPRECATEDIN_3_0(int ENGINE_set_default(ENGINE *e, unsigned int flags))
-
-DEPRECATEDIN_3_0(void ENGINE_add_conf_module(void))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
+OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void);
+#  endif
 
 /* Deprecated functions ... */
 /* int ENGINE_clear_defaults(void); */
@@ -763,7 +819,9 @@ typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
 void *ENGINE_get_static_state(void);
 
 #  if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
-DEPRECATEDIN_1_1_0(void ENGINE_setup_bsd_cryptodev(void))
+#   ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void);
+#   endif
 #  endif
 
 
diff --git a/include/openssl/err.h.in b/include/openssl/err.h.in
index 6fd749acd0..deb6117d82 100644
--- a/include/openssl/err.h.in
+++ b/include/openssl/err.h.in
@@ -432,7 +432,9 @@ void ERR_clear_error(void);
 char *ERR_error_string(unsigned long e, char *buf);
 void ERR_error_string_n(unsigned long e, char *buf, size_t len);
 const char *ERR_lib_error_string(unsigned long e);
-DEPRECATEDIN_3_0(const char *ERR_func_error_string(unsigned long e))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *ERR_func_error_string(unsigned long e);
+# endif
 const char *ERR_reason_error_string(unsigned long e);
 
 void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
@@ -456,10 +458,15 @@ int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
 # define ERR_free_strings() while(0) continue
 #endif
-
-DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
-DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
-DEPRECATEDIN_3_0(ERR_STATE *ERR_get_state(void))
+#ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *);
+#endif
+#ifndef OPENSSL_NO_DEPRECATED_1_0_0
+OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid);
+#endif
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void);
+#endif
 
 int ERR_get_next_error_library(void);
 
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index afbb43c6f9..01708b6cbf 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -97,47 +97,56 @@ int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable);
 # define EVP_PKEY_MO_DECRYPT     0x0008
 
 # ifndef EVP_MD
-DEPRECATEDIN_3_0(EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type))
-DEPRECATEDIN_3_0(EVP_MD *EVP_MD_meth_dup(const EVP_MD *md))
-DEPRECATEDIN_3_0(void EVP_MD_meth_free(EVP_MD *md))
-
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_init(EVP_MD *md,
-                                          int (*init)(EVP_MD_CTX *ctx)))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_update(EVP_MD *md,
-                                            int (*update)(EVP_MD_CTX *ctx,
-                                                          const void *data,
-                                                          size_t count)))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_final(EVP_MD *md,
-                                           int (*final)(EVP_MD_CTX *ctx,
-                                                        unsigned char *md)))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_copy(EVP_MD *md,
-                                          int (*copy)(EVP_MD_CTX *to,
-                                                      const EVP_MD_CTX *from)))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_cleanup(EVP_MD *md,
-                                             int (*cleanup)(EVP_MD_CTX *ctx)))
-DEPRECATEDIN_3_0(int EVP_MD_meth_set_ctrl(EVP_MD *md,
-                                          int (*ctrl)(EVP_MD_CTX *ctx, int cmd,
-                                                      int p1, void *p2)))
-
-DEPRECATEDIN_3_0(int EVP_MD_meth_get_input_blocksize(const EVP_MD *md))
-DEPRECATEDIN_3_0(int EVP_MD_meth_get_result_size(const EVP_MD *md))
-DEPRECATEDIN_3_0(int EVP_MD_meth_get_app_datasize(const EVP_MD *md))
-DEPRECATEDIN_3_0(unsigned long EVP_MD_meth_get_flags(const EVP_MD *md))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_update(const EVP_MD *md))
-    (EVP_MD_CTX *ctx, const void *data, size_t count))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_final(const EVP_MD *md))
-    (EVP_MD_CTX *ctx, unsigned char *md))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_copy(const EVP_MD *md))
-    (EVP_MD_CTX *to, const EVP_MD_CTX *from))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))
-    (EVP_MD_CTX *ctx))
-DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))
-    (EVP_MD_CTX *ctx, int cmd, int p1, void *p2))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type);
+OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_dup(const EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0 void EVP_MD_meth_free(EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize);
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize);
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize);
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags);
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx,
+                                                     const void *data,
+                                                     size_t count));
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx,
+                                                   unsigned char *md));
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to,
+                                                 const EVP_MD_CTX *from));
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0
+int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd,
+                                                 int p1, void *p2));
+OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_input_blocksize(const EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_result_size(const EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_app_datasize(const EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0 unsigned long EVP_MD_meth_get_flags(const EVP_MD *md);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx,
+                                                const void *data, size_t count);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx,
+                                               unsigned char *md);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to,
+                                              const EVP_MD_CTX *from);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0
+int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
+                                              int p1, void *p2);
+#  endif
 /* digest can only handle a single block */
 #  define EVP_MD_FLAG_ONESHOT     0x0001
 
@@ -211,54 +220,68 @@ DEPRECATEDIN_3_0(int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))
  */
 # define EVP_MD_CTX_FLAG_FINALISE        0x0200
 /* NOTE: 0x0400 is reserved for internal usage */
-
-DEPRECATEDIN_3_0(EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type,
-                                                 int block_size, int key_len))
-DEPRECATEDIN_3_0(EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher))
-DEPRECATEDIN_3_0(void EVP_CIPHER_meth_free(EVP_CIPHER *cipher))
-
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher,
-                                                   int iv_len))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher,
-                                               unsigned long flags))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher,
-                                                       int ctx_size))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len);
+OSSL_DEPRECATEDIN_3_0
+EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher);
+OSSL_DEPRECATEDIN_3_0
+void EVP_CIPHER_meth_free(EVP_CIPHER *cipher);
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len);
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags);
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size);
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
                              int (*init) (EVP_CIPHER_CTX *ctx,
                                           const unsigned char *key,
                                           const unsigned char *iv,
-                                          int enc)))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_do_cipher
-    (EVP_CIPHER *cipher, int (*do_cipher) (EVP_CIPHER_CTX *ctx,
-                                           unsigned char *out,
-                                           const unsigned char *in,
-                                           size_t inl)))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_cleanup
-    (EVP_CIPHER *cipher, int (*cleanup) (EVP_CIPHER_CTX *)))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_set_asn1_params
-    (EVP_CIPHER *cipher, int (*set_asn1_parameters) (EVP_CIPHER_CTX *,
-                                                     ASN1_TYPE *)))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_get_asn1_params
-    (EVP_CIPHER *cipher, int (*get_asn1_parameters) (EVP_CIPHER_CTX *,
-                                                     ASN1_TYPE *)))
-DEPRECATEDIN_3_0(int EVP_CIPHER_meth_set_ctrl
-    (EVP_CIPHER *cipher, int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg,
-                                      void *ptr)))
-
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_init
-    (const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-                                const unsigned char *iv, int enc))
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))
-    (EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in,
-     size_t inl))
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))
-    (EVP_CIPHER_CTX *))
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))
-    (EVP_CIPHER_CTX *, ASN1_TYPE *))
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))
-    (EVP_CIPHER_CTX *, ASN1_TYPE *))
-DEPRECATEDIN_3_0(int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))
-    (EVP_CIPHER_CTX *, int type, int arg, void *ptr))
+                                          int enc));
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
+                                  int (*do_cipher) (EVP_CIPHER_CTX *ctx,
+                                                    unsigned char *out,
+                                                    const unsigned char *in,
+                                                    size_t inl));
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,
+                                int (*cleanup) (EVP_CIPHER_CTX *));
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,
+                                        int (*set_asn1_parameters) (EVP_CIPHER_CTX *,
+                                                                    ASN1_TYPE *));
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,
+                                        int (*get_asn1_parameters) (EVP_CIPHER_CTX *,
+                                                                    ASN1_TYPE *));
+OSSL_DEPRECATEDIN_3_0
+int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher,
+                             int (*ctrl) (EVP_CIPHER_CTX *, int type,
+                                          int arg, void *ptr));
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
+                                                      const unsigned char *key,
+                                                      const unsigned char *iv,
+                                                      int enc);
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,
+                                                           unsigned char *out,
+                                                           const unsigned char *in,
+                                                           size_t inl);
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *);
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
+                                                                 ASN1_TYPE *);
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
+                                                                 ASN1_TYPE *);
+OSSL_DEPRECATEDIN_3_0 int
+(*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, int type,
+                                                      int arg, void *ptr);
+# endif
 
 /* Values for cipher flags */
 
@@ -547,9 +570,11 @@ int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
 int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
 int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
 int EVP_CIPHER_CTX_tag_length(const EVP_CIPHER_CTX *ctx);
-DEPRECATEDIN_3_0(const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx))
-DEPRECATEDIN_3_0(const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx))
-DEPRECATEDIN_3_0(unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx);
+# endif
 int EVP_CIPHER_CTX_get_iv_state(EVP_CIPHER_CTX *ctx, void *buf, size_t len);
 int EVP_CIPHER_CTX_get_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len);
 unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx);
@@ -1177,13 +1202,15 @@ int EVP_RAND_state(EVP_RAND_CTX *ctx);
 #define EVP_RAND_STATE_ERROR            2
 
 /* PKEY stuff */
-DEPRECATEDIN_3_0(int EVP_PKEY_decrypt_old(unsigned char *dec_key,
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_decrypt_old(unsigned char *dec_key,
                                           const unsigned char *enc_key,
                                           int enc_key_len,
-                                          EVP_PKEY *private_key))
-DEPRECATEDIN_3_0(int EVP_PKEY_encrypt_old(unsigned char *enc_key,
+                                          EVP_PKEY *private_key);
+OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_encrypt_old(unsigned char *enc_key,
                                           const unsigned char *key,
-                                          int key_len, EVP_PKEY *pub_key))
+                                          int key_len, EVP_PKEY *pub_key);
+#endif
 int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name);
 void EVP_PKEY_typenames_do_all(const EVP_PKEY *pkey,
                                void (*fn)(const char *name, void *data),
@@ -1198,7 +1225,9 @@ int EVP_PKEY_can_sign(const EVP_PKEY *pkey);
 int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
 int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
 int EVP_PKEY_set_type_by_keymgmt(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt);
-DEPRECATEDIN_3_0(int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type);
+# endif
 # ifndef OPENSSL_NO_ENGINE
 int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e);
 ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey);
@@ -1574,18 +1603,19 @@ int EVP_PKEY_CTX_set_mac_key(EVP_PKEY_CTX *ctx, const unsigned char *key,
  * Method handles all operations: don't assume any digest related defaults.
  */
 # define EVP_PKEY_FLAG_SIGCTX_CUSTOM     4
-
-DEPRECATEDIN_3_0(const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type))
-DEPRECATEDIN_3_0(EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags))
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
-                                              const EVP_PKEY_METHOD *meth))
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst,
-                                         const EVP_PKEY_METHOD *src))
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth))
-DEPRECATEDIN_3_0(int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth))
-DEPRECATEDIN_3_0(int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth))
-DEPRECATEDIN_3_0(size_t EVP_PKEY_meth_get_count(void))
-DEPRECATEDIN_3_0(const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
+OSSL_DEPRECATEDIN_3_0 EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
+                                              const EVP_PKEY_METHOD *meth);
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst,
+                                         const EVP_PKEY_METHOD *src);
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
+OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
+OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth);
+OSSL_DEPRECATEDIN_3_0 size_t EVP_PKEY_meth_get_count(void);
+OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx);
+# endif
 
 EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
                                const char *properties);
@@ -1788,186 +1818,148 @@ void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
 EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);
 
 int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
-                                             int (*init) (EVP_PKEY_CTX *ctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_copy
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
+                                             int (*init) (EVP_PKEY_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_copy
     (EVP_PKEY_METHOD *pmeth, int (*copy) (EVP_PKEY_CTX *dst,
-                                          const EVP_PKEY_CTX *src)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_cleanup
-    (EVP_PKEY_METHOD *pmeth, void (*cleanup) (EVP_PKEY_CTX *ctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_paramgen
+                                          const EVP_PKEY_CTX *src));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_cleanup
+    (EVP_PKEY_METHOD *pmeth, void (*cleanup) (EVP_PKEY_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_paramgen
     (EVP_PKEY_METHOD *pmeth, int (*paramgen_init) (EVP_PKEY_CTX *ctx),
-     int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_keygen
+     int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_keygen
     (EVP_PKEY_METHOD *pmeth, int (*keygen_init) (EVP_PKEY_CTX *ctx),
-     int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_sign
+     int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_sign
     (EVP_PKEY_METHOD *pmeth, int (*sign_init) (EVP_PKEY_CTX *ctx),
      int (*sign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-                  const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_verify
+                  const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify
     (EVP_PKEY_METHOD *pmeth, int (*verify_init) (EVP_PKEY_CTX *ctx),
      int (*verify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen,
-                    const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_verify_recover
+                    const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify_recover
     (EVP_PKEY_METHOD *pmeth, int (*verify_recover_init) (EVP_PKEY_CTX *ctx),
      int (*verify_recover) (EVP_PKEY_CTX *ctx, unsigned char *sig,
                             size_t *siglen, const unsigned char *tbs,
-                            size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_signctx
+                            size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_signctx
     (EVP_PKEY_METHOD *pmeth, int (*signctx_init) (EVP_PKEY_CTX *ctx,
                                                   EVP_MD_CTX *mctx),
      int (*signctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-                     EVP_MD_CTX *mctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_verifyctx
+                     EVP_MD_CTX *mctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verifyctx
     (EVP_PKEY_METHOD *pmeth, int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
                                                     EVP_MD_CTX *mctx),
      int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
-                       EVP_MD_CTX *mctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_encrypt
+                       EVP_MD_CTX *mctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_encrypt
     (EVP_PKEY_METHOD *pmeth, int (*encrypt_init) (EVP_PKEY_CTX *ctx),
      int (*encryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-                       const unsigned char *in, size_t inlen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_decrypt
+                       const unsigned char *in, size_t inlen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_decrypt
     (EVP_PKEY_METHOD *pmeth, int (*decrypt_init) (EVP_PKEY_CTX *ctx),
      int (*decrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-                     const unsigned char *in, size_t inlen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_derive
+                     const unsigned char *in, size_t inlen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_derive
     (EVP_PKEY_METHOD *pmeth, int (*derive_init) (EVP_PKEY_CTX *ctx),
-     int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_ctrl
+     int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_ctrl
     (EVP_PKEY_METHOD *pmeth, int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
                                           void *p2),
-     int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_digestsign
+     int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestsign
     (EVP_PKEY_METHOD *pmeth,
      int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-                        const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_digestverify
+                        const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestverify
     (EVP_PKEY_METHOD *pmeth,
      int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
                           size_t siglen, const unsigned char *tbs,
-                          size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_check
-    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_public_check
-    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_param_check
-    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_set_digest_custom
+                          size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_check
+    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_public_check
+    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_param_check
+    (EVP_PKEY_METHOD *pmeth, int (*check) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digest_custom
     (EVP_PKEY_METHOD *pmeth, int (*digest_custom) (EVP_PKEY_CTX *ctx,
-                                                   EVP_MD_CTX *mctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_init
-    (const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_copy
+                                                   EVP_MD_CTX *mctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_init
+    (const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_copy
     (const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst,
-                                                  const EVP_PKEY_CTX *src)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_cleanup
-    (const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_paramgen
+                                                  const EVP_PKEY_CTX *src));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_cleanup
+    (const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_paramgen
     (const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx),
-     int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_keygen
+     int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_keygen
     (const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx),
-     int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_sign
+     int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_sign
     (const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx),
      int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-                    const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_verify
+                    const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify
     (const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx),
      int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig,
-                      size_t siglen, const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_verify_recover
+                      size_t siglen, const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify_recover
     (const EVP_PKEY_METHOD *pmeth,
      int (**pverify_recover_init) (EVP_PKEY_CTX *ctx),
      int (**pverify_recover) (EVP_PKEY_CTX *ctx, unsigned char *sig,
                               size_t *siglen, const unsigned char *tbs,
-                              size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_signctx
+                              size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_signctx
     (const EVP_PKEY_METHOD *pmeth,
      int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
      int (**psignctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
-                       EVP_MD_CTX *mctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_verifyctx
+                       EVP_MD_CTX *mctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verifyctx
     (const EVP_PKEY_METHOD *pmeth,
      int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
      int (**pverifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig,
-                          int siglen, EVP_MD_CTX *mctx)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_encrypt
+                          int siglen, EVP_MD_CTX *mctx));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_encrypt
     (const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx),
      int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-                         const unsigned char *in, size_t inlen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_decrypt
+                         const unsigned char *in, size_t inlen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_decrypt
     (const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
      int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
-                       const unsigned char *in, size_t inlen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_derive
+                       const unsigned char *in, size_t inlen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_derive
     (const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx),
-     int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_ctrl
+     int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_ctrl
     (const EVP_PKEY_METHOD *pmeth,
      int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2),
      int (**pctrl_str) (EVP_PKEY_CTX *ctx, const char *type,
-                        const char *value)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_digestsign
+                        const char *value));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestsign
     (EVP_PKEY_METHOD *pmeth,
      int (**digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
-                         const unsigned char *tbs, size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_digestverify
+                         const unsigned char *tbs, size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestverify
     (EVP_PKEY_METHOD *pmeth,
      int (**digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
                            size_t siglen, const unsigned char *tbs,
-                           size_t tbslen)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_check
-    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_public_check
-    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_param_check
-    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey)))
-
-DEPRECATEDIN_3_0(void EVP_PKEY_meth_get_digest_custom
+                           size_t tbslen));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_check
+    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_public_check
+    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_param_check
+    (const EVP_PKEY_METHOD *pmeth, int (**pcheck) (EVP_PKEY *pkey));
+OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digest_custom
     (EVP_PKEY_METHOD *pmeth,
-     int (**pdigest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)))
+     int (**pdigest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx));
+# endif
 
 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h
index 0f196f9d78..c5b4e670ac 100644
--- a/include/openssl/hmac.h
+++ b/include/openssl/hmac.h
@@ -27,29 +27,32 @@
 # ifdef  __cplusplus
 extern "C" {
 # endif
-
-DEPRECATEDIN_3_0(size_t HMAC_size(const HMAC_CTX *e))
-DEPRECATEDIN_3_0(HMAC_CTX *HMAC_CTX_new(void))
-DEPRECATEDIN_3_0(int HMAC_CTX_reset(HMAC_CTX *ctx))
-DEPRECATEDIN_3_0(void HMAC_CTX_free(HMAC_CTX *ctx))
-
-DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
-                                        const EVP_MD *md))
-
-DEPRECATEDIN_3_0(int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
-                                  const EVP_MD *md, ENGINE *impl))
-DEPRECATEDIN_3_0(int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
-                                 size_t len))
-DEPRECATEDIN_3_0(int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
-                                unsigned int *len))
-DEPRECATEDIN_3_0(unsigned char *HMAC(const EVP_MD *evp_md, const void *key,
-                                     int key_len, const unsigned char *d,
-                                     size_t n, unsigned char *md,
-                                     unsigned int *md_len))
-DEPRECATEDIN_3_0(__owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx))
-
-DEPRECATEDIN_3_0(void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags))
-DEPRECATEDIN_3_0(const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 size_t HMAC_size(const HMAC_CTX *e);
+OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
+OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
+OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
+# endif
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur int HMAC_Init(HMAC_CTX *ctx,
+                                             const void *key, int len,
+                                             const EVP_MD *md);
+# endif
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
+                                       const EVP_MD *md, ENGINE *impl);
+OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
+                                      size_t len);
+OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
+                                     unsigned int *len);
+OSSL_DEPRECATEDIN_3_0 unsigned char *HMAC(const EVP_MD *evp_md, const void *key,
+                                          int key_len, const unsigned char *d,
+                                          size_t n, unsigned char *md,
+                                          unsigned int *md_len);
+OSSL_DEPRECATEDIN_3_0 __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
+OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
+OSSL_DEPRECATEDIN_3_0 const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/idea.h b/include/openssl/idea.h
index ce46743a4a..1f9bb3b3c7 100644
--- a/include/openssl/idea.h
+++ b/include/openssl/idea.h
@@ -37,28 +37,31 @@ typedef struct idea_key_st {
     IDEA_INT data[9][6];
 } IDEA_KEY_SCHEDULE;
 #endif
-
-DEPRECATEDIN_3_0(const char *IDEA_options(void))
-DEPRECATEDIN_3_0(void IDEA_ecb_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       IDEA_KEY_SCHEDULE *ks))
-DEPRECATEDIN_3_0(void IDEA_set_encrypt_key(const unsigned char *key,
-                                           IDEA_KEY_SCHEDULE *ks))
-DEPRECATEDIN_3_0(void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
-                                           IDEA_KEY_SCHEDULE *dk))
-DEPRECATEDIN_3_0(void IDEA_cbc_encrypt(const unsigned char *in,
-                                       unsigned char *out, long length,
-                                       IDEA_KEY_SCHEDULE *ks,
-                                       unsigned char *iv, int enc))
-DEPRECATEDIN_3_0(void IDEA_cfb64_encrypt(const unsigned char *in,
-                                         unsigned char *out, long length,
-                                         IDEA_KEY_SCHEDULE *ks,
-                                         unsigned char *iv, int *num, int enc))
-DEPRECATEDIN_3_0(void IDEA_ofb64_encrypt(const unsigned char *in,
-                                         unsigned char *out, long length,
-                                         IDEA_KEY_SCHEDULE *ks,
-                                         unsigned char *iv, int *num))
-DEPRECATEDIN_3_0(void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks))
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void);
+OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in,
+                                            unsigned char *out,
+                                            IDEA_KEY_SCHEDULE *ks);
+OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key,
+                                                IDEA_KEY_SCHEDULE *ks);
+OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
+                                                IDEA_KEY_SCHEDULE *dk);
+OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in,
+                                            unsigned char *out, long length,
+                                            IDEA_KEY_SCHEDULE *ks,
+                                            unsigned char *iv, int enc);
+OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in,
+                                              unsigned char *out, long length,
+                                              IDEA_KEY_SCHEDULE *ks,
+                                              unsigned char *iv, int *num,
+                                              int enc);
+OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in,
+                                              unsigned char *out, long length,
+                                              IDEA_KEY_SCHEDULE *ks,
+                                              unsigned char *iv, int *num);
+OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in,
+                                        IDEA_KEY_SCHEDULE *ks);
+#endif
 
 #  ifndef OPENSSL_NO_DEPRECATED_1_1_0
 #   define idea_options          IDEA_options
diff --git a/include/openssl/md2.h b/include/openssl/md2.h
index a088d5b680..5d4cb77e71 100644
--- a/include/openssl/md2.h
+++ b/include/openssl/md2.h
@@ -39,14 +39,15 @@ typedef struct MD2state_st {
     MD2_INT state[MD2_BLOCK];
 } MD2_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(const char *MD2_options(void))
-DEPRECATEDIN_3_0(int MD2_Init(MD2_CTX *c))
-DEPRECATEDIN_3_0(int MD2_Update(MD2_CTX *c, const unsigned char *data,
-                                size_t len))
-DEPRECATEDIN_3_0(int MD2_Final(unsigned char *md, MD2_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *MD2(const unsigned char *d, size_t n,
-                 unsigned char *md))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *MD2_options(void);
+OSSL_DEPRECATEDIN_3_0 int MD2_Init(MD2_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MD2_Update(MD2_CTX *c, const unsigned char *data,
+                                     size_t len);
+OSSL_DEPRECATEDIN_3_0 int MD2_Final(unsigned char *md, MD2_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MD2(const unsigned char *d, size_t n,
+                                         unsigned char *md);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/md4.h b/include/openssl/md4.h
index 1686f0ae54..6c150a6cb2 100644
--- a/include/openssl/md4.h
+++ b/include/openssl/md4.h
@@ -46,13 +46,14 @@ typedef struct MD4state_st {
     unsigned int num;
 } MD4_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(int MD4_Init(MD4_CTX *c))
-DEPRECATEDIN_3_0(int MD4_Update(MD4_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int MD4_Final(unsigned char *md, MD4_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *MD4(const unsigned char *d, size_t n,
-                 unsigned char *md))
-DEPRECATEDIN_3_0(void MD4_Transform(MD4_CTX *c, const unsigned char *b))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int MD4_Final(unsigned char *md, MD4_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MD4(const unsigned char *d, size_t n,
+                                         unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void MD4_Transform(MD4_CTX *c, const unsigned char *b);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/md5.h b/include/openssl/md5.h
index c111639b5d..77a577340f 100644
--- a/include/openssl/md5.h
+++ b/include/openssl/md5.h
@@ -45,13 +45,14 @@ typedef struct MD5state_st {
     unsigned int num;
 } MD5_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(int MD5_Init(MD5_CTX *c))
-DEPRECATEDIN_3_0(int MD5_Update(MD5_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int MD5_Final(unsigned char *md, MD5_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *MD5(const unsigned char *d, size_t n,
-                                    unsigned char *md))
-DEPRECATEDIN_3_0(void MD5_Transform(MD5_CTX *c, const unsigned char *b))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
+                                         unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/mdc2.h b/include/openssl/mdc2.h
index c8ebe0d9d2..5a7ee289d1 100644
--- a/include/openssl/mdc2.h
+++ b/include/openssl/mdc2.h
@@ -38,13 +38,14 @@ typedef struct mdc2_ctx_st {
     unsigned int pad_type;   /* either 1 or 2, default 1 */
 } MDC2_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(int MDC2_Init(MDC2_CTX *c))
-DEPRECATEDIN_3_0(int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
-                 size_t len))
-DEPRECATEDIN_3_0(int MDC2_Final(unsigned char *md, MDC2_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *MDC2(const unsigned char *d, size_t n,
-                 unsigned char *md))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int MDC2_Init(MDC2_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
+                                      size_t len);
+OSSL_DEPRECATEDIN_3_0 int MDC2_Final(unsigned char *md, MDC2_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MDC2(const unsigned char *d, size_t n,
+                                          unsigned char *md);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/pkcs12.h.in b/include/openssl/pkcs12.h.in
index f829dc7439..76b19d3dc9 100644
--- a/include/openssl/pkcs12.h.in
+++ b/include/openssl/pkcs12.h.in
@@ -85,8 +85,10 @@ typedef struct pkcs12_bag_st PKCS12_BAGS;
 # define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
 
 #endif
-
-DEPRECATEDIN_1_1_0(ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid))
+#ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
+                                                   int attr_nid);
+#endif
 
 ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
 int PKCS12_mac_present(const PKCS12 *p12);
diff --git a/include/openssl/rand.h b/include/openssl/rand.h
index 73eefd5c14..2570b8463e 100644
--- a/include/openssl/rand.h
+++ b/include/openssl/rand.h
@@ -64,8 +64,9 @@ int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
 
 /* Equivalent of RAND_bytes() but additionally taking an OSSL_LIB_CTX */
 int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, int num);
-
-DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 int RAND_pseudo_bytes(unsigned char *buf, int num);
+# endif
 
 EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx);
 EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx);
@@ -93,8 +94,10 @@ int RAND_poll(void);
 
 # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
 /* application has to include <windows.h> in order to use these */
-DEPRECATEDIN_1_1_0(void RAND_screen(void))
-DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 void RAND_screen(void);
+OSSL_DEPRECATEDIN_1_1_0 int RAND_event(UINT, WPARAM, LPARAM);
+#  endif
 # endif
 
 #ifdef  __cplusplus
diff --git a/include/openssl/rc2.h b/include/openssl/rc2.h
index f6f5fc91ad..ff633fd80f 100644
--- a/include/openssl/rc2.h
+++ b/include/openssl/rc2.h
@@ -36,25 +36,29 @@ typedef struct rc2_key_st {
     RC2_INT data[64];
 } RC2_KEY;
 #  endif
-
-DEPRECATEDIN_3_0(void RC2_set_key(RC2_KEY *key, int len,
-                                  const unsigned char *data, int bits))
-DEPRECATEDIN_3_0(void RC2_ecb_encrypt(const unsigned char *in,
-                                      unsigned char *out, RC2_KEY *key,
-                                      int enc))
-DEPRECATEDIN_3_0(void RC2_encrypt(unsigned long *data, RC2_KEY *key))
-DEPRECATEDIN_3_0(void RC2_decrypt(unsigned long *data, RC2_KEY *key))
-DEPRECATEDIN_3_0(void RC2_cbc_encrypt(const unsigned char *in,
-                                      unsigned char *out, long length,
-                                      RC2_KEY *ks, unsigned char *iv, int enc))
-DEPRECATEDIN_3_0(void RC2_cfb64_encrypt(const unsigned char *in,
-                                        unsigned char *out, long length,
-                                        RC2_KEY *schedule, unsigned char *ivec,
-                                        int *num, int enc))
-DEPRECATEDIN_3_0(void RC2_ofb64_encrypt(const unsigned char *in,
-                                        unsigned char *out, long length,
-                                        RC2_KEY *schedule, unsigned char *ivec,
-                                        int *num))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 void RC2_set_key(RC2_KEY *key, int len,
+                                       const unsigned char *data, int bits);
+OSSL_DEPRECATEDIN_3_0 void RC2_ecb_encrypt(const unsigned char *in,
+                                           unsigned char *out, RC2_KEY *key,
+                                           int enc);
+OSSL_DEPRECATEDIN_3_0 void RC2_encrypt(unsigned long *data, RC2_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void RC2_decrypt(unsigned long *data, RC2_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void RC2_cbc_encrypt(const unsigned char *in,
+                                           unsigned char *out, long length,
+                                           RC2_KEY *ks, unsigned char *iv,
+                                           int enc);
+OSSL_DEPRECATEDIN_3_0 void RC2_cfb64_encrypt(const unsigned char *in,
+                                             unsigned char *out, long length,
+                                             RC2_KEY *schedule,
+                                             unsigned char *ivec,
+                                             int *num, int enc);
+OSSL_DEPRECATEDIN_3_0 void RC2_ofb64_encrypt(const unsigned char *in,
+                                             unsigned char *out, long length,
+                                             RC2_KEY *schedule,
+                                             unsigned char *ivec,
+                                             int *num);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/rc4.h b/include/openssl/rc4.h
index 3850083a5d..600b2885df 100644
--- a/include/openssl/rc4.h
+++ b/include/openssl/rc4.h
@@ -30,12 +30,14 @@ typedef struct rc4_key_st {
     RC4_INT data[256];
 } RC4_KEY;
 #  endif
-
-DEPRECATEDIN_3_0(const char *RC4_options(void))
-DEPRECATEDIN_3_0(void RC4_set_key(RC4_KEY *key, int len,
-                                  const unsigned char *data))
-DEPRECATEDIN_3_0(void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
-                          unsigned char *outdata))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 const char *RC4_options(void);
+OSSL_DEPRECATEDIN_3_0 void RC4_set_key(RC4_KEY *key, int len,
+                                       const unsigned char *data);
+OSSL_DEPRECATEDIN_3_0 void RC4(RC4_KEY *key, size_t len,
+                               const unsigned char *indata,
+                               unsigned char *outdata);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/rc5.h b/include/openssl/rc5.h
index bf2c8259d7..de83352310 100644
--- a/include/openssl/rc5.h
+++ b/include/openssl/rc5.h
@@ -46,27 +46,30 @@ typedef struct rc5_key_st {
     RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
 } RC5_32_KEY;
 #  endif
-
-DEPRECATEDIN_3_0(int RC5_32_set_key(RC5_32_KEY *key, int len,
-                                    const unsigned char *data, int rounds))
-DEPRECATEDIN_3_0(void RC5_32_ecb_encrypt(const unsigned char *in,
-                                         unsigned char *out, RC5_32_KEY *key,
-                                         int enc))
-DEPRECATEDIN_3_0(void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key))
-DEPRECATEDIN_3_0(void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key))
-DEPRECATEDIN_3_0(void RC5_32_cbc_encrypt(const unsigned char *in,
-                                         unsigned char *out, long length,
-                                         RC5_32_KEY *ks, unsigned char *iv,
-                                         int enc))
-DEPRECATEDIN_3_0(void RC5_32_cfb64_encrypt(const unsigned char *in,
-                                           unsigned char *out, long length,
-                                           RC5_32_KEY *schedule,
-                                           unsigned char *ivec, int *num,
-                                           int enc))
-DEPRECATEDIN_3_0(void RC5_32_ofb64_encrypt(const unsigned char *in,
-                                           unsigned char *out, long length,
-                                           RC5_32_KEY *schedule,
-                                           unsigned char *ivec, int *num))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int RC5_32_set_key(RC5_32_KEY *key, int len,
+                                         const unsigned char *data,
+                                         int rounds);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_ecb_encrypt(const unsigned char *in,
+                                              unsigned char *out,
+                                              RC5_32_KEY *key,
+                                              int enc);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_cbc_encrypt(const unsigned char *in,
+                                              unsigned char *out, long length,
+                                              RC5_32_KEY *ks, unsigned char *iv,
+                                              int enc);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_cfb64_encrypt(const unsigned char *in,
+                                                unsigned char *out, long length,
+                                                RC5_32_KEY *schedule,
+                                                unsigned char *ivec, int *num,
+                                                int enc);
+OSSL_DEPRECATEDIN_3_0 void RC5_32_ofb64_encrypt(const unsigned char *in,
+                                                unsigned char *out, long length,
+                                                RC5_32_KEY *schedule,
+                                                unsigned char *ivec, int *num);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/ripemd.h b/include/openssl/ripemd.h
index 9c5e17898e..900ee317b9 100644
--- a/include/openssl/ripemd.h
+++ b/include/openssl/ripemd.h
@@ -41,15 +41,16 @@ typedef struct RIPEMD160state_st {
     unsigned int num;
 } RIPEMD160_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(int RIPEMD160_Init(RIPEMD160_CTX *c))
-DEPRECATEDIN_3_0(int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
-                                      size_t len))
-DEPRECATEDIN_3_0(int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *RIPEMD160(const unsigned char *d, size_t n,
-                                          unsigned char *md))
-DEPRECATEDIN_3_0(void RIPEMD160_Transform(RIPEMD160_CTX *c,
-                                          const unsigned char *b))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Init(RIPEMD160_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
+                                           size_t len);
+OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *RIPEMD160(const unsigned char *d, size_t n,
+                                               unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void RIPEMD160_Transform(RIPEMD160_CTX *c,
+                                               const unsigned char *b);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/seed.h b/include/openssl/seed.h
index 4023821443..edb218ae6e 100644
--- a/include/openssl/seed.h
+++ b/include/openssl/seed.h
@@ -72,35 +72,38 @@ typedef struct seed_key_st {
 #   endif
 } SEED_KEY_SCHEDULE;
 #  endif /* OPENSSL_NO_DEPRECATED_3_0 */
-
-DEPRECATEDIN_3_0(void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
-                                   SEED_KEY_SCHEDULE *ks))
-
-DEPRECATEDIN_3_0(void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
-                                   unsigned char d[SEED_BLOCK_SIZE],
-                                   const SEED_KEY_SCHEDULE *ks))
-DEPRECATEDIN_3_0(void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
-                                   unsigned char d[SEED_BLOCK_SIZE],
-                                   const SEED_KEY_SCHEDULE *ks))
-
-DEPRECATEDIN_3_0(void SEED_ecb_encrypt(const unsigned char *in,
-                                       unsigned char *out,
-                                       const SEED_KEY_SCHEDULE *ks, int enc))
-DEPRECATEDIN_3_0(void SEED_cbc_encrypt(const unsigned char *in,
-                                       unsigned char *out, size_t len,
-                                       const SEED_KEY_SCHEDULE *ks,
-                                       unsigned char ivec[SEED_BLOCK_SIZE],
-                                       int enc))
-DEPRECATEDIN_3_0(void SEED_cfb128_encrypt(const unsigned char *in,
-                                          unsigned char *out, size_t len,
-                                          const SEED_KEY_SCHEDULE *ks,
-                                          unsigned char ivec[SEED_BLOCK_SIZE],
-                                          int *num, int enc))
-DEPRECATEDIN_3_0(void SEED_ofb128_encrypt(const unsigned char *in,
-                                          unsigned char *out, size_t len,
-                                          const SEED_KEY_SCHEDULE *ks,
-                                          unsigned char ivec[SEED_BLOCK_SIZE],
-                                          int *num))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
+                  SEED_KEY_SCHEDULE *ks);
+OSSL_DEPRECATEDIN_3_0
+void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
+                  unsigned char d[SEED_BLOCK_SIZE],
+                  const SEED_KEY_SCHEDULE *ks);
+OSSL_DEPRECATEDIN_3_0
+void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
+                  unsigned char d[SEED_BLOCK_SIZE],
+                  const SEED_KEY_SCHEDULE *ks);
+OSSL_DEPRECATEDIN_3_0
+void SEED_ecb_encrypt(const unsigned char *in,
+                      unsigned char *out,
+                      const SEED_KEY_SCHEDULE *ks, int enc);
+OSSL_DEPRECATEDIN_3_0
+void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
+                      const SEED_KEY_SCHEDULE *ks,
+                      unsigned char ivec[SEED_BLOCK_SIZE],
+                      int enc);
+OSSL_DEPRECATEDIN_3_0
+void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+                         size_t len, const SEED_KEY_SCHEDULE *ks,
+                         unsigned char ivec[SEED_BLOCK_SIZE],
+                         int *num, int enc);
+OSSL_DEPRECATEDIN_3_0
+void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+                         size_t len, const SEED_KEY_SCHEDULE *ks,
+                         unsigned char ivec[SEED_BLOCK_SIZE],
+                         int *num);
+#  endif
 
 #  ifdef  __cplusplus
 }
diff --git a/include/openssl/sha.h b/include/openssl/sha.h
index eac7cdbba3..36339373b7 100644
--- a/include/openssl/sha.h
+++ b/include/openssl/sha.h
@@ -46,13 +46,14 @@ typedef struct SHAstate_st {
     unsigned int num;
 } SHA_CTX;
 # endif /* !defined(OPENSSL_NO_DEPRECATED_3_0) */
-
-DEPRECATEDIN_3_0(int SHA1_Init(SHA_CTX *c))
-DEPRECATEDIN_3_0(int SHA1_Update(SHA_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int SHA1_Final(unsigned char *md, SHA_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *SHA1(const unsigned char *d, size_t n,
-                 unsigned char *md))
-DEPRECATEDIN_3_0(void SHA1_Transform(SHA_CTX *c, const unsigned char *data))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *SHA1(const unsigned char *d, size_t n,
+                                          unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
+# endif
 
 # ifndef OPENSSL_NO_DEPRECATED_3_0
 #  define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a
@@ -66,19 +67,22 @@ typedef struct SHA256state_st {
     unsigned int num, md_len;
 } SHA256_CTX;
 # endif /* !defined(OPENSSL_NO_DEPRECATED_3_0) */
-
-DEPRECATEDIN_3_0(int SHA224_Init(SHA256_CTX *c))
-DEPRECATEDIN_3_0(int SHA224_Update(SHA256_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int SHA224_Final(unsigned char *md, SHA256_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *SHA224(const unsigned char *d, size_t n,
-                                       unsigned char *md))
-DEPRECATEDIN_3_0(int SHA256_Init(SHA256_CTX *c))
-DEPRECATEDIN_3_0(int SHA256_Update(SHA256_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int SHA256_Final(unsigned char *md, SHA256_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *SHA256(const unsigned char *d, size_t n,
-                                       unsigned char *md))
-DEPRECATEDIN_3_0(void SHA256_Transform(SHA256_CTX *c,
-                                       const unsigned char *data))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int SHA224_Update(SHA256_CTX *c,
+                                        const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int SHA224_Final(unsigned char *md, SHA256_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *SHA224(const unsigned char *d, size_t n,
+                                            unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
+                                        const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *SHA256(const unsigned char *d, size_t n,
+                                            unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c,
+                                            const unsigned char *data);
+# endif
 
 # define SHA224_DIGEST_LENGTH    28
 # define SHA256_DIGEST_LENGTH    32
@@ -115,19 +119,22 @@ typedef struct SHA512state_st {
     unsigned int num, md_len;
 } SHA512_CTX;
 # endif /* !defined(OPENSSL_NO_DEPRECATED_3_0) */
-
-DEPRECATEDIN_3_0(int SHA384_Init(SHA512_CTX *c))
-DEPRECATEDIN_3_0(int SHA384_Update(SHA512_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int SHA384_Final(unsigned char *md, SHA512_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *SHA384(const unsigned char *d, size_t n,
-                                       unsigned char *md))
-DEPRECATEDIN_3_0(int SHA512_Init(SHA512_CTX *c))
-DEPRECATEDIN_3_0(int SHA512_Update(SHA512_CTX *c, const void *data, size_t len))
-DEPRECATEDIN_3_0(int SHA512_Final(unsigned char *md, SHA512_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *SHA512(const unsigned char *d, size_t n,
-                                       unsigned char *md))
-DEPRECATEDIN_3_0(void SHA512_Transform(SHA512_CTX *c,
-                                       const unsigned char *data))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int SHA384_Init(SHA512_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int SHA384_Update(SHA512_CTX *c,
+                                        const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int SHA384_Final(unsigned char *md, SHA512_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *SHA384(const unsigned char *d, size_t n,
+                                            unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c,
+                                        const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int SHA512_Final(unsigned char *md, SHA512_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *SHA512(const unsigned char *d, size_t n,
+                                            unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c,
+                                            const unsigned char *data);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/srp.h.in b/include/openssl/srp.h.in
index 619816c65f..8ddee32df3 100644
--- a/include/openssl/srp.h.in
+++ b/include/openssl/srp.h.in
@@ -98,7 +98,10 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
 
 int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
 /* This method ignores the configured seed and fails for an unknown user. */
-DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username))
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0
+SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
+# endif
 /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
 SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
 
diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in
index f9a61609e4..6f2a7f42d1 100644
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -1002,7 +1002,9 @@ extern "C" {
 # define SSL_CTX_get_app_data(ctx)       (SSL_CTX_get_ex_data(ctx,0))
 # define SSL_CTX_set_app_data(ctx,arg)   (SSL_CTX_set_ex_data(ctx,0, \
                                                               (char *)(arg)))
-DEPRECATEDIN_1_1_0(void SSL_set_debug(SSL *s, int debug))
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 void SSL_set_debug(SSL *s, int debug);
+# endif
 
 /* TLSv1.3 KeyUpdate message types */
 /* -1 used so that this is an invalid value for the on-the-wire protocol */
@@ -1636,9 +1638,8 @@ __owur int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
 
 #ifndef OPENSSL_NO_RSA
 # ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 __owur int SSL_use_RSAPrivateKey_file(SSL *ssl,
-                                                            const char *file,
-                                                            int type);
+OSSL_DEPRECATEDIN_3_0
+__owur int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
 # endif
 #endif
 
@@ -1762,8 +1763,8 @@ void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb) (SSL *ssl, void *arg),
                          void *arg);
 # ifndef OPENSSL_NO_RSA
 #  ifndef OPENSSL_NO_DEPRECATED_3_0
-OSSL_DEPRECATEDIN_3_0 __owur int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx,
-                                                           RSA *rsa);
+OSSL_DEPRECATEDIN_3_0
+__owur int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
 OSSL_DEPRECATEDIN_3_0
 __owur int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d,
                                           long len);
@@ -1938,12 +1939,17 @@ __owur int SSL_get_error(const SSL *s, int ret_code);
 __owur const char *SSL_get_version(const SSL *s);
 
 /* This sets the 'default' SSL version that SSL_new() will create */
-DEPRECATEDIN_3_0(__owur int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+__owur int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
+# endif
 
 # ifndef OPENSSL_NO_SSL3_METHOD
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *SSLv3_method(void)) /* SSLv3 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *SSLv3_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *SSLv3_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_client_method(void);
+#  endif
 # endif
 
 #define SSLv23_method           TLS_method
@@ -1956,34 +1962,44 @@ __owur const SSL_METHOD *TLS_server_method(void);
 __owur const SSL_METHOD *TLS_client_method(void);
 
 # ifndef OPENSSL_NO_TLS1_METHOD
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_client_method(void);
+#  endif
 # endif
 
 # ifndef OPENSSL_NO_TLS1_1_METHOD
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(void)) /* TLSv1.1 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_client_method(void);
+#  endif
 # endif
 
 # ifndef OPENSSL_NO_TLS1_2_METHOD
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_client_method(void);
+#  endif
 # endif
 
 # ifndef OPENSSL_NO_DTLS1_METHOD
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_client_method(void);
+#  endif
 # endif
 
 # ifndef OPENSSL_NO_DTLS1_2_METHOD
 /* DTLSv1.2 */
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_server_method(void))
-DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_client_method(void))
+#  ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_server_method(void);
+OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_client_method(void);
+#  endif
 # endif
 
 __owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
diff --git a/include/openssl/store.h b/include/openssl/store.h
index 8be9f71bf3..ae0aaa26d1 100644
--- a/include/openssl/store.h
+++ b/include/openssl/store.h
@@ -68,10 +68,12 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
  * determine which loader is used), except for common commands (see below).
  * Each command takes different arguments.
  */
-DEPRECATEDIN_3_0(int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd,
-                                     ... /* args */))
-DEPRECATEDIN_3_0(int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd,
-                                      va_list args))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd,
+                                          ... /* args */);
+OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd,
+                                           va_list args);
+# endif
 
 # ifndef OPENSSL_NO_DEPRECATED_3_0
 
@@ -305,57 +307,59 @@ typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx);
 typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
 
 # endif
-
-DEPRECATEDIN_3_0(OSSL_STORE_LOADER *OSSL_STORE_LOADER_new
-                 (ENGINE *e, const char *scheme))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_open
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_open_fn open_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_open_ex
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_open_ex_fn open_ex_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_attach
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_attach_fn attach_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_ctrl
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_ctrl_fn ctrl_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_expect
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_expect_fn expect_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_find
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_find_fn find_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_load
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_load_fn load_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_eof
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_eof_fn eof_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_error
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_error_fn error_function))
-DEPRECATEDIN_3_0(int OSSL_STORE_LOADER_set_close
-                 (OSSL_STORE_LOADER *loader,
-                  OSSL_STORE_close_fn close_function))
-
-DEPRECATEDIN_3_0(const ENGINE *OSSL_STORE_LOADER_get0_engine
-                 (const OSSL_STORE_LOADER *loader))
-DEPRECATEDIN_3_0(const char * OSSL_STORE_LOADER_get0_scheme
-                 (const OSSL_STORE_LOADER *loader))
-
-DEPRECATEDIN_3_0(int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader))
-DEPRECATEDIN_3_0(OSSL_STORE_LOADER *OSSL_STORE_unregister_loader
-                 (const char *scheme))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
+                               OSSL_STORE_open_fn open_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_open_ex(OSSL_STORE_LOADER *loader,
+                                  OSSL_STORE_open_ex_fn open_ex_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
+                                 OSSL_STORE_attach_fn attach_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
+                               OSSL_STORE_ctrl_fn ctrl_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
+                                 OSSL_STORE_expect_fn expect_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader,
+                               OSSL_STORE_find_fn find_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *loader,
+                               OSSL_STORE_load_fn load_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *loader,
+                              OSSL_STORE_eof_fn eof_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *loader,
+                                OSSL_STORE_error_fn error_function);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader,
+                                OSSL_STORE_close_fn close_function);
+OSSL_DEPRECATEDIN_3_0
+const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
+OSSL_DEPRECATEDIN_3_0
+const char * OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
+OSSL_DEPRECATEDIN_3_0
+OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme);
+# endif
 
 /*-
  *  Functions to list STORE loaders
  *  -------------------------------
  */
-DEPRECATEDIN_3_0(int OSSL_STORE_do_all_loaders
-                 (void (*do_function)(const OSSL_STORE_LOADER *loader,
-                                      void *do_arg),
-                  void *do_arg))
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+int OSSL_STORE_do_all_loaders(void (*do_function)(const OSSL_STORE_LOADER *loader,
+                                                  void *do_arg),
+                              void *do_arg);
+# endif
 
 # ifdef  __cplusplus
 }
diff --git a/include/openssl/whrlpool.h b/include/openssl/whrlpool.h
index f05925842e..05ba463246 100644
--- a/include/openssl/whrlpool.h
+++ b/include/openssl/whrlpool.h
@@ -43,15 +43,16 @@ typedef struct {
     size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
 } WHIRLPOOL_CTX;
 #  endif
-
-DEPRECATEDIN_3_0(int WHIRLPOOL_Init(WHIRLPOOL_CTX *c))
-DEPRECATEDIN_3_0(int WHIRLPOOL_Update(WHIRLPOOL_CTX *c,
-                                      const void *inp, size_t bytes))
-DEPRECATEDIN_3_0(void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp,
-                                          size_t bits))
-DEPRECATEDIN_3_0(int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c))
-DEPRECATEDIN_3_0(unsigned char *WHIRLPOOL(const void *inp, size_t bytes,
-                                          unsigned char *md))
+#  ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c,
+                                           const void *inp, size_t bytes);
+OSSL_DEPRECATEDIN_3_0 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,
+                                               const void *inp, size_t bits);
+OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *WHIRLPOOL(const void *inp, size_t bytes,
+                                               unsigned char *md);
+#  endif
 
 #  ifdef __cplusplus
 }
diff --git a/include/openssl/x509.h.in b/include/openssl/x509.h.in
index 14a4a02da7..5a3a4eedd7 100644
--- a/include/openssl/x509.h.in
+++ b/include/openssl/x509.h.in
@@ -647,15 +647,18 @@ void X509_INFO_free(X509_INFO *a);
 char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size);
 
 /* TODO move this block of decls to asn1.h when 'breaking change' is possible */
-DEPRECATEDIN_3_0(int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
-                                 ASN1_BIT_STRING *signature, char *data,
-                                 EVP_PKEY *pkey))
-DEPRECATEDIN_3_0(int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type,
-                                 char *data,
-                                 unsigned char *md, unsigned int *len))
-DEPRECATEDIN_3_0(int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
-                               X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
-                               char *data, EVP_PKEY *pkey, const EVP_MD *type))
+#ifndef OPENSSL_NO_DEPRECATED_3_0
+OSSL_DEPRECATEDIN_3_0
+int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
+                ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);
+OSSL_DEPRECATEDIN_3_0
+int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
+                unsigned char *md, unsigned int *len);
+OSSL_DEPRECATEDIN_3_0
+int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
+              ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
+              const EVP_MD *type);
+#endif
 int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,
                      unsigned char *md, unsigned int *len);
 int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
@@ -766,8 +769,10 @@ int X509_CRL_up_ref(X509_CRL *crl);
 long X509_CRL_get_version(const X509_CRL *crl);
 const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
 const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
-DEPRECATEDIN_1_1_0(ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl))
-DEPRECATEDIN_1_1_0(ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl))
+#ifndef OPENSSL_NO_DEPRECATED_1_1_0
+OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
+OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
+#endif
 X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); /* TODO change to get0_ */
 const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
 STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);


More information about the openssl-commits mailing list