Define fips_/nonfips_ variants of rsa_pkcs1pad_tmpl and rsassa_pkcs1_tmpl when the kernel is configured to use a standalone FIPS module. Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx> --- include/crypto/internal/rsa.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/crypto/internal/rsa.h b/include/crypto/internal/rsa.h index 1265aa81f6fe..9028a184d06e 100644 --- a/include/crypto/internal/rsa.h +++ b/include/crypto/internal/rsa.h @@ -12,6 +12,16 @@ #include <linux/types.h> #include <crypto/akcipher.h> +#ifdef CONFIG_CRYPTO_FIPS140_EXTMOD +#ifdef FIPS_MODULE +#define rsa_pkcs1pad_tmpl fips_rsa_pkcs1pad_tmpl +#define rsassa_pkcs1_tmpl fips_rsassa_pkcs1_tmpl +#else +#define rsa_pkcs1pad_tmpl nonfips_rsa_pkcs1pad_tmpl +#define rsassa_pkcs1_tmpl nonfips_rsassa_pkcs1_tmpl +#endif +#endif + /** * rsa_key - RSA key structure * @n : RSA modulus raw byte stream -- 2.39.3