aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-10-11 11:23:57 +1100
committerTomas Mraz <tomas@openssl.org>2022-10-19 13:21:01 +0200
commitecd831469919215b0a45693b00ec0fd7d42d5d61 (patch)
treecdc054a8c476b6fa45264f178a0b6e45eb2917e8
parentce9317a4cfc01541964a14745c4d09e2a846981c (diff)
downloadopenssl-ecd831469919215b0a45693b00ec0fd7d42d5d61.tar.gz
default provider: include RIPEMD160
Including RIPEMD160 in both the default and legacy providers shouldn't break anyone and makes the algorithm available more readily. Fixes #17722 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19375)
-rw-r--r--crypto/ripemd/build.info6
-rw-r--r--providers/defltprov.c4
-rw-r--r--providers/implementations/digests/build.info2
-rw-r--r--test/recipes/30-test_evp_data/evpmd_ripemd.txt16
4 files changed, 16 insertions, 12 deletions
diff --git a/crypto/ripemd/build.info b/crypto/ripemd/build.info
index 03f1f98632..75a6cd5ff0 100644
--- a/crypto/ripemd/build.info
+++ b/crypto/ripemd/build.info
@@ -19,10 +19,10 @@ SOURCE[../../libcrypto]=rmd_dgst.c rmd_one.c $RMD160ASM
DEFINE[../../libcrypto]=$RMD160DEF
# When all deprecated symbols are removed, libcrypto doesn't export the
-# RIPEMD160 functions, so we must include them directly in liblegacy.a
+# RIPEMD160 functions, so we must include them directly in libcommon.a
IF[{- $disabled{'deprecated-3.0'} -}]
- SOURCE[../../providers/liblegacy.a]=rmd_dgst.c rmd_one.c $RMD160ASM
- DEFINE[../../providers/liblegacy.a]=$RMD160DEF
+ SOURCE[../../providers/libcommon.a]=rmd_dgst.c rmd_one.c $RMD160ASM
+ DEFINE[../../providers/libcommon.a]=$RMD160DEF
ENDIF
GENERATE[rmd-586.S]=asm/rmd-586.pl
diff --git a/providers/defltprov.c b/providers/defltprov.c
index dc9521b235..a85e332445 100644
--- a/providers/defltprov.c
+++ b/providers/defltprov.c
@@ -153,6 +153,10 @@ static const OSSL_ALGORITHM deflt_digests[] = {
{ PROV_NAMES_MD5_SHA1, "provider=default", ossl_md5_sha1_functions },
#endif /* OPENSSL_NO_MD5 */
+#ifndef OPENSSL_NO_RMD160
+ { PROV_NAMES_RIPEMD_160, "provider=default", ossl_ripemd160_functions },
+#endif /* OPENSSL_NO_RMD160 */
+
{ PROV_NAMES_NULL, "provider=default", ossl_nullmd_functions },
{ NULL, NULL, NULL }
};
diff --git a/providers/implementations/digests/build.info b/providers/implementations/digests/build.info
index c6508b6e85..2d807416d6 100644
--- a/providers/implementations/digests/build.info
+++ b/providers/implementations/digests/build.info
@@ -15,7 +15,7 @@ $MD2_GOAL=../../liblegacy.a
$MD4_GOAL=../../liblegacy.a
$MDC2_GOAL=../../liblegacy.a
$WHIRLPOOL_GOAL=../../liblegacy.a
-$RIPEMD_GOAL=../../liblegacy.a
+$RIPEMD_GOAL=$COMMON_GOAL
# This source is common for all digests in all our providers.
SOURCE[$COMMON_GOAL]=digestcommon.c
diff --git a/test/recipes/30-test_evp_data/evpmd_ripemd.txt b/test/recipes/30-test_evp_data/evpmd_ripemd.txt
index 3a11a8aa08..09caebb3d7 100644
--- a/test/recipes/30-test_evp_data/evpmd_ripemd.txt
+++ b/test/recipes/30-test_evp_data/evpmd_ripemd.txt
@@ -13,42 +13,42 @@
Title = RIPEMD160 tests
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = ""
Output = 9c1185a5c5e9fc54612808977ee8f548b2258d31
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "a"
Output = 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "abc"
Output = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "message digest"
Output = 5d0689ef49d2fae572b881b123a85ffa21595f36
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "abcdefghijklmnopqrstuvwxyz"
Output = f71c27109c692c1b56bbdceb5b9d2865b3708dbc
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
Output = 12a053384a9c0c88e405a06c27dcf49ada62eb2b
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
Output = b0e20b6e3116640286ed3a87a5713079b21f5189
-Availablein = legacy
+Availablein = legacy default
Digest = RIPEMD160
Input = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
Output = 9b752e45573d4b39f4dbd3323cab82bf63326bfb