aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-04-24 11:12:40 +0200
committerIngela Anderton Andin <[email protected]>2018-07-10 16:21:38 +0200
commitdd8d31fdeb3237deddfe2c5cccebf13fb97d7719 (patch)
tree00f4d44fb1cff2124bb499e576333f415d780463 /lib
parentb12f1e98e32ebb38b4f53e1284bc17350ffbdfed (diff)
downloadotp-dd8d31fdeb3237deddfe2c5cccebf13fb97d7719.tar.gz
otp-dd8d31fdeb3237deddfe2c5cccebf13fb97d7719.tar.bz2
otp-dd8d31fdeb3237deddfe2c5cccebf13fb97d7719.zip
ssl: Fix ECDSA key decode clause
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/src/ssl_config.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_config.erl b/lib/ssl/src/ssl_config.erl
index 022fb7eac0..452a98e683 100644
--- a/lib/ssl/src/ssl_config.erl
+++ b/lib/ssl/src/ssl_config.erl
@@ -132,7 +132,13 @@ private_key(#'PrivateKeyInfo'{privateKeyAlgorithm =
#'PrivateKeyInfo_privateKeyAlgorithm'{algorithm = ?'id-dsa'},
privateKey = Key}) ->
public_key:der_decode('DSAPrivateKey', iolist_to_binary(Key));
-
+private_key(#'PrivateKeyInfo'{privateKeyAlgorithm =
+ #'PrivateKeyInfo_privateKeyAlgorithm'{algorithm = ?'id-ecPublicKey',
+ parameters = {asn1_OPENTYPE, Parameters}},
+ privateKey = Key}) ->
+ ECKey = public_key:der_decode('ECPrivateKey', iolist_to_binary(Key)),
+ ECParameters = public_key:der_decode('EcpkParameters', Parameters),
+ ECKey#'ECPrivateKey'{parameters = ECParameters};
private_key(Key) ->
Key.