aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/src/public_key.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-04-24 09:24:02 +0200
committerIngela Anderton Andin <[email protected]>2013-05-08 10:39:20 +0200
commit8537e256d5bb250f6e798d521deef16907a4e526 (patch)
treeabe3c8eb549152a8c6d3a3251f31151e45bd3135 /lib/public_key/src/public_key.erl
parente05c31eaa6b4f09ac220bf88d78376d7ef8722d7 (diff)
downloadotp-8537e256d5bb250f6e798d521deef16907a4e526.tar.gz
otp-8537e256d5bb250f6e798d521deef16907a4e526.tar.bz2
otp-8537e256d5bb250f6e798d521deef16907a4e526.zip
public_key: use new crypto
Diffstat (limited to 'lib/public_key/src/public_key.erl')
-rw-r--r--lib/public_key/src/public_key.erl12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index b11a225761..ee5c5e8552 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -331,7 +331,7 @@ encrypt_private(PlainText,
%%--------------------------------------------------------------------
generate_key({curve, Name}) ->
Term = crypto:ecdh_generate_key(Name),
- ec_key(Term);
+ ec_key(Term, Name);
generate_key(#'DHParameter'{prime = P, base = G}) ->
crypto:dh_generate_key([crypto:mpint(P), crypto:mpint(G)]);
@@ -916,19 +916,13 @@ ec_curve_spec( #'OTPECParameters'{fieldID = FieldId, curve = PCurve, base = Base
ec_curve_spec({namedCurve, OID}) ->
pubkey_cert_records:namedCurves(OID).
-ec_key({Curve, PrivateKey, PubKey}) when is_atom(Curve) ->
- #'ECPrivateKey'{version = 1,
- privateKey = int2list(PrivateKey),
- parameters = {namedCurve, pubkey_cert_records:namedCurves(Curve)},
- publicKey = {0, PubKey}}.
-
-ec_key({Curve, PrivateKey, PubKey}, _Params) when is_atom(Curve) ->
+ec_key({PrivateKey, PubKey}, Curve) when is_atom(Curve) ->
#'ECPrivateKey'{version = 1,
privateKey = int2list(PrivateKey),
parameters = {namedCurve, pubkey_cert_records:namedCurves(Curve)},
publicKey = {0, PubKey}};
-ec_key({_Curve, PrivateKey, PubKey}, Params) ->
+ec_key({PrivateKey, PubKey}, Params) ->
#'ECPrivateKey'{version = 1,
privateKey = int2list(PrivateKey),
parameters = Params,