Skip to content

Commit 2b1cde5

Browse files
committed
Fix test for FIPS config
1 parent 3893fd3 commit 2b1cde5

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
@@ -731,7 +731,6 @@ int test_x509_CertFromX509_akid_overflow(void)
731731
{
732732
size_t tbs_start = pos;
733733
size_t s;
734-
int i;
735734

736735
/* version [0] EXPLICIT INTEGER 2 (v3) */
737736
PUT1(0xA0); PUT1(0x03); PUT1(0x02); PUT1(0x01); PUT1(0x02);
@@ -792,7 +791,21 @@ int test_x509_CertFromX509_akid_overflow(void)
792791
WRAP(alg, 0x30);
793792
bs = pos;
794793
PUT1(0x00); PUT1(0x04);
795-
for (i = 0; i < 64; i++) PUT1(0x01);
794+
/* Use P-256 generator point (valid on-curve point) so that
795+
* builds with WOLFSSL_VALIDATE_ECC_IMPORT accept the key. */
796+
{
797+
static const unsigned char p256G[64] = {
798+
0x6B,0x17,0xD1,0xF2,0xE1,0x2C,0x42,0x47,
799+
0xF8,0xBC,0xE6,0xE5,0x63,0xA4,0x40,0xF2,
800+
0x77,0x03,0x7D,0x81,0x2D,0xEB,0x33,0xA0,
801+
0xF4,0xA1,0x39,0x45,0xD8,0x98,0xC2,0x96,
802+
0x4F,0xE3,0x42,0xE2,0xFE,0x1A,0x7F,0x9B,
803+
0x8E,0xE7,0xEB,0x4A,0x7C,0x0F,0x9E,0x16,
804+
0x2B,0xCE,0x33,0x57,0x6B,0x31,0x5E,0xCE,
805+
0xCB,0xB6,0x40,0x68,0x37,0xBF,0x51,0xF5
806+
};
807+
PUTN(p256G, sizeof(p256G));
808+
}
796809
WRAP(bs, 0x03);
797810
}
798811
WRAP(s, 0x30);

0 commit comments

Comments
 (0)