Commit a6311f85 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Remove several of the old obsolete FIPS_corrupt_*() functions.

parent ac892b7a
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -71,13 +71,6 @@
#include <openssl/fips.h>
#include <openssl/evp.h>

static int fips_dsa_pairwise_fail = 0;

void FIPS_corrupt_dsa_keygen(void)
	{
	fips_dsa_pairwise_fail = 1;
	}

static int fips_check_dsa(DSA *dsa)
	{
	EVP_PKEY pk;
@@ -159,8 +152,6 @@ static int dsa_builtin_keygen(DSA *dsa)
	dsa->priv_key=priv_key;
	dsa->pub_key=pub_key;
#ifdef OPENSSL_FIPS
	if (fips_dsa_pairwise_fail)
		BN_add_word(dsa->pub_key, 1);
	if(!fips_check_dsa(dsa))
		{
		dsa->pub_key = NULL;
+0 −9
Original line number Diff line number Diff line
@@ -236,13 +236,6 @@ int EC_KEY_up_ref(EC_KEY *r)

#include <openssl/evp.h>

static int fips_ec_pairwise_fail = 0;

void FIPS_corrupt_ec_keygen(void)
	{
	fips_ec_pairwise_fail = 1;
	}

static int fips_check_ec(EC_KEY *key)
	{
	EVP_PKEY pk;
@@ -311,8 +304,6 @@ int EC_KEY_generate_key(EC_KEY *eckey)
	eckey->pub_key  = pub_key;

#ifdef OPENSSL_FIPS
	if (fips_ec_pairwise_fail)
		BN_add_word(eckey->priv_key, 1);
	if(!fips_check_ec(eckey))
		{
		eckey->priv_key = NULL;
+0 −10
Original line number Diff line number Diff line
@@ -76,13 +76,6 @@
#include <openssl/fips.h>
#include <openssl/evp.h>

static int fips_rsa_pairwise_fail = 0;

void FIPS_corrupt_rsa_keygen(void)
	{
	fips_rsa_pairwise_fail = 1;
	}

int fips_check_rsa(RSA *rsa)
	{
	const unsigned char tbs[] = "RSA Pairwise Check Data";
@@ -290,9 +283,6 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
	if (!BN_mod_inverse(rsa->iqmp,rsa->q,p,ctx)) goto err;

#ifdef OPENSSL_FIPS
	if (fips_rsa_pairwise_fail)
		BN_add_word(rsa->n, 1);

	if(!fips_check_rsa(rsa))
	    goto err;
#endif
+3 −8
Original line number Diff line number Diff line
@@ -57,9 +57,9 @@
#ifdef OPENSSL_FIPS
static struct
    {
    unsigned char key[16];
    unsigned char plaintext[16];
    unsigned char ciphertext[16];
    const unsigned char key[16];
    const unsigned char plaintext[16];
    const unsigned char ciphertext[16];
    } tests[]=
	{
	{
@@ -72,11 +72,6 @@ static struct
	},
	};

void FIPS_corrupt_aes()
    {
    tests[0].key[0]++;
    }

int FIPS_selftest_aes()
    {
    int n;
+3 −29
Original line number Diff line number Diff line
@@ -59,30 +59,9 @@

static struct
    {
    unsigned char key[16];
    unsigned char plaintext[8];
    unsigned char ciphertext[8];
    } tests2[]=
	{
	{
	{ 0x7c,0x4f,0x6e,0xf7,0xa2,0x04,0x16,0xec,
	  0x0b,0x6b,0x7c,0x9e,0x5e,0x19,0xa7,0xc4 },
	{ 0x06,0xa7,0xd8,0x79,0xaa,0xce,0x69,0xef },
	{ 0x4c,0x11,0x17,0x55,0xbf,0xc4,0x4e,0xfd }
	},
	{
	{ 0x5d,0x9e,0x01,0xd3,0x25,0xc7,0x3e,0x34,
	  0x01,0x16,0x7c,0x85,0x23,0xdf,0xe0,0x68 },
	{ 0x9c,0x50,0x09,0x0f,0x5e,0x7d,0x69,0x7e },
	{ 0xd2,0x0b,0x18,0xdf,0xd9,0x0d,0x9e,0xff },
	}
	};

static struct
    {
    unsigned char key[24];
    unsigned char plaintext[8];
    unsigned char ciphertext[8];
    const unsigned char key[24];
    const unsigned char plaintext[8];
    const unsigned char ciphertext[8];
    } tests3[]=
	{
	{
@@ -101,11 +80,6 @@ static struct
	},
	};

void FIPS_corrupt_des()
    {
    tests2[0].plaintext[0]++;
    }

int FIPS_selftest_des()
    {
    int n, ret = 0;
Loading