mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-22 03:53:02 -05:00
OpenSSL: Add TEST_FAIL() checks to allow error path testing
This makes it easier to test various error paths related to key derivation and authentication steps. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
fd8f443247
commit
8fd1d6236d
@ -69,6 +69,9 @@ static int openssl_digest_vector(const EVP_MD *type, size_t num_elem,
|
|||||||
size_t i;
|
size_t i;
|
||||||
unsigned int mac_len;
|
unsigned int mac_len;
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
EVP_MD_CTX_init(&ctx);
|
EVP_MD_CTX_init(&ctx);
|
||||||
if (!EVP_DigestInit_ex(&ctx, type, NULL)) {
|
if (!EVP_DigestInit_ex(&ctx, type, NULL)) {
|
||||||
wpa_printf(MSG_ERROR, "OpenSSL: EVP_DigestInit_ex failed: %s",
|
wpa_printf(MSG_ERROR, "OpenSSL: EVP_DigestInit_ex failed: %s",
|
||||||
@ -771,6 +774,9 @@ static int openssl_hmac_vector(const EVP_MD *type, const u8 *key,
|
|||||||
size_t i;
|
size_t i;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
HMAC_CTX_init(&ctx);
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x00909000
|
#if OPENSSL_VERSION_NUMBER < 0x00909000
|
||||||
HMAC_Init_ex(&ctx, key, key_len, type, NULL);
|
HMAC_Init_ex(&ctx, key, key_len, type, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user