File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2235,6 +2235,10 @@ add_option("WOLFSSL_CRYPTOCB_NO_SW_TEST"
22352235 "Disable crypto callback SW testing (default: disabled)"
22362236 "no" "yes;no" )
22372237
2238+ add_option ("WOLFSSL_CRYPTOCB_RSA_PAD"
2239+ "Enable RSA padding aware crypto callbacks (default: disabled)"
2240+ "no" "yes;no" )
2241+
22382242add_option ("WOLFSSL_PKCALLBACKS"
22392243 "Enable public key callbacks (default: disabled)"
22402244 "no" "yes;no" )
@@ -2467,6 +2471,13 @@ if(WOLFSSL_CRYPTOCB_NO_SW_TEST)
24672471 list (APPEND WOLFSSL_DEFINITIONS "-DWC_TEST_NO_CRYPTOCB_SW_TEST" )
24682472endif ()
24692473
2474+ if (WOLFSSL_CRYPTOCB_RSA_PAD)
2475+ if (NOT WOLFSSL_CRYPTOCB)
2476+ message (FATAL_ERROR "WOLFSSL_CRYPTOCB_RSA_PAD requires WOLFSSL_CRYPTOCB" )
2477+ endif ()
2478+ list (APPEND WOLFSSL_DEFINITIONS "-DWOLF_CRYPTO_CB_RSA_PAD" )
2479+ endif ()
2480+
24702481# Public Key Callbacks
24712482if (WOLFSSL_PKCALLBACKS)
24722483 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 @@ -10512,6 +10512,24 @@ if test "$ENABLED_CRYPTOCB_UTILS" != "no"; then
1051210512 fi
1051310513fi
1051410514
10515+ # Crypto callback RSA padding support
10516+ # When enabled, the RSA crypto callback args struct exposes the RsaPadding
10517+ # parameters so the callback can perform RSA padding/unpadding itself or
10518+ # offload it together with the modular exponentiation.
10519+ AC_ARG_ENABLE ( [ cryptocb-rsa-pad] ,
10520+ [ AS_HELP_STRING ( [ --enable-cryptocb-rsa-pad] ,[ Enable RSA padding aware crypto callbacks (default: disabled). Requires --enable-cryptocb] ) ] ,
10521+ [ ENABLED_CRYPTOCB_RSA_PAD=$enableval ] ,
10522+ [ ENABLED_CRYPTOCB_RSA_PAD=no ]
10523+ )
10524+
10525+ if test "$ENABLED_CRYPTOCB_RSA_PAD" = "yes"
10526+ then
10527+ if test "x$ENABLED_CRYPTOCB" = "xno"; then
10528+ AC_MSG_ERROR ( [ --enable-cryptocb-rsa-pad requires --enable-cryptocb] )
10529+ fi
10530+ AM_CFLAGS="$AM_CFLAGS -DWOLF_CRYPTO_CB_RSA_PAD"
10531+ fi
10532+
1051510533
1051610534# Asynchronous Crypto
1051710535AC_ARG_ENABLE ( [ asynccrypt] ,
You can’t perform that action at this time.
0 commit comments