summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMartin Sander <mrt.sander@gmail.com>2022-03-26 18:48:50 +0100
committerFlorian Wininger <fw.centrale@gmail.com>2022-04-12 14:14:54 +0200
commit89037977e9f80a7199f0ebfed27e515db4ea0f6a (patch)
tree5e03435de55ac6920b367de9ce1fc998a66e32e2 /lib
parent413d3aa3f1effab8636bad40a660ace34dc0aede (diff)
downloadnet-ssh-89037977e9f80a7199f0ebfed27e515db4ea0f6a.tar.gz
Read ecdsa private key in openssh format
Fixes #657.
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ssh/buffer.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/net/ssh/buffer.rb b/lib/net/ssh/buffer.rb
index b68d656..6ed5789 100644
--- a/lib/net/ssh/buffer.rb
+++ b/lib/net/ssh/buffer.rb
@@ -283,6 +283,12 @@ module Net
key.iqmp = iqmp
end
key
+ when /^ecdsa\-sha2\-(\w*)$/
+ key = OpenSSL::PKey::EC.read_keyblob($1, self)
+ key.private_key = read_bignum
+ _key_comment = read_string
+
+ key
else
raise Exception, "Cannot decode private key of type #{type}"
end