acme-client 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 707a301d61e9dbf076d12f682ceda22ecdd8f0a7
4
- data.tar.gz: 18c0f857a97661a8574111a77189ef19742e4bd8
3
+ metadata.gz: c5269e4586e1ba3dfa359b635a0ae311bed2d5ee
4
+ data.tar.gz: 36eb213b6bb4f6fa4f940718acf89f7a080d3b8c
5
5
  SHA512:
6
- metadata.gz: 84178c175ff6152347899539146f6e471312592c71bb6ab2dab8a4e9e9cc63e4b631358836e1034a9a79db28498da3a1e52cc8d69b33765cd6c10b340935ef73
7
- data.tar.gz: 47518e58a5895d568f6d9b7a5d5473ae0e4681088927af97fba87feb5aa69cdb0c42c5e860a1c5950b70453b010afcacef8742cf1269fbc2eaa0dd1c43cfee78
6
+ metadata.gz: 39adb3b34f5eebfe7e718ef942270166a34844f50658698c800c112880f6485e65e7e08a6cba94b20c6ac613ea165df449a5118166f424e742c864c02998cd79
7
+ data.tar.gz: ad0eb8878dcea3eca909f88049d62aac40381727a51b521f8e06fa49b48195c552939adc8dcc28c0ec0e784267cc15cd147c6f87368a7c3922bc4622a5101672
@@ -5,8 +5,17 @@ require 'acme-client'
5
5
 
6
6
  version = Acme::Client::VERSION
7
7
 
8
+ def `(command)
9
+ puts super(command)
10
+
11
+ if $?.exitstatus > 0
12
+ fail("failed at: #{command}")
13
+ end
14
+ end
15
+
8
16
  `git add lib/acme/client/version.rb`
9
17
  `git commit -m "bump to #{version}"`
18
+ `git pull --rebase origin master`
10
19
  `git tag 'v#{version}'`
11
20
  `git push --tags origin master`
12
21
  `gem build acme-client.gemspec`
@@ -79,7 +79,15 @@ class Acme::Client::CertificateRequest
79
79
 
80
80
  def generate
81
81
  OpenSSL::X509::Request.new.tap do |csr|
82
- csr.public_key = @private_key.public_key
82
+ if @private_key.is_a?(OpenSSL::PKey::EC) && RbConfig::CONFIG['MAJOR'] == '2' &&
83
+ RbConfig::CONFIG['MINOR'].to_i < 4
84
+ # OpenSSL::PKey::EC does not respect classic PKey interface (as defined by
85
+ # PKey::RSA and PKey::DSA) until ruby 2.4.
86
+ # Supporting this interface needs monkey patching of OpenSSL:PKey::EC, or
87
+ # subclassing it. Here, use a subclass.
88
+ @private_key = ECKeyPatch.new(@private_key)
89
+ end
90
+ csr.public_key = @private_key
83
91
  csr.subject = generate_subject
84
92
  csr.version = 2
85
93
  add_extension(csr)
@@ -109,3 +117,5 @@ class Acme::Client::CertificateRequest
109
117
  )
110
118
  end
111
119
  end
120
+
121
+ require 'acme/client/certificate_request/ec_key_patch'
@@ -0,0 +1,5 @@
1
+ # Class to handle bug #
2
+ class Acme::Client::CertificateRequest::ECKeyPatch < OpenSSL::PKey::EC
3
+ alias private? private_key?
4
+ alias public? public_key?
5
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Acme
4
4
  class Client
5
- VERSION = '0.5.4'.freeze
5
+ VERSION = '0.5.5'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acme-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Barbier
@@ -147,6 +147,7 @@ files:
147
147
  - lib/acme/client.rb
148
148
  - lib/acme/client/certificate.rb
149
149
  - lib/acme/client/certificate_request.rb
150
+ - lib/acme/client/certificate_request/ec_key_patch.rb
150
151
  - lib/acme/client/crypto.rb
151
152
  - lib/acme/client/error.rb
152
153
  - lib/acme/client/faraday_middleware.rb