diff options
author | Ingela Anderton Andin <[email protected]> | 2013-04-25 11:04:36 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-05-08 10:39:21 +0200 |
commit | dad86c51e920d015da390ec6bef3da24924fa063 (patch) | |
tree | d68c8fc8b025b725b7f5ee048d56bb1e82e68fe2 /lib/crypto/src | |
parent | 7bbfc0d715d2023cc27a7819c108d47ab812b89e (diff) | |
download | otp-dad86c51e920d015da390ec6bef3da24924fa063.tar.gz otp-dad86c51e920d015da390ec6bef3da24924fa063.tar.bz2 otp-dad86c51e920d015da390ec6bef3da24924fa063.zip |
ssl, public_key, crypto: General generate_key and compute_key functions
Diffstat (limited to 'lib/crypto/src')
-rw-r--r-- | lib/crypto/src/crypto.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 76e4ac620c..43ea1d48fd 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -1140,7 +1140,7 @@ generate_key(Type, Params) -> generate_key(Type, Params, undefined). generate_key(dh, DHParameters, PrivateKey) -> - dh_generate_key_nif(PrivateKey, DHParameters, 0); + dh_generate_key_nif(PrivateKey, map_ensure_int_as_bin(DHParameters), 0); generate_key(srp, {host, [Verifier, Generator, Prime, Version]}, PrivArg) when is_binary(Verifier), is_binary(Generator), is_binary(Prime), is_atom(Version) -> @@ -1166,7 +1166,7 @@ ec_key_generate(_Key) -> ?nif_stub. compute_key(dh, OthersPublicKey, MyPrivateKey, DHParameters) -> - case dh_compute_key_nif(OthersPublicKey,MyPrivateKey,DHParameters) of + case dh_compute_key_nif(OthersPublicKey,MyPrivateKey, map_ensure_int_as_bin(DHParameters)) of error -> erlang:error(computation_failed, [OthersPublicKey,MyPrivateKey,DHParameters]); Ret -> Ret |