openssl-additions 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openssl/ssh_pkey.rb +12 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f17b1fdc475af2152a362ab8227cedaae47c064fb89f664ae3a55992c825b1
|
4
|
+
data.tar.gz: dfce75b619ac474dbdccd3b67d2ec52c45562b15cbd5bc3b12c91f265cd41fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974ab05c0c237e47f2e4b5f06d22413425ac36eedbe5994d21bd4895240de20bc0698fadd56a7fb13edcde5e74321af0ba41c9f8c77e948136e60de5454f8d8c
|
7
|
+
data.tar.gz: 6dde9c594bbcca5ae3c53523deaa52aabd1c629d2a3df8749e1d9a1427153f89317e7f6c3f55f803602ec28472bb3ab0f0a182012b6c6d4934e01fa1dbea4356
|
data/lib/openssl/ssh_pkey.rb
CHANGED
@@ -59,21 +59,18 @@ module OpenSSL::PKey
|
|
59
59
|
when "ssh-rsa"
|
60
60
|
parts = ssh_key_lv_decode(rest, 6)
|
61
61
|
OpenSSL::PKey::RSA.new.tap do |k|
|
62
|
-
|
63
|
-
k.
|
64
|
-
|
65
|
-
k.
|
66
|
-
k.p = ssh_key_mpi_decode(parts[4])
|
67
|
-
k.q = ssh_key_mpi_decode(parts[5])
|
62
|
+
# n, e, d
|
63
|
+
k.set_key(ssh_key_mpi_decode(parts[0]), ssh_key_mpi_decode(parts[1]), ssh_key_mpi_decode(parts[2]))
|
64
|
+
# p, q
|
65
|
+
k.set_factors(ssh_key_mpi_decode(parts[4]), ssh_key_mpi_decode(parts[5]))
|
68
66
|
end
|
69
67
|
when "ssh-dss"
|
70
68
|
parts = ssh_key_lv_decode(rest, 5)
|
71
69
|
OpenSSL::PKey::DSA.new.tap do |k|
|
72
|
-
|
73
|
-
k.
|
74
|
-
|
75
|
-
k.
|
76
|
-
k.priv_key = ssh_key_mpi_decode(parts[4])
|
70
|
+
# Self-explanatory
|
71
|
+
k.set_pqg(ssh_key_mpi_decode(parts[0]), ssh_key_mpi_decode(parts[1]), ssh_key_mpi_decode(parts[2]))
|
72
|
+
# pub_key, priv_key
|
73
|
+
k.set_key(ssh_key_mpi_decode(parts[3]), ssh_key_mpi_decode(parts[4]))
|
77
74
|
end
|
78
75
|
when /ecdsa-sha2-/
|
79
76
|
parts = ssh_key_lv_decode(rest, 3)
|
@@ -197,14 +194,13 @@ module OpenSSL::PKey
|
|
197
194
|
case parts.first
|
198
195
|
when "ssh-rsa"
|
199
196
|
OpenSSL::PKey::RSA.new.tap do |k|
|
200
|
-
|
201
|
-
k.
|
197
|
+
# n, e
|
198
|
+
k.set_key(ssh_key_mpi_decode(parts[2]), ssh_key_mpi_decode(parts[1]), nil)
|
202
199
|
end
|
203
200
|
when "ssh-dss"
|
204
201
|
OpenSSL::PKey::DSA.new.tap do |k|
|
205
|
-
|
206
|
-
k.
|
207
|
-
k.g = ssh_key_mpi_decode(parts[3])
|
202
|
+
# Self-explanatory, one would hope
|
203
|
+
k.set_pqg(ssh_key_mpi_decode(parts[1]), ssh_key_mpi_decode(parts[2]), ssh_key_mpi_decode(parts[3]))
|
208
204
|
end
|
209
205
|
when /ecdsa-sha2-/
|
210
206
|
begin
|