Skip to content

Commit 569a96f

Browse files
committed
Fix for C++ compilers
1 parent 22d7550 commit 569a96f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/api.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21261,11 +21261,7 @@ static int generate_crl_test(const char* keyFile, const char* certFile,
2126121261
.length = sizeof(serialsToRevokeBytes[2]),
2126221262
.type = 0 }
2126321263
};
21264-
WOLFSSL_X509_REVOKED revoked[3] = {
21265-
{ .serialNumber = &serialsToRevoke[0], .reason = CRL_REASON_NONE },
21266-
{ .serialNumber = &serialsToRevoke[1], .reason = CRL_REASON_NONE },
21267-
{ .serialNumber = &serialsToRevoke[2], .reason = CRL_REASON_NONE }
21268-
};
21264+
WOLFSSL_X509_REVOKED revoked[3];
2126921265
WOLFSSL_X509* certToRevoke = NULL;
2127021266

2127121267
/* Load certificate to get issuer name (CRL issuer = cert subject) */
@@ -21295,6 +21291,12 @@ static int generate_crl_test(const char* keyFile, const char* certFile,
2129521291
ExpectIntEQ(wolfSSL_X509_CRL_set_nextUpdate(crl, &asnTime),
2129621292
WOLFSSL_SUCCESS);
2129721293

21294+
XMEMSET(revoked, 0, sizeof(revoked));
21295+
for (i = 0; i < numSerials; i++) {
21296+
revoked[i].serialNumber = &serialsToRevoke[i];
21297+
revoked[i].reason = CRL_REASON_NONE;
21298+
}
21299+
2129821300
/* Add revoked certificates based on serial numbers */
2129921301
for (i = 0; i < numSerials; i++) {
2130021302
ExpectIntEQ(wolfSSL_X509_CRL_add_revoked(crl, &revoked[i]),
@@ -21512,7 +21514,7 @@ static int test_wolfSSL_X509_CRL_sign_large(void)
2151221514
WOLFSSL_X509_CRL* crl = NULL;
2151321515
WOLFSSL_EVP_PKEY* pkey = NULL;
2151421516
WOLFSSL_ASN1_TIME asnTime;
21515-
WOLFSSL_X509_REVOKED revoked = {0};
21517+
WOLFSSL_X509_REVOKED revoked;
2151621518
XFILE fp = XBADFILE;
2151721519
int i;
2151821520
byte serial[4];

0 commit comments

Comments
 (0)