File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2243,6 +2243,10 @@ add_option("WOLFSSL_CRYPTOCB_NO_SW_TEST"
22432243 "Disable crypto callback SW testing (default: disabled)"
22442244 "no" "yes;no" )
22452245
2246+ add_option ("WOLFSSL_CRYPTOCB_RSA_PAD"
2247+ "Enable RSA padding aware crypto callbacks (default: disabled)"
2248+ "no" "yes;no" )
2249+
22462250add_option ("WOLFSSL_PKCALLBACKS"
22472251 "Enable public key callbacks (default: disabled)"
22482252 "no" "yes;no" )
@@ -2475,6 +2479,13 @@ if(WOLFSSL_CRYPTOCB_NO_SW_TEST)
24752479 list (APPEND WOLFSSL_DEFINITIONS "-DWC_TEST_NO_CRYPTOCB_SW_TEST" )
24762480endif ()
24772481
2482+ if (WOLFSSL_CRYPTOCB_RSA_PAD)
2483+ if (NOT WOLFSSL_CRYPTOCB)
2484+ message (FATAL_ERROR "WOLFSSL_CRYPTOCB_RSA_PAD requires WOLFSSL_CRYPTOCB" )
2485+ endif ()
2486+ list (APPEND WOLFSSL_DEFINITIONS "-DWOLF_CRYPTO_CB_RSA_PAD" )
2487+ endif ()
2488+
24782489# Public Key Callbacks
24792490if (WOLFSSL_PKCALLBACKS)
24802491 list (APPEND WOLFSSL_DEFINITIONS "-DHAVE_PK_CALLBACKS" )
Original file line number Diff line number Diff line change @@ -258,6 +258,8 @@ extern "C" {
258258#cmakedefine WC_RSA_PSS
259259#undef WOLF_CRYPTO_CB
260260#cmakedefine WOLF_CRYPTO_CB
261+ #undef WOLF_CRYPTO_CB_RSA_PAD
262+ #cmakedefine WOLF_CRYPTO_CB_RSA_PAD
261263#undef WOLFSSL_AARCH64_BUILD
262264#cmakedefine WOLFSSL_AARCH64_BUILD
263265#undef WOLFSSL_AES_CFB
Original file line number Diff line number Diff line change @@ -10622,6 +10622,24 @@ if test "$ENABLED_CRYPTOCB_UTILS" != "no"; then
1062210622 fi
1062310623fi
1062410624
10625+ # Crypto callback RSA padding support
10626+ # When enabled, the RSA crypto callback args struct exposes the RsaPadding
10627+ # parameters so the callback can perform RSA padding/unpadding itself or
10628+ # offload it together with the modular exponentiation.
10629+ AC_ARG_ENABLE ( [ cryptocb-rsa-pad] ,
10630+ [ AS_HELP_STRING ( [ --enable-cryptocb-rsa-pad] ,[ Enable RSA padding aware crypto callbacks (default: disabled). Requires --enable-cryptocb] ) ] ,
10631+ [ ENABLED_CRYPTOCB_RSA_PAD=$enableval ] ,
10632+ [ ENABLED_CRYPTOCB_RSA_PAD=no ]
10633+ )
10634+
10635+ if test "$ENABLED_CRYPTOCB_RSA_PAD" = "yes"
10636+ then
10637+ if test "x$ENABLED_CRYPTOCB" = "xno"; then
10638+ AC_MSG_ERROR ( [ --enable-cryptocb-rsa-pad requires --enable-cryptocb] )
10639+ fi
10640+ AM_CFLAGS="$AM_CFLAGS -DWOLF_CRYPTO_CB_RSA_PAD"
10641+ fi
10642+
1062510643
1062610644# Asynchronous Crypto
1062710645AC_ARG_ENABLE ( [ asynccrypt] ,
You can’t perform that action at this time.
0 commit comments