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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10920ffce34b834bb124b16179b982676b4ef4f8
4
- data.tar.gz: 06c46faa9982034b45fa79214a72086a887f66d6
3
+ metadata.gz: 21b7e3d65fcdbc7880ab5f80e7c2dff85aa63af6
4
+ data.tar.gz: aa5ab7c63211633fecadc9e7743fdcc7e45a85aa
5
5
  SHA512:
6
- metadata.gz: 469c05ececc117cf1a6eb0bd69808618831da194dce32ced0d02d0667c8faad1407faa030f716f1add6b537ed6eca1a497babd5f8d1b4d70924b6ae2626b0eca
7
- data.tar.gz: 4ba911d145e22ad268d8922d79416574c331fb72c4340ab90800524e2fd316e84df7c72edd5a7fe2a08cbe53e226e71ad9d3cbb753b530882a096ad4d85e59ca
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
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.39.2"
2
+ VERSION = "2.40.0"
3
3
  end
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.39.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-04 00:00:00.000000000 Z
11
+ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec