Merge pull request #7451 from SparkiDev/test_fixes_1

Fixes from configuration testing
This commit is contained in:
JacobBarthelmeh
2024-04-19 10:43:31 -06:00
committed by GitHub
3 changed files with 18 additions and 3 deletions

View File

@ -133,6 +133,7 @@ static int PrintDer(FILE* fp)
return ret; return ret;
} }
#ifndef NO_CODING
/* Print ASN.1 of a file containing Base64 encoding of BER/DER data. /* Print ASN.1 of a file containing Base64 encoding of BER/DER data.
* *
* @param [in] fp File pointer to read from. * @param [in] fp File pointer to read from.
@ -279,6 +280,7 @@ static int PrintPem(FILE* fp, int pem_skip)
return ret; return ret;
} }
#endif
/* Usage lines to show. */ /* Usage lines to show. */
const char* usage[] = { const char* usage[] = {
@ -288,7 +290,9 @@ const char* usage[] = {
"Options:", "Options:",
" -?, --help display this help and exit", " -?, --help display this help and exit",
" -b, --branch draw branches before tag name", " -b, --branch draw branches before tag name",
#ifndef NO_CODING
" -B, --base64 file contents are Base64 encoded", " -B, --base64 file contents are Base64 encoded",
#endif
" -d, --dump show all ASN.1 item data as a hex dump", " -d, --dump show all ASN.1 item data as a hex dump",
" -h, --headers show all ASN.1 item headers as a hex dump", " -h, --headers show all ASN.1 item headers as a hex dump",
" -i, --indent indent tag name with depth", " -i, --indent indent tag name with depth",
@ -297,7 +301,9 @@ const char* usage[] = {
" -N, --no-dump-text do not show data as a hex dump text", " -N, --no-dump-text do not show data as a hex dump text",
" -o, --offset OFFSET start decoding from offset", " -o, --offset OFFSET start decoding from offset",
" -O, --oid show wolfSSL OID value in text", " -O, --oid show wolfSSL OID value in text",
#ifndef NO_CODING
" -p, --pem file contents are PEM", " -p, --pem file contents are PEM",
#endif
" -s, --skip-pem NUM number of PEM blocks to skip", " -s, --skip-pem NUM number of PEM blocks to skip",
}; };
/* Number of usage lines. */ /* Number of usage lines. */
@ -342,11 +348,13 @@ int main(int argc, char* argv[])
(strcmp(argv[0], "--branch") == 0)) { (strcmp(argv[0], "--branch") == 0)) {
wc_Asn1PrintOptions_Set(&opts, ASN1_PRINT_OPT_DRAW_BRANCH, 1); wc_Asn1PrintOptions_Set(&opts, ASN1_PRINT_OPT_DRAW_BRANCH, 1);
} }
#ifndef NO_CODING
/* File is Base64 encoded data. */ /* File is Base64 encoded data. */
else if ((strcmp(argv[0], "-b64") == 0) || else if ((strcmp(argv[0], "-b64") == 0) ||
(strcmp(argv[0], "--base64") == 0)) { (strcmp(argv[0], "--base64") == 0)) {
file_format = FORMAT_BASE64; file_format = FORMAT_BASE64;
} }
#endif
/* Dump all ASN.1 item data. */ /* Dump all ASN.1 item data. */
else if ((strcmp(argv[0], "-d") == 0) || else if ((strcmp(argv[0], "-d") == 0) ||
(strcmp(argv[0], "--dump") == 0)) { (strcmp(argv[0], "--dump") == 0)) {
@ -403,11 +411,13 @@ int main(int argc, char* argv[])
(strcmp(argv[0], "--oid") == 0)) { (strcmp(argv[0], "--oid") == 0)) {
wc_Asn1PrintOptions_Set(&opts, ASN1_PRINT_OPT_SHOW_OID, 1); wc_Asn1PrintOptions_Set(&opts, ASN1_PRINT_OPT_SHOW_OID, 1);
} }
#ifndef NO_CODING
/* File contains PEM blocks. */ /* File contains PEM blocks. */
else if ((strcmp(argv[0], "-p") == 0) || else if ((strcmp(argv[0], "-p") == 0) ||
(strcmp(argv[0], "--pem") == 0)) { (strcmp(argv[0], "--pem") == 0)) {
file_format = FORMAT_PEM; file_format = FORMAT_PEM;
} }
#endif
/* Skip a number of PEM blocks. */ /* Skip a number of PEM blocks. */
else if ((strcmp(argv[0], "-s") == 0) || else if ((strcmp(argv[0], "-s") == 0) ||
(strcmp(argv[0], "--skip-pem") == 0)) { (strcmp(argv[0], "--skip-pem") == 0)) {
@ -458,12 +468,16 @@ int main(int argc, char* argv[])
if (file_format == FORMAT_DER) { if (file_format == FORMAT_DER) {
ret = PrintDer(fp); ret = PrintDer(fp);
} }
#ifndef NO_CODING
else if (file_format == FORMAT_BASE64) { else if (file_format == FORMAT_BASE64) {
ret = PrintBase64(fp); ret = PrintBase64(fp);
} }
#endif
#ifndef NO_CODING
else if (file_format == FORMAT_PEM) { else if (file_format == FORMAT_PEM) {
ret = PrintPem(fp, pem_skip); ret = PrintPem(fp, pem_skip);
} }
#endif
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "%s\n", wc_GetErrorString(ret)); fprintf(stderr, "%s\n", wc_GetErrorString(ret));

View File

@ -21329,7 +21329,7 @@ static int set_curves_list(WOLFSSL* ssl, WOLFSSL_CTX *ctx, const char* names)
} }
#endif #endif
else { else {
#if !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST) #if !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST) && defined(HAVE_ECC)
int nret; int nret;
const ecc_set_type *eccSet; const ecc_set_type *eccSet;

View File

@ -4884,10 +4884,11 @@ WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_X509_OBJECT_get0_X509_CRL(WOLFSSL_X509_OBJ
WOLFSSL_API void wolfSSL_sk_X509_pop_free(WOLF_STACK_OF(WOLFSSL_X509)* sk, void (*f) (WOLFSSL_X509*)); WOLFSSL_API void wolfSSL_sk_X509_pop_free(WOLF_STACK_OF(WOLFSSL_X509)* sk, void (*f) (WOLFSSL_X509*));
#endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */ #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
#if (defined(OPENSSL_EXTRA) || defined(HAVE_CURL)) && defined(HAVE_ECC) #if (defined(OPENSSL_EXTRA) || defined(HAVE_CURL)) && (defined(HAVE_ECC) || \
defined(HAVE_CURVE25519) || defined(HAVE_CURVE448))
WOLFSSL_API int wolfSSL_CTX_set1_curves_list(WOLFSSL_CTX* ctx, const char* names); WOLFSSL_API int wolfSSL_CTX_set1_curves_list(WOLFSSL_CTX* ctx, const char* names);
WOLFSSL_API int wolfSSL_set1_curves_list(WOLFSSL* ssl, const char* names); WOLFSSL_API int wolfSSL_set1_curves_list(WOLFSSL* ssl, const char* names);
#endif /* (OPENSSL_EXTRA || HAVE_CURL) && HAVE_ECC */ #endif
#if defined(OPENSSL_ALL) || \ #if defined(OPENSSL_ALL) || \
defined(HAVE_STUNNEL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \ defined(HAVE_STUNNEL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \