The legacy provider contains assembler references. Most code is automagically pulled in from the libcrypto - but the platform specific assembler functions will not be visible in the symbol table. Copying BNASM and DESASM into liblegacy seems to be a better solution than exposing platform specific function in libcrypto.num.
Added a missing call in the des_cbc code for sparc.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11697)
bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_sqr.c \
bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \
bn_x931p.c bn_intern.c bn_dh.c \
- bn_rsa_fips186_4.c $BNDH $BNASM
-SOURCE[../../libcrypto]=$COMMON bn_print.c bn_err.c bn_srp.c
+ bn_rsa_fips186_4.c $BNDH
+SOURCE[../../libcrypto]=$COMMON $BNASM bn_print.c bn_err.c bn_srp.c
IF[{- !$disabled{'deprecated-3.0'} -}]
SOURCE[../../libcrypto]=bn_depr.c
ENDIF
-SOURCE[../../providers/libfips.a]=$COMMON
+SOURCE[../../providers/libfips.a]=$COMMON $BNASM
+SOURCE[../../providers/liblegacy.a]=$BNASM
# Implementations are now spread across several libraries, so the defines
# need to be applied to all affected libraries and modules.
DEFINE[../../libcrypto]=$BNDEF
DEFINE[../../providers/libfips.a]=$BNDEF
+DEFINE[../../providers/liblegacy.a]=$BNDEF
DEFINE[../../providers/libimplementations.a]=$BNDEF
INCLUDE[../../libcrypto]=../../crypto/include
ENDIF
LIBS=../../libcrypto
-$COMMON=set_key.c ecb3_enc.c $DESASM
+$COMMON=set_key.c ecb3_enc.c
$ALL=$COMMON\
ecb_enc.c cbc_enc.c \
cfb64enc.c cfb64ede.c cfb_enc.c \
str2key.c pcbc_enc.c qud_cksm.c rand_key.c \
fcrypt.c xcbc_enc.c cbc_cksm.c
-SOURCE[../../libcrypto]=$ALL
-SOURCE[../../providers/libfips.a]=$COMMON
+SOURCE[../../libcrypto]=$ALL $DESASM
+SOURCE[../../providers/libfips.a]=$COMMON $DESASM
+SOURCE[../../providers/liblegacy.a]=$DESASM
+
DEFINE[../../libcrypto]=$DESDEF
DEFINE[../../providers/libfips.a]=$DESDEF
DEFINE[../../providers/liblegacy.a]=$DESDEF
static int cipher_hw_des_cbc_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t len)
{
- DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks);
+ PROV_DES_CTX *dctx = (PROV_DES_CTX *)ctx;
+ DES_key_schedule *key = &(dctx->dks.ks);
+
+ if (dctx->dstream.cbc != NULL) {
+ (*dctx->dstream.cbc) (in, out, len, key, ctx->iv);
+ return 1;
+ }
while (len >= MAXCHUNK) {
DES_ncbc_encrypt(in, out, MAXCHUNK, key, (DES_cblock *)ctx->iv,