Skip to content

Commit

Permalink
default provider: include RIPEMD160
Browse files Browse the repository at this point in the history
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 #19375)

(cherry picked from commit ecd8314)
  • Loading branch information
paulidale authored and t8m committed Oct 19, 2022
1 parent c861c3e commit 4534468
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions crypto/ripemd/build.info
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions providers/defltprov.c
Expand Up @@ -148,6 +148,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 }
};
Expand Down
2 changes: 1 addition & 1 deletion providers/implementations/digests/build.info
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions test/recipes/30-test_evp_data/evpmd_ripemd.txt
Expand Up @@ -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

0 comments on commit 4534468

Please sign in to comment.