aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-08 12:42:08 +0100
committerHans Nilsson <[email protected]>2017-03-09 16:46:25 +0100
commitac29623c38bb07fcdacdf8a340a692314fb4b821 (patch)
tree4b36debfa69c1e9c10289f5f68dc26560a365e00 /lib/public_key
parent219610ef3434e4462d8f9d8f9e22edda8424b327 (diff)
downloadotp-ac29623c38bb07fcdacdf8a340a692314fb4b821.tar.gz
otp-ac29623c38bb07fcdacdf8a340a692314fb4b821.tar.bz2
otp-ac29623c38bb07fcdacdf8a340a692314fb4b821.zip
public_key: Bugfix public_key:generate_key({namedCurve,OID})
Diffstat (limited to 'lib/public_key')
-rw-r--r--lib/public_key/src/public_key.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 50d4d82d15..95202282fb 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -1198,8 +1198,11 @@ ec_curve_spec( #'ECParameters'{fieldID = FieldId, curve = PCurve, base = Base, o
FieldId#'FieldID'.parameters},
Curve = {PCurve#'Curve'.a, PCurve#'Curve'.b, none},
{Field, Curve, Base, Order, CoFactor};
-ec_curve_spec({namedCurve, OID}) ->
- pubkey_cert_records:namedCurves(OID).
+ec_curve_spec({namedCurve, OID}) when is_tuple(OID), is_integer(element(1,OID)) ->
+ ec_curve_spec({namedCurve, pubkey_cert_records:namedCurves(OID)});
+ec_curve_spec({namedCurve, Name}) when is_atom(Name) ->
+ crypto:ec_curve(Name).
+
ec_key({PubKey, PrivateKey}, Params) ->
#'ECPrivateKey'{version = 1,