easyrsa 0.8.9 → 0.9.0

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: 7fa9cf5b884cc68b84ff21e52db1eaaafbb69b15
4
- data.tar.gz: dd908e243b962cced5a44ec18a495500593318d5
3
+ metadata.gz: a4f50650da31006752f7576b6a88f5dfc81bad51
4
+ data.tar.gz: 3bf1c9fcc5a2990421bba0d946ef27362966a8d5
5
5
  SHA512:
6
- metadata.gz: 14ea6fd8fdcfd844a899fa780dddde3dddffd404d7ef67eed87b8e0c8fa7d72987f42cdef25c644532b46bdf47ac560387173ccd6e1a806f5cf860b894d6afdc
7
- data.tar.gz: 26efe7bb691969445ba2b1cb5d9d88babac9769bca72d60690813445e8c6f39541a3931d85fea72dd273fc84238715bd2b18a176068ad06084bb076f831e3957
6
+ metadata.gz: 56d791565ebcf487aaedd3c60c28e568b5f306b71ed21987cb87e210d232f39061be0093d1a32222c1d4f8750be55aa57bc006b3e4309d8619b8274853686fd2
7
+ data.tar.gz: ce70a1553c80fb0b8bcbb35cb4d6b16667206d3c075ae2dc4facdce2f6d40ca80394278d895e31f6d4464a3973f09dd31d7b529e7fe4ff3938aed30ef89df3c8
@@ -40,11 +40,15 @@ module EasyRSA
40
40
 
41
41
  # Get cert details if it's in a file
42
42
  unless cakey.is_a? OpenSSL::PKey::RSA
43
- begin
44
- cakey = OpenSSL::PKey::RSA.new File.read cakey
45
- rescue OpenSSL::PKey::RSAError => e
46
- fail EasyRSA::Revoke::InvalidCARootPrivateKey,
47
- 'This is not a valid Private key file.'
43
+ if cakey.include?('BEGIN RSA PRIVATE KEY')
44
+ cakey = OpenSSL::PKey::RSA.new cakey
45
+ else
46
+ begin
47
+ cakey = OpenSSL::PKey::RSA.new File.read cakey
48
+ rescue OpenSSL::PKey::RSAError => e
49
+ fail EasyRSA::Revoke::InvalidCARootPrivateKey,
50
+ 'This is not a valid Private key file.'
51
+ end
48
52
  end
49
53
  end
50
54
 
@@ -1,3 +1,3 @@
1
1
  module EasyRSA
2
- VERSION = '0.8.9'
2
+ VERSION = '0.9.0'
3
3
  end
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), '..', 'spec_helper')
3
3
  describe EasyRSA::Config, 'Should' do
4
4
  include_context "shared environment"
5
5
 
6
- it 'throw error when missing required configure parameters' do
6
+ it 'should throw error when missing required configure parameters' do
7
7
 
8
8
  expect {
9
9
  EasyRSA.configure do |issuer|
@@ -17,7 +17,7 @@ describe EasyRSA::Config, 'Should' do
17
17
 
18
18
  end
19
19
 
20
- it 'configure correctly' do
20
+ it 'should configure correctly in block format' do
21
21
 
22
22
  expect {
23
23
  EasyRSA.configure do |issuer|
@@ -32,4 +32,18 @@ describe EasyRSA::Config, 'Should' do
32
32
 
33
33
  end
34
34
 
35
+ it 'should configure correctly when in hash form' do
36
+
37
+ expect {
38
+ config = { email: @email,
39
+ server: @server,
40
+ country: @country,
41
+ city: @city,
42
+ company: @company,
43
+ orgunit: @orgunit }
44
+ EasyRSA::Config.from_hash config
45
+ }.not_to raise_error
46
+
47
+ end
48
+
35
49
  end
@@ -98,4 +98,15 @@ CERT
98
98
  expect(existing_crl).to_not eql(crl.to_pem)
99
99
  end
100
100
 
101
+ it 'should successfully revoke with key in OpenSSL::PKey::RSA format' do
102
+
103
+ easyrsa = EasyRSA::Certificate.new(@ca_cert, @ca_key, 'mike', 'mike@ruby-easyrsa.gem')
104
+ g = easyrsa.generate
105
+
106
+ r = EasyRSA::Revoke.new g[:crt]
107
+ crl = r.revoke! OpenSSL::PKey::RSA.new File.read @ca_key
108
+
109
+ expect(crl.to_pem).to include('BEGIN X509 CRL')
110
+ end
111
+
101
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyrsa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Mackintosh