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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openssl/ssh_pkey.rb +12 -16
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2919b9f7c9b0a1a2166bcb5bd1e7273f7ac23b9efc05473c2a6ef4647b4b24d
4
- data.tar.gz: cf8c7640fde294f77a01643a68d4befb4511db17d6f6fa38c37100de04d59c25
3
+ metadata.gz: 33f17b1fdc475af2152a362ab8227cedaae47c064fb89f664ae3a55992c825b1
4
+ data.tar.gz: dfce75b619ac474dbdccd3b67d2ec52c45562b15cbd5bc3b12c91f265cd41fe1
5
5
  SHA512:
6
- metadata.gz: 92dbce64ce5e27996a9cbe3208fba4a62e3a36da5a3cf4188942bfe7e77c4e9509f0692b226962341d7e15a7532e48072481115be3b9e502b36c41a7166eba6c
7
- data.tar.gz: add7918b67e7e5e369a89a0231bb32d775434244d11e0daac325330e4adbdeca9606efec686f308c79a1d38b236775766ca7299a406a8b69a0847acd7a00c4f2
6
+ metadata.gz: 974ab05c0c237e47f2e4b5f06d22413425ac36eedbe5994d21bd4895240de20bc0698fadd56a7fb13edcde5e74321af0ba41c9f8c77e948136e60de5454f8d8c
7
+ data.tar.gz: 6dde9c594bbcca5ae3c53523deaa52aabd1c629d2a3df8749e1d9a1427153f89317e7f6c3f55f803602ec28472bb3ab0f0a182012b6c6d4934e01fa1dbea4356
@@ -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
- k.n = ssh_key_mpi_decode(parts[0])
63
- k.e = ssh_key_mpi_decode(parts[1])
64
- k.d = ssh_key_mpi_decode(parts[2])
65
- k.iqmp = ssh_key_mpi_decode(parts[3])
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
- k.p = ssh_key_mpi_decode(parts[0])
73
- k.q = ssh_key_mpi_decode(parts[1])
74
- k.g = ssh_key_mpi_decode(parts[2])
75
- k.pub_key = ssh_key_mpi_decode(parts[3])
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
- k.e = ssh_key_mpi_decode(parts[1])
201
- k.n = ssh_key_mpi_decode(parts[2])
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
- k.p = ssh_key_mpi_decode(parts[1])
206
- k.q = ssh_key_mpi_decode(parts[2])
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openssl-additions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer