aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/src
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-12-01 14:50:17 +0100
committerHans Nilsson <[email protected]>2017-12-01 14:50:17 +0100
commit16937d18834798ab77e0f2aaa302a3ef384639ae (patch)
tree9fd36e6b9cfc963c02d1356ddc6c7f719cb58242 /lib/crypto/src
parenteb065a0daadfcdc2bd0bc124ebb81175010b1b39 (diff)
parentcba4dc777a3b870985d0a925c7b4e827468a4bb2 (diff)
downloadotp-16937d18834798ab77e0f2aaa302a3ef384639ae.tar.gz
otp-16937d18834798ab77e0f2aaa302a3ef384639ae.tar.bz2
otp-16937d18834798ab77e0f2aaa302a3ef384639ae.zip
Merge branch 'maint'
* maint: crypto: engine_SUITE update crypto: fix pubkey_to_privkey
Diffstat (limited to 'lib/crypto/src')
-rw-r--r--lib/crypto/src/crypto.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 91e154280f..541a15e7a9 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -1100,9 +1100,17 @@ ec_curve(X) ->
privkey_to_pubkey(Alg, EngineMap) when Alg == rsa; Alg == dss; Alg == ecdsa ->
- case notsup_to_error(privkey_to_pubkey_nif(Alg, format_pkey(Alg,EngineMap))) of
+ try privkey_to_pubkey_nif(Alg, format_pkey(Alg,EngineMap))
+ of
[_|_]=L -> map_ensure_bin_as_int(L);
X -> X
+ catch
+ error:badarg when Alg==ecdsa ->
+ {error, notsup};
+ error:badarg ->
+ {error, not_found};
+ error:notsup ->
+ {error, notsup}
end.
privkey_to_pubkey_nif(_Alg, _EngineMap) -> ?nif_stub.