serverspec 2.39.2 → 2.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/type/x509_private_key.rb +3 -3
- data/lib/serverspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21b7e3d65fcdbc7880ab5f80e7c2dff85aa63af6
|
4
|
+
data.tar.gz: aa5ab7c63211633fecadc9e7743fdcc7e45a85aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 398ed88422cfed45ab3b500efc58bfac8d97ae2224ad4d76d6f8bc3198c4cda379e22e1bbf567d31d54b99092bb513577d5b2249f790b2b028ce9d87e3df73bc
|
7
|
+
data.tar.gz: 6404eb7895642dee7ffc928f8c81c963afc72e74033a8dfec3343e3c98b759dc8ece751c05dfc2b832e68eb5143062abafaedc847601ebe5c86b07315044fca6
|
@@ -3,8 +3,8 @@ require 'time'
|
|
3
3
|
module Serverspec::Type
|
4
4
|
class X509PrivateKey < Base
|
5
5
|
def valid?
|
6
|
-
runner_res = @runner.run_command("openssl rsa -in #{name} -check -noout")
|
7
|
-
( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' )
|
6
|
+
runner_res = @runner.run_command("echo | openssl rsa -in #{name} -check -noout -passin #{@options[:passin] || "stdin"}")
|
7
|
+
( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' ) && (!@options.has_key?(:passin) || encrypted?)
|
8
8
|
end
|
9
9
|
|
10
10
|
def encrypted?
|
@@ -13,7 +13,7 @@ module Serverspec::Type
|
|
13
13
|
|
14
14
|
def has_matching_certificate?(cert_file)
|
15
15
|
h1 = @runner.run_command("openssl x509 -noout -modulus -in #{cert_file}")
|
16
|
-
h2 = @runner.run_command("openssl rsa -noout -modulus -in #{name}")
|
16
|
+
h2 = @runner.run_command("echo | openssl rsa -noout -modulus -in #{name} -passin #{@options[:passin] || "stdin"}")
|
17
17
|
(h1.stdout == h2.stdout) && (h1.exit_status == 0) && (h2.exit_status == 0)
|
18
18
|
end
|
19
19
|
end
|
data/lib/serverspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|