aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2016-09-23 11:46:17 +0100
committerMagnus Henoch <[email protected]>2016-09-28 15:09:42 +0100
commitb6c83354ac6c3d37dd5f9891932302e4104606eb (patch)
tree76c23d6d8a2ff88cb9cac237e21cf4e46f762518 /lib/crypto/test
parent96cc0088baa6bba5eb018897dd9bd095a5ac70db (diff)
downloadotp-b6c83354ac6c3d37dd5f9891932302e4104606eb.tar.gz
otp-b6c83354ac6c3d37dd5f9891932302e4104606eb.tar.bz2
otp-b6c83354ac6c3d37dd5f9891932302e4104606eb.zip
Fix aes_gcm test case in crypto_SUITE
In one of the test cases, the IV is 8 bytes. In FIPS mode, the minimum allowed IV length is 12 bytes, so let's skip that test case.
Diffstat (limited to 'lib/crypto/test')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index ab4aa76b93..0c3b7a0445 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -385,7 +385,20 @@ aead() ->
aead(Config) when is_list(Config) ->
AEADs = lazy_eval(proplists:get_value(aead, Config)),
- lists:foreach(fun aead_cipher/1, AEADs).
+ FilteredAEADs =
+ case proplists:get_bool(fips, Config) of
+ false ->
+ AEADs;
+ true ->
+ %% In FIPS mode, the IV length must be at least 12 bytes.
+ lists:filter(
+ fun(Tuple) ->
+ IVLen = byte_size(element(4, Tuple)),
+ IVLen >= 12
+ end, AEADs)
+ end,
+
+ lists:foreach(fun aead_cipher/1, FilteredAEADs).
%%--------------------------------------------------------------------
sign_verify() ->