@@ -5013,7 +5013,8 @@ int ConvertHashPss(int hashAlgo, enum wc_HashType* hashType, int* mgf)
50135013}
50145014#endif
50155015
5016- #if !defined(NO_WOLFSSL_SERVER) || !defined(WOLFSSL_NO_CLIENT_AUTH)
5016+ #if (!defined(NO_WOLFSSL_SERVER) || !defined(WOLFSSL_NO_CLIENT_AUTH)) && \
5017+ (!defined(WOLFSSL_RSA_PUBLIC_ONLY) && !defined(WOLFSSL_RSA_VERIFY_ONLY))
50175018int RsaSign(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out,
50185019 word32* outSz, int sigAlgo, int hashAlgo, RsaKey* key,
50195020 DerBuffer* keyBufInfo)
@@ -5317,7 +5318,8 @@ int VerifyRsaSign(WOLFSSL* ssl, byte* verifySig, word32 sigSz,
53175318
53185319#ifndef WOLFSSL_NO_TLS12
53195320
5320- #if !defined(NO_WOLFSSL_SERVER) || !defined(WOLFSSL_NO_CLIENT_AUTH)
5321+ #if (!defined(NO_WOLFSSL_SERVER) || !defined(WOLFSSL_NO_CLIENT_AUTH)) && \
5322+ !defined(WOLFSSL_RSA_PUBLIC_ONLY)
53215323int RsaDec(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, word32* outSz,
53225324 RsaKey* key, DerBuffer* keyBufInfo)
53235325{
@@ -5382,6 +5384,7 @@ int RsaDec(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, word32* outSz,
53825384}
53835385#endif /* !NO_WOLFSSL_SERVER) || !WOLFSSL_NO_CLIENT_AUTH */
53845386
5387+ #ifndef WOLFSSL_RSA_VERIFY_ONLY
53855388int RsaEnc(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, word32* outSz,
53865389 RsaKey* key, buffer* keyBufInfo)
53875390{
@@ -5441,6 +5444,7 @@ int RsaEnc(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, word32* outSz,
54415444
54425445 return ret;
54435446}
5447+ #endif
54445448
54455449#endif /* !WOLFSSL_NO_TLS12 */
54465450
@@ -34074,7 +34078,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
3407434078 {
3407534079 switch(ssl->specs.kea)
3407634080 {
34077- #ifndef NO_RSA
34081+ #if !defined( NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY)
3407834082 case rsa_kea:
3407934083 {
3408034084 ret = RsaEnc(ssl,
@@ -34090,7 +34094,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
3409034094
3409134095 break;
3409234096 }
34093- #endif /* !NO_RSA */
34097+ #endif /* !NO_RSA && !WOLFSSL_RSA_VERIFY_ONLY */
3409434098 #ifndef NO_DH
3409534099 case diffie_hellman_kea:
3409634100 {
@@ -34921,7 +34925,8 @@ int SendCertificateVerify(WOLFSSL* ssl)
3492134925 );
3492234926 }
3492334927 #endif /* HAVE_ED448 && !NO_ED448_CLIENT_AUTH */
34924- #ifndef NO_RSA
34928+ #if !defined(NO_RSA) && !defined(WOLFSSL_RSA_PUBLIC_ONLY) && \
34929+ !defined(WOLFSSL_RSA_VERIFY_ONLY)
3492534930 if (ssl->hsType == DYNAMIC_TYPE_RSA) {
3492634931 RsaKey* key = (RsaKey*)ssl->hsKey;
3492734932
@@ -34935,7 +34940,7 @@ int SendCertificateVerify(WOLFSSL* ssl)
3493534940 ssl->buffers.key
3493634941 );
3493734942 }
34938- #endif /* !NO_RSA */
34943+ #endif /* !NO_RSA && !WOLFSSL_RSA_PUBLIC_ONLY && !WOLFSSL_RSA_VERIFY_ONLY */
3493934944
3494034945 /* Check for error */
3494134946 if (ret != 0) {
@@ -36999,7 +37004,9 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3699937004 /* Sign hash to create signature */
3700037005 switch (ssl->options.sigAlgo)
3700137006 {
37002- #ifndef NO_RSA
37007+ #if !defined(NO_RSA) && \
37008+ !defined(WOLFSSL_RSA_PUBLIC_ONLY) && \
37009+ !defined(WOLFSSL_RSA_VERIFY_ONLY)
3700337010 #ifdef WC_RSA_PSS
3700437011 case rsa_pss_sa_algo:
3700537012 #endif
@@ -37018,7 +37025,8 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3701837025 );
3701937026 break;
3702037027 }
37021- #endif /* !NO_RSA */
37028+ #endif /* !NO_RSA && !WOLFSSL_RSA_PUBLIC_ONLY
37029+ && !WOLFSSL_RSA_VERIFY_ONLY */
3702237030 #ifdef HAVE_ECC
3702337031 #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
3702437032 case sm2_sa_algo:
@@ -37112,7 +37120,9 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3711237120 /* Sign hash to create signature */
3711337121 switch (ssl->options.sigAlgo)
3711437122 {
37115- #ifndef NO_RSA
37123+ #if !defined(NO_RSA) && \
37124+ !defined(WOLFSSL_RSA_PUBLIC_ONLY) && \
37125+ !defined(WOLFSSL_RSA_VERIFY_ONLY)
3711637126 #ifdef WC_RSA_PSS
3711737127 case rsa_pss_sa_algo:
3711837128 #endif
@@ -37135,7 +37145,8 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3713537145 );
3713637146 break;
3713737147 }
37138- #endif /* NO_RSA */
37148+ #endif /* !NO_RSA && !WOLFSSL_RSA_PUBLIC_ONLY
37149+ && !WOLFSSL_RSA_VERIFY_ONLY */
3713937150 default:
3714037151 break;
3714137152 } /* switch (ssl->options.sigAlgo) */
@@ -41815,7 +41826,7 @@ static int DefTicketEncCb(WOLFSSL* ssl, byte key_name[WOLFSSL_TICKET_NAME_SZ],
4181541826 case TLS_ASYNC_DO:
4181641827 {
4181741828 switch (ssl->specs.kea) {
41818- #ifndef NO_RSA
41829+ #if !defined( NO_RSA) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
4181941830 case rsa_kea:
4182041831 {
4182141832 RsaKey* key = (RsaKey*)ssl->hsKey;
@@ -41851,7 +41862,7 @@ static int DefTicketEncCb(WOLFSSL* ssl, byte key_name[WOLFSSL_TICKET_NAME_SZ],
4185141862 ret = 0;
4185241863 break;
4185341864 } /* rsa_kea */
41854- #endif /* !NO_RSA */
41865+ #endif /* !NO_RSA && !WOLFSSL_RSA_PUBLIC_ONLY */
4185541866 #ifndef NO_PSK
4185641867 case psk_kea:
4185741868 {
0 commit comments