aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-06-13 14:54:18 +0200
committerHans Nilsson <[email protected]>2019-06-14 13:29:25 +0200
commita63823165c746beaa5e32698c5706e0feab312b2 (patch)
treedc7652ba88f87f625f7fad689c6ee5c2a54da383 /lib/crypto
parent3fd329fd8994f0bb7d544b46a0e6760bcac1ed48 (diff)
downloadotp-a63823165c746beaa5e32698c5706e0feab312b2.tar.gz
otp-a63823165c746beaa5e32698c5706e0feab312b2.tar.bz2
otp-a63823165c746beaa5e32698c5706e0feab312b2.zip
crypto: Adjust code for spec conflict
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/src/crypto.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 8ffdde2b90..169c0f2e91 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -1015,8 +1015,15 @@ crypto_dyn_iv_update(State, Data0, IV) ->
EncryptFlag :: boolean(),
Result :: binary() .
-crypto_one_time(Cipher, Key, Data, EncryptFlag) ->
- crypto_one_time(Cipher, Key, <<>>, Data, EncryptFlag).
+crypto_one_time(Cipher, Key, Data0, EncryptFlag) ->
+ case iolist_to_binary(Data0) of
+ <<>> ->
+ <<>>; % Known to fail on OpenSSL 0.9.8h
+ Data ->
+ ng_crypto_one_time_nif(Cipher,
+ iolist_to_binary(Key), <<>>, Data,
+ EncryptFlag)
+ end.
-spec crypto_one_time(Cipher, Key, IV, Data, EncryptFlag) ->
Result | descriptive_error()