wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.35k stars 835 forks source link

[Bug]: Compile error in asn.c #8198

Open rliebscher opened 3 hours ago

rliebscher commented 3 hours ago

Contact Details

No response

Version

5.7.4

Description

When requesting the original ASN implementation but disabling RSA and enabling CRL, I get a compile error asn.c function ParseCRL() when it calls VerifyCRL_Signature() because sigParams and sigParamsSz are not available.

Defining WOLFSSL_ASN_ORIGINAL means WOLFSSL_ASN_TEMPLATE will not be defined. Also WC_RSA_PSS is not defined.

The fix is probably just to remove the #ifdef WC_RSA_PSS around the variables at the start of the function.

Reproduction steps

./configure --enable-asn=original --disable-rsa --enable-crl make

Relevant log output

wolfcrypt/src/asn.c: In function 'ParseCRL':
wolfcrypt/src/asn.c:39077:32: error: 'sigParams' undeclared (first use in this function); did you mean 'DhParams'?
39077 |            dcrl->signatureOID, sigParams, sigParamsSz, ca, dcrl->heap);
      |                                ^~~~~~~~~
      |                                DhParams
wolfcrypt/src/asn.c:39077:32: note: each undeclared identifier is reported only once for each function it appears in
wolfcrypt/src/asn.c:39077:43: error: 'sigParamsSz' undeclared (first use in this function)
39077 |            dcrl->signatureOID, sigParams, sigParamsSz, ca, dcrl->heap);
      |                                           ^~~~~~~~~~~
anhu commented 3 hours ago

Hi @rliebscher ,

Thanks for the report!! I will try out your reproduction steps and get back to you with a fix.

Here at wolfSSL we love learning about how people are using our libraries. Can you please tell me a bit about yourself (i.e.: Where are you located?), your use case and any other information that would give us some context so that we can better help you?

Warm regards, Anthony