Skip to content

Commit dec95d7

Browse files
committed
Rework how our providers are built
We put almost everything in these internal static libraries: libcommon Block building code that can be used by all our implementations, legacy and non-legacy alike. libimplementations All non-legacy algorithm implementations and only them. All the code that ends up here is agnostic to the definitions of FIPS_MODE. liblegacy All legacy implementations. libnonfips Support code for the algorithm implementations. Built with FIPS_MODE undefined. Any code that checks that FIPS_MODE isn't defined must end up in this library. libfips Support code for the algorithm implementations. Built with FIPS_MODE defined. Any code that checks that FIPS_MODE is defined must end up in this library. The FIPS provider module is built from providers/fips/*.c and linked with libimplementations, libcommon and libfips. The Legacy provider module is built from providers/legacy/*.c and linked with liblegacy, libcommon and libcrypto. If module building is disabled, the object files from liblegacy and libcommon are added to libcrypto and the Legacy provider becomes a built-in provider. The Default provider module is built-in, so it ends up being linked with libimplementations, libcommon and libnonfips. For libcrypto in form of static library, the object files from those other libraries are simply being added to libcrypto. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #10088)
1 parent e805c2d commit dec95d7

File tree

37 files changed

+288
-147
lines changed

37 files changed

+288
-147
lines changed

crypto/aes/build.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ ENDIF
6262
$COMMON=aes_misc.c aes_ecb.c $AESASM
6363
SOURCE[../../libcrypto]=$COMMON aes_cfb.c aes_ofb.c aes_ige.c aes_wrap.c
6464
DEFINE[../../libcrypto]=$AESDEF
65-
SOURCE[../../providers/fips]=$COMMON
66-
DEFINE[../../providers/fips]=$AESDEF
65+
SOURCE[../../providers/libfips.a]=$COMMON
66+
DEFINE[../../providers/libfips.a]=$AESDEF
6767

6868
GENERATE[aes-ia64.s]=asm/aes-ia64.S
6969

crypto/bn/build.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ $COMMON=bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \
109109
bn_rsa_fips186_4.c $BNASM
110110
SOURCE[../../libcrypto]=$COMMON bn_print.c bn_err.c bn_depr.c bn_srp.c
111111
DEFINE[../../libcrypto]=$BNDEF
112-
SOURCE[../../providers/fips]=$COMMON
113-
DEFINE[../../providers/fips]=$BNDEF
112+
SOURCE[../../providers/libfips.a]=$COMMON
113+
DEFINE[../../providers/libfips.a]=$BNDEF
114114

115115
INCLUDE[../../libcrypto]=../../crypto/include
116116

crypto/buffer/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
LIBS=../../libcrypto
22
SOURCE[../../libcrypto]=buffer.c buf_err.c
3-
SOURCE[../../providers/fips]=buffer.c
3+
SOURCE[../../providers/libfips.a]=buffer.c

crypto/build.info

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $CORE_COMMON=provider_core.c provider_predefined.c \
6363
core_fetch.c core_algorithm.c core_namemap.c
6464

6565
SOURCE[../libcrypto]=$CORE_COMMON provider_conf.c
66-
SOURCE[../providers/fips]=$CORE_COMMON
66+
SOURCE[../providers/libfips.a]=$CORE_COMMON
6767

6868
# Central utilities
6969
$UTIL_COMMON=\
@@ -78,8 +78,8 @@ SOURCE[../libcrypto]=$UTIL_COMMON \
7878
o_fopen.c getenv.c o_init.c o_fips.c init.c trace.c provider.c \
7979
$UPLINKSRC
8080
DEFINE[../libcrypto]=$UTIL_DEFINE $UPLINKDEF
81-
SOURCE[../providers/fips]=$UTIL_COMMON
82-
DEFINE[../providers/fips]=$UTIL_DEFINE
81+
SOURCE[../providers/libfips.a]=$UTIL_COMMON
82+
DEFINE[../providers/libfips.a]=$UTIL_DEFINE
8383

8484

8585
DEPEND[info.o]=buildinf.h

crypto/cmac/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ LIBS=../../libcrypto
33
$COMMON=cmac.c
44

55
SOURCE[../../libcrypto]=$COMMON cm_ameth.c
6-
SOURCE[../../providers/fips]=$COMMON
6+
SOURCE[../../providers/libfips.a]=$COMMON

crypto/des/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SOURCE[../../libcrypto]=$COMMON\
2020
ofb64ede.c ofb64enc.c ofb_enc.c \
2121
str2key.c pcbc_enc.c qud_cksm.c rand_key.c \
2222
fcrypt.c xcbc_enc.c cbc_cksm.c
23-
SOURCE[../../providers/fips]=$COMMON
23+
SOURCE[../../providers/libfips.a]=$COMMON
2424

2525
GENERATE[des_enc-sparc.S]=asm/des_enc.m4
2626
GENERATE[dest4-sparcv9.S]=asm/dest4-sparcv9.pl

crypto/ec/build.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $COMMON=ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c \
5757
SOURCE[../../libcrypto]=$COMMON ec_ameth.c ec_pmeth.c ecx_meth.c ec_err.c \
5858
ecdh_kdf.c eck_prn.c
5959
DEFINE[../../libcrypto]=$ECDEF
60-
SOURCE[../../providers/fips]=$COMMON
61-
DEFINE[../../providers/fips]=$ECDEF
60+
SOURCE[../../providers/libfips.a]=$COMMON
61+
DEFINE[../../providers/libfips.a]=$ECDEF
6262

6363
GENERATE[ecp_nistz256-x86.s]=asm/ecp_nistz256-x86.pl
6464

crypto/evp/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SOURCE[../../libcrypto]=$COMMON\
1818
e_chacha20_poly1305.c \
1919
pkey_mac.c exchange.c \
2020
legacy_sha.c legacy_md5_sha1.c
21-
SOURCE[../../providers/fips]=$COMMON
21+
SOURCE[../../providers/libfips.a]=$COMMON
2222

2323
INCLUDE[e_aes.o]=.. ../modes
2424
INCLUDE[e_aes_cbc_hmac_sha1.o]=../modes

crypto/hmac/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ LIBS=../../libcrypto
33
$COMMON=hmac.c
44

55
SOURCE[../../libcrypto]=$COMMON hm_ameth.c
6-
SOURCE[../../providers/fips]=$COMMON
6+
SOURCE[../../providers/libfips.a]=$COMMON

crypto/lhash/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LIBS=../../libcrypto
22
SOURCE[../../libcrypto]=\
33
lhash.c lh_stats.c
4-
SOURCE[../../providers/fips]=\
4+
SOURCE[../../providers/libfips.a]=\
55
lhash.c

0 commit comments

Comments
 (0)