aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-09 17:41:38 +0100
committerHans Nilsson <[email protected]>2017-03-09 17:41:38 +0100
commitce6040f651c081f4cb7dfafe5c4bf49bfee7812f (patch)
tree4b36debfa69c1e9c10289f5f68dc26560a365e00
parent219610ef3434e4462d8f9d8f9e22edda8424b327 (diff)
parentac29623c38bb07fcdacdf8a340a692314fb4b821 (diff)
downloadotp-ce6040f651c081f4cb7dfafe5c4bf49bfee7812f.tar.gz
otp-ce6040f651c081f4cb7dfafe5c4bf49bfee7812f.tar.bz2
otp-ce6040f651c081f4cb7dfafe5c4bf49bfee7812f.zip
Merge branch 'hans/public_key/generate_key_namedCurve_bug/OTP-14258'
-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,