Skip to content

Commit

Permalink
wolfssl/openssl/asn1.h: use macro for ASN1_BIT_STRING_FIRST_BYTE to a…
Browse files Browse the repository at this point in the history
…void non-const errors under gcc-6.5; tests/api.c: fix uninited data defect in test_wolfssl_EVP_chacha20_poly1305().
  • Loading branch information
douzzer committed Aug 22, 2024
1 parent e99bbf9 commit 166519a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -70719,6 +70719,9 @@ static int test_wolfssl_EVP_chacha20_poly1305(void)
EVP_CIPHER_CTX* ctx = NULL;
int outSz;

XMEMSET(key, 0, sizeof(key));
XMEMSET(iv, 0, sizeof(iv));

/* Encrypt. */
ExpectNotNull((ctx = EVP_CIPHER_CTX_new()));
ExpectIntEQ(EVP_EncryptInit_ex(ctx, EVP_chacha20_poly1305(), NULL, NULL,
Expand Down
3 changes: 1 addition & 2 deletions wolfssl/openssl/asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ struct WOLFSSL_ASN1_ITEM {
typedef struct WOLFSSL_ASN1_TEMPLATE WOLFSSL_ASN1_TEMPLATE;
typedef struct WOLFSSL_ASN1_ITEM WOLFSSL_ASN1_ITEM;

static WC_MAYBE_UNUSED const byte ASN1_BIT_STRING_FIRST_BYTE = ASN_BIT_STRING;

#define ASN1_BIT_STRING_FIRST_BYTE ASN_BIT_STRING
#define ASN1_TFLG_EXPLICIT (0x1 << 0)
#define ASN1_TFLG_SEQUENCE_OF (0x1 << 1)
#define ASN1_TFLG_IMPTAG (0x1 << 2)
Expand Down

0 comments on commit 166519a

Please sign in to comment.