X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=fips%2Fdsa%2Ffips_dsa_selftest.c;h=131f3040252f0accd21a9b2ce84d6dfa23f83897;hp=9646ae93dae0ef37d4e14bf6973983e0f983de39;hb=3335b6f265f727dc7ac6606abfa021f5223cb31b;hpb=4bd1e895faa35a8d4810402fe3ba9d07c1166908 diff --git a/fips/dsa/fips_dsa_selftest.c b/fips/dsa/fips_dsa_selftest.c index 9646ae93da..131f304025 100644 --- a/fips/dsa/fips_dsa_selftest.c +++ b/fips/dsa/fips_dsa_selftest.c @@ -60,6 +60,7 @@ #ifdef OPENSSL_FIPS +__fips_constseg static const unsigned char dsa_test_2048_p[] = { 0xa8,0x53,0x78,0xd8,0xfd,0x3f,0x8d,0x72,0xec,0x74,0x18,0x08, 0x0d,0xa2,0x13,0x17,0xe4,0x3e,0xc4,0xb6,0x2b,0xa8,0xc8,0x62, @@ -84,11 +85,13 @@ static const unsigned char dsa_test_2048_p[] = { 0x2c,0x8d,0x74,0x69,0xdb,0x02,0xe2,0x4d,0x59,0x23,0x94,0xa7, 0xdb,0xa0,0x69,0xe9 }; -static unsigned char dsa_test_2048_q[] = { +__fips_constseg +static const unsigned char dsa_test_2048_q[] = { 0xd2,0x77,0x04,0x4e,0x50,0xf5,0xa4,0xe3,0xf5,0x10,0xa5,0x0a, 0x0b,0x84,0xfd,0xff,0xbc,0xa0,0x47,0xed,0x27,0x60,0x20,0x56, 0x74,0x41,0xa0,0xa5 }; +__fips_constseg static const unsigned char dsa_test_2048_g[] = { 0x13,0xd7,0x54,0xe2,0x1f,0xd2,0x41,0x65,0x5d,0xa8,0x91,0xc5, 0x22,0xa6,0x5a,0x72,0xa8,0x9b,0xdc,0x64,0xec,0x9b,0x54,0xa8, @@ -114,6 +117,7 @@ static const unsigned char dsa_test_2048_g[] = { 0xb3,0xc2,0xa9,0x66 }; +__fips_constseg static const unsigned char dsa_test_2048_pub_key[] = { 0x24,0x52,0xf3,0xcc,0xbe,0x9e,0xd5,0xca,0x7d,0xc7,0x4c,0x60, 0x2b,0x99,0x22,0x6e,0x8f,0x2f,0xab,0x38,0xe7,0xd7,0xdd,0xfb, @@ -138,17 +142,13 @@ static const unsigned char dsa_test_2048_pub_key[] = { 0x0a,0xcb,0x67,0x37,0x17,0xa0,0xd2,0xfb,0x3b,0x50,0xc8,0x93, 0xf7,0xda,0xb1,0x4f }; +__fips_constseg static const unsigned char dsa_test_2048_priv_key[] = { 0x0c,0x4b,0x30,0x89,0xd1,0xb8,0x62,0xcb,0x3c,0x43,0x64,0x91, 0xf0,0x91,0x54,0x70,0xc5,0x27,0x96,0xe3,0xac,0xbe,0xe8,0x00, 0xec,0x55,0xf6,0xcc }; -void FIPS_corrupt_dsa() - { - ++dsa_test_2048_q[0]; - } - int FIPS_selftest_dsa() { DSA *dsa=NULL; @@ -169,7 +169,7 @@ int FIPS_selftest_dsa() pk.type = EVP_PKEY_DSA; pk.pkey.dsa = dsa; - if (!fips_pkey_signature_test(&pk, NULL, 0, + if (!fips_pkey_signature_test(FIPS_TEST_SIGNATURE, &pk, NULL, 0, NULL, 0, EVP_sha384(), 0, "DSA SHA384")) goto err;