Skip to content

Commit a12ccca

Browse files
Fully exclude the wc_DsaCheckPubKey function when building with NO_DSA_PUBKEY_CHECK.
1 parent b79870e commit a12ccca

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

tests/api/test_dsa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ int test_wc_DsaCheckPubKey(void)
591591
{
592592
EXPECT_DECLS;
593593
#if !defined(NO_DSA) && !defined(WC_FIPS_186_5_PLUS) && \
594-
!defined(HAVE_SELFTEST) && !defined(HAVE_FIPS) && defined(WOLFSSL_PUBLIC_MP)
594+
!defined(HAVE_SELFTEST) && !defined(HAVE_FIPS) && defined(WOLFSSL_PUBLIC_MP) \
595+
&& !defined(NO_DSA_PUBKEY_CHECK)
595596
DsaKey key;
596597
int answer = -1;
597598
int ret;

wolfcrypt/src/dsa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void wc_FreeDsaKey(DsaKey* key)
114114
* return 0 on success, BAD_FUNC_ARG when the key fails validation, or a
115115
* negative error code on internal failure.
116116
*/
117+
#ifndef NO_DSA_PUBKEY_CHECK
117118
int wc_DsaCheckPubKey(DsaKey* key)
118119
{
119120
int err = MP_OKAY;
@@ -189,6 +190,7 @@ int wc_DsaCheckPubKey(DsaKey* key)
189190

190191
return err;
191192
}
193+
#endif /* !NO_DSA_PUBKEY_CHECK */
192194

193195
/* validate that (L,N) match allowed sizes from FIPS 186-4, Section 4.2.
194196
* modLen - represents L, the size of p (prime modulus) in bits

0 commit comments

Comments
 (0)