Skip to content

Commit 643f9b7

Browse files
committed
Fix test for FIPS config
1 parent d5ff54e commit 643f9b7

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/api/test_x509.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ int test_x509_CertFromX509_akid_overflow(void)
532532
{
533533
size_t tbs_start = pos;
534534
size_t s;
535-
int i;
536535

537536
/* version [0] EXPLICIT INTEGER 2 (v3) */
538537
PUT1(0xA0); PUT1(0x03); PUT1(0x02); PUT1(0x01); PUT1(0x02);
@@ -593,7 +592,21 @@ int test_x509_CertFromX509_akid_overflow(void)
593592
WRAP(alg, 0x30);
594593
bs = pos;
595594
PUT1(0x00); PUT1(0x04);
596-
for (i = 0; i < 64; i++) PUT1(0x01);
595+
/* Use P-256 generator point (valid on-curve point) so that
596+
* builds with WOLFSSL_VALIDATE_ECC_IMPORT accept the key. */
597+
{
598+
static const unsigned char p256G[64] = {
599+
0x6B,0x17,0xD1,0xF2,0xE1,0x2C,0x42,0x47,
600+
0xF8,0xBC,0xE6,0xE5,0x63,0xA4,0x40,0xF2,
601+
0x77,0x03,0x7D,0x81,0x2D,0xEB,0x33,0xA0,
602+
0xF4,0xA1,0x39,0x45,0xD8,0x98,0xC2,0x96,
603+
0x4F,0xE3,0x42,0xE2,0xFE,0x1A,0x7F,0x9B,
604+
0x8E,0xE7,0xEB,0x4A,0x7C,0x0F,0x9E,0x16,
605+
0x2B,0xCE,0x33,0x57,0x6B,0x31,0x5E,0xCE,
606+
0xCB,0xB6,0x40,0x68,0x37,0xBF,0x51,0xF5
607+
};
608+
PUTN(p256G, sizeof(p256G));
609+
}
597610
WRAP(bs, 0x03);
598611
}
599612
WRAP(s, 0x30);

0 commit comments

Comments
 (0)