@@ -1022,25 +1022,23 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_
10221022#define ASN1_STRING_cmp wolfSSL_ASN1_STRING_cmp
10231023#define ASN1_OCTET_STRING_cmp wolfSSL_ASN1_STRING_cmp
10241024#define ASN1_STRING_data wolfSSL_ASN1_STRING_data
1025- /* In OpenSSL, ASN1_INTEGER and ASN1_BIT_STRING are typedef aliases of
1026- * ASN1_STRING (same struct), so ASN1_STRING_length/get0_data work on all .
1025+ /* In OpenSSL, ASN1_INTEGER is a typedef alias of ASN1_STRING (same struct),
1026+ * so ASN1_STRING_length/get0_data work on ASN1_INTEGER* as well .
10271027 * In wolfSSL they are distinct structs, so dispatch by type using _Generic. */
10281028#if !defined(__cplusplus ) && defined(__STDC_VERSION__ ) && \
10291029 __STDC_VERSION__ >= 201112L
1030- #define ASN1_STRING_length (x ) _Generic((x), \
1031- WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get_length( \
1032- (const WOLFSSL_ASN1_INTEGER*)(x)), \
1033- const WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get_length( \
1034- (const WOLFSSL_ASN1_INTEGER*)(x)), \
1035- default: wolfSSL_ASN1_STRING_length( \
1036- (const WOLFSSL_ASN1_STRING*)(x)))
1037- #define ASN1_STRING_get0_data (x ) _Generic((x), \
1038- WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get0_data( \
1039- (const WOLFSSL_ASN1_INTEGER*)(x)), \
1040- const WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get0_data( \
1041- (const WOLFSSL_ASN1_INTEGER*)(x)), \
1042- default: wolfSSL_ASN1_STRING_get0_data( \
1043- (const WOLFSSL_ASN1_STRING*)(x)))
1030+ #define ASN1_STRING_length (x ) \
1031+ _Generic((x), \
1032+ WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get_length, \
1033+ const WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get_length, \
1034+ default: wolfSSL_ASN1_STRING_length \
1035+ )(x)
1036+ #define ASN1_STRING_get0_data (x ) \
1037+ _Generic((x), \
1038+ WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get0_data, \
1039+ const WOLFSSL_ASN1_INTEGER*: wolfSSL_ASN1_INTEGER_get0_data, \
1040+ default: wolfSSL_ASN1_STRING_get0_data \
1041+ )(x)
10441042#else
10451043#define ASN1_STRING_get0_data wolfSSL_ASN1_STRING_get0_data
10461044#define ASN1_STRING_length wolfSSL_ASN1_STRING_length
0 commit comments