Skip to content

Commit e45af82

Browse files
Fix AEAD tests.
SKEY_SUPPORT is not defined for the test sources, use an OpenSSL macro instead. Moreover, tokens may support only a subset of AEAD algorithms, so skip algorithms that are not available. Signed-off-by: Ilie Halip <ilie.halip@nxp.com>
1 parent f9d9b1c commit e45af82

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/taead

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ title PARA "Test AEAD support"
3030

3131
for alg in "${ALGORITHMS[@]}"; do
3232
echo "Checking algorithm $alg"
33-
$CHECKER "${TESTBLDDIR}/taead" "$alg" "$KEY" "$IV" "$AAD" "$DATA"
33+
if $OPENSSL list -cipher-algorithms 2>/dev/null | grep -q "$alg"; then
34+
title PARA "Run AEAD test with $alg"
35+
$CHECKER "${TESTBLDDIR}/taead" "$alg" "$KEY" "$IV" "$AAD" "$DATA"
36+
else
37+
title PARA "Skipping AEAD test with $alg"
38+
fi
3439
done
3540

3641
echo "PASSED"

tests/taead.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <openssl/core_names.h>
1313
#include "util.h"
1414

15-
#if SKEY_SUPPORT == 1
15+
#if defined(OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT)
1616

1717
#define MAX_DATA_LEN 1024
1818

0 commit comments

Comments
 (0)