ASN macro simplification#7798
Conversation
3ea0fa5 to
ad497dd
Compare
|
retest this please |
b20605c to
85f6b6a
Compare
|
Retest this please |
…SN_ALL` option. Added granular macros for ASN features like: `WOLFSSL_ASN_CA_ISSUER`, `WOLFSSL_ASN_PARSE_KEYUSAGE`, `WOLFSSL_ASN_TIME_STRING`, `WOLFSSL_OCSP_PARSE_STATUS`.
…-curl` and `--enable-openssh`).
|
Retest this please. Found cause for intermittent |
|
@SparkiDev and @bandi13 this PR is ready. It also resolves a C89 issue detected in @douzzer multi-test: |
|
./configure --disable-shared --enable-asn=template,nocrypt 'RsaPssHashOidTosigOid' defined but not used. |
…`. Improved logic on unknown extension callback (new `WC_ASN_UNKNOWN_EXT_CB` gate).
|
./configure --disable-shared --enable-asn=template,nocrypt |
Doubt that works on master with |
…tificate signature checking, so make check TLS expected failures do not pass. Cleanup of the api.c headers / macros.
|
Retest this please. Seems to be unstable FIPS test: |
douzzer
left a comment
There was a problem hiding this comment.
This is some nice cleanup!
testing uncovered this:
[quantum-safe-wolfssl-all-g++-latest] [6 of 32] [9911392b22]
configure... real 0m23.619s user 0m10.294s sys 0m15.108s
build...In file included from tests/api.c:63:
tests/api.c: In function ‘int test_GENERAL_NAME_set0_othername()’:
e542e51d9f (<sean@wolfssl.com> 2023-06-05 17:39:39 +1000 57494) ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
tests/api.c:57494:41: error: invalid conversion from ‘void*’ to ‘GENERAL_NAMES*’ {aka ‘WOLFSSL_STACK*’} [-fpermissive]
57494 | ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
e467112a93 (<sean@wolfssl.com> 2023-06-13 16:36:10 +1000 143) if (_ret != TEST_FAIL) { if (!(test)) ExpFail(description, result); \
./tests/unit.h:143:36: note: in definition of macro ‘Expect’
143 | if (_ret != TEST_FAIL) { if (!(test)) ExpFail(description, result); \
| ^~~~
e542e51d9f (<sean@wolfssl.com> 2023-06-05 17:39:39 +1000 57494) ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
tests/api.c:57494:5: note: in expansion of macro ‘ExpectNotNull’
57494 | ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
| ^~~~~~~~~~~~~
tests/api.c: In function ‘int test_othername_and_SID_ext()’:
e542e51d9f (<sean@wolfssl.com> 2023-06-05 17:39:39 +1000 57658) ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
tests/api.c:57658:41: error: invalid conversion from ‘void*’ to ‘GENERAL_NAMES*’ {aka ‘WOLFSSL_STACK*’} [-fpermissive]
57658 | ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
e467112a93 (<sean@wolfssl.com> 2023-06-13 16:36:10 +1000 143) if (_ret != TEST_FAIL) { if (!(test)) ExpFail(description, result); \
./tests/unit.h:143:36: note: in definition of macro ‘Expect’
143 | if (_ret != TEST_FAIL) { if (!(test)) ExpFail(description, result); \
| ^~~~
e542e51d9f (<sean@wolfssl.com> 2023-06-05 17:39:39 +1000 57658) ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
tests/api.c:57658:5: note: in expansion of macro ‘ExpectNotNull’
57658 | ExpectNotNull(gns = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL,
| ^~~~~~~~~~~~~
(note that line numbers are after rebase on current master, 15e99c8)
Also several overlong lines, some of which are probably best left overlong:
/src/x509.c:5677 case NID_certificate_policies: crit = x509->certPolicyCrit; break;
/tests/api.c:341 #if (defined(HAVE_ECC112) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 112
/tests/api.c:346 #if (defined(HAVE_ECC128) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 128
/tests/api.c:351 #if (defined(HAVE_ECC160) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 160
/tests/api.c:356 #if (defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 192
/wolfssl/ocsp.h:72 WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
/wolfssl/ocsp.h:73 WOLFSSL_ASN1_TIME **revtime, WOLFSSL_ASN1_TIME **thisupd,
/wolfssl/wolfcrypt/settings.h:2943 /* Store pointers to issuer name components and their lengths and encodings. */
/wolfssl/wolfcrypt/settings.h:3033 #error ASN unknown extension callback is only supported with ASN template
…nchmark.c error without ChaCha and unused encrypt_only.
|
./configure --disable-shared --enable-asn=template,nocrypt |
That is correct. With NO_ASN_CRYPT the signature check always report success. I am not sure we should allow this build option with TLS. To get make check to pass I had to disable all of the TLS tests. Thoughts? |
|
My preference would be to return NOT_COMPILED_IN and only support it for wolfCrypt only. |
|
I've updated the PR to return NOT_COMPILED_IN (instead of 0=success) in |
…th NO_ASN_CRYPT. Also default to signature failed.
Description
ASN macro simplification.
--enable-asn=allandWOLFSSL_ASN_ALLoption.WOLFSSL_ASN_CA_ISSUER,WOLFSSL_ASN_PARSE_KEYUSAGE,WOLFSSL_ASN_TIME_STRING,WOLFSSL_OCSP_PARSE_STATUS.SetDNSEntryandGenerateDNSEntryRIDStringwith possible leaks and return code checking.ASN_BER_TO_DER.WC_ASN_UNKNOWN_EXT_CBgate).Testing
Checklist