aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_file.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-10-13 09:21:02 +0200
committerHans Nilsson <[email protected]>2015-10-16 12:38:25 +0200
commit01d1e4dc9a6e7ea958683ab419dea38bf576a39f (patch)
treee61b19cd3e59a2f71f8060fd23b569d1f0480eaa /lib/ssh/src/ssh_file.erl
parentba49561cf3e2167acd5457de93b05e772f2fb16a (diff)
downloadotp-01d1e4dc9a6e7ea958683ab419dea38bf576a39f.tar.gz
otp-01d1e4dc9a6e7ea958683ab419dea38bf576a39f.tar.bz2
otp-01d1e4dc9a6e7ea958683ab419dea38bf576a39f.zip
ssh, public_key: Change EC Public Key representation to what was intended
Diffstat (limited to 'lib/ssh/src/ssh_file.erl')
-rw-r--r--lib/ssh/src/ssh_file.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl
index 4e6d58cbff..c087ce14d7 100644
--- a/lib/ssh/src/ssh_file.erl
+++ b/lib/ssh/src/ssh_file.erl
@@ -276,12 +276,13 @@ key_match(#'RSAPublicKey'{}, 'ssh-rsa') ->
true;
key_match({_, #'Dss-Parms'{}}, 'ssh-dss') ->
true;
-key_match({#'ECPoint'{},<<"nistp256">>}, 'ecdsa-sha2-nistp256') ->
- true;
-key_match({#'ECPoint'{},<<"nistp384">>}, 'ecdsa-sha2-nistp384') ->
- true;
-key_match({#'ECPoint'{},<<"nistp521">>}, 'ecdsa-sha2-nistp521') ->
- true;
+key_match({#'ECPoint'{},{namedCurve,Curve}}, Alg) ->
+ case atom_to_list(Alg) of
+ "ecdsa-sha2-"++IdS ->
+ Curve == public_key:ssh_curvename2oid(list_to_binary(IdS));
+ _ ->
+ false
+ end;
key_match(_, _) ->
false.