Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ REDIRECTION_OUT2_KEYELMID
REDIRECTION_OUT2_KEYID
RENESAS_T4_USE
RHEL_MAJOR
RHEL_RELEASE_CODE
RTC_ALARMSUBSECONDMASK_ALL
RTE_CMSIS_RTOS_RTX
RTOS_MODULE_NET_AVAIL
Expand Down
28 changes: 28 additions & 0 deletions linuxkm/lkcapi_rsa_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#error lkcapi_rsa_glue.c included in non-LINUXKM_LKCAPI_REGISTER project.
#endif

#ifndef RHEL_RELEASE_VERSION
#define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b))
#endif

#if !defined(NO_RSA)
#if (defined(LINUXKM_LKCAPI_REGISTER_ALL) || \
(defined(LINUXKM_LKCAPI_REGISTER_ALL_KCONFIG) && defined(CONFIG_CRYPTO_RSA))) && \
Expand Down Expand Up @@ -2347,6 +2351,14 @@ static int linuxkm_test_rsa_driver(const char * driver, int nbits)

memset(dec, 0, key_len);
ret = crypto_akcipher_decrypt(req);
#if defined(RHEL_RELEASE_CODE) && \
(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 6))
if (ret == -ENOSYS) {
pr_info("info: ignoring failure from crypto_akcipher_decrypt (disabled by RHEL policy)\n");
test_rc = 0;
goto test_rsa_end;
}
#endif
if (ret) {
pr_err("error: crypto_akcipher_decrypt returned: %d\n", ret);
goto test_rsa_end;
Expand Down Expand Up @@ -2721,6 +2733,14 @@ static int linuxkm_test_pkcs1pad_driver(const char * driver, int nbits,
akcipher_request_set_crypt(req, &src, &dst, hash_len, key_len);

ret = crypto_akcipher_sign(req);
#if defined(RHEL_RELEASE_CODE) && \
(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 6))
if (ret == -ENOSYS) {
pr_info("info: ignoring failure from crypto_akcipher_sign (disabled by RHEL policy)\n");
test_rc = 0;
goto test_pkcs1_end;
}
#endif
if (ret) {
pr_err("error: crypto_akcipher_sign returned: %d\n", ret);
test_rc = BAD_FUNC_ARG;
Expand Down Expand Up @@ -2847,6 +2867,14 @@ static int linuxkm_test_pkcs1pad_driver(const char * driver, int nbits,
}

ret = crypto_akcipher_decrypt(req);
#if defined(RHEL_RELEASE_CODE) && \
(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 6))
if (ret == -ENOSYS) {
pr_info("info: ignoring failure from crypto_akcipher_decrypt (disabled by RHEL policy)\n");
test_rc = 0;
goto test_pkcs1_end;
}
#endif
if (ret) {
pr_err("error: crypto_akcipher_decrypt returned: %d\n", ret);
test_rc = BAD_FUNC_ARG;
Expand Down