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

Update RSA selftest code to use a 2048 bit RSA and only a single KAT

for PSS+SHA256
parent 49cb5e0b
Loading
Loading
Loading
Loading
+11 −9
Original line number Original line Diff line number Diff line
@@ -449,14 +449,20 @@ int fips_pkey_signature_test(EVP_PKEY *pkey,
		if (!esig)
		if (!esig)
			goto error;
			goto error;
		}
		}
#if 0
	else if (!EVP_SignFinal(&mctx, sig, &siglen, pkey))
		goto error;
#endif


	if (kat && ((siglen != katlen) || memcmp(kat, sig, katlen)))
	if (kat && ((siglen != katlen) || memcmp(kat, sig, katlen)))
		goto error;
		goto error;

#if 0
	{
	/* Debug code to print out self test KAT discrepancies */
	unsigned int i;
	fprintf(stderr, "%s=", fail_str);
	for (i = 0; i < siglen; i++)
			fprintf(stderr, "%02X", sig[i]);
	fprintf(stderr, "\n");
	goto error;
	}
#endif
	if (!FIPS_digestinit(&mctx, digest))
	if (!FIPS_digestinit(&mctx, digest))
		goto error;
		goto error;
	if (!FIPS_digestupdate(&mctx, tbs, tbslen))
	if (!FIPS_digestupdate(&mctx, tbs, tbslen))
@@ -474,10 +480,6 @@ int fips_pkey_signature_test(EVP_PKEY *pkey,
		{
		{
		ret = FIPS_ecdsa_verify_ctx(pkey->pkey.ec, &mctx, esig);
		ret = FIPS_ecdsa_verify_ctx(pkey->pkey.ec, &mctx, esig);
		}
		}
#if 0
	else
		ret = EVP_VerifyFinal(&mctx, sig, siglen, pkey);
#endif


	error:
	error:
	if (dsig != NULL)
	if (dsig != NULL)
+5 −1
Original line number Original line Diff line number Diff line
/* ====================================================================
/* ====================================================================
 * Copyright (c) 2003 The OpenSSL Project.  All rights reserved.
 * Copyright (c) 2011 The OpenSSL Project.  All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * modification, are permitted provided that the following conditions
@@ -54,6 +54,10 @@ extern "C" {
#endif
#endif


#define FIPS_MAX_CIPHER_TEST_SIZE	16
#define FIPS_MAX_CIPHER_TEST_SIZE	16
#define fips_load_key_component(key, comp, pre) \
	key->comp = BN_bin2bn(pre##_##comp, sizeof(pre##_##comp), key->comp); \
	if (!key->comp) \
		goto err


#ifdef  __cplusplus
#ifdef  __cplusplus
}
}
+156 −335

File changed.

Preview size limit exceeded, changes collapsed.