[DRE-commits] [ruby-serverspec] 05/09: New upstream version 2.40.0
Daisuke Higuchi
dai at moszumanska.debian.org
Sun Aug 13 02:41:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
dai pushed a commit to branch master
in repository ruby-serverspec.
commit 5d11b506e8552de112e2dadb5b0f0693f8da6364
Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
Date: Sun Aug 13 11:28:57 2017 +0900
New upstream version 2.40.0
---
lib/serverspec/type/x509_private_key.rb | 8 ++++----
lib/serverspec/version.rb | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/serverspec/type/x509_private_key.rb b/lib/serverspec/type/x509_private_key.rb
index 1bb9568..bbeab2d 100644
--- a/lib/serverspec/type/x509_private_key.rb
+++ b/lib/serverspec/type/x509_private_key.rb
@@ -3,17 +3,17 @@ require 'time'
module Serverspec::Type
class X509PrivateKey < Base
def valid?
- runner_res = @runner.run_command("openssl rsa -in #{name} -check -noout")
- ( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' )
+ runner_res = @runner.run_command("echo | openssl rsa -in #{name} -check -noout -passin #{@options[:passin] || "stdin"}")
+ ( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' ) && (!@options.has_key?(:passin) || encrypted?)
end
def encrypted?
- @runner.run_command("grep -wq \"^Proc-Type.*ENCRYPTED$\" #{name}").exit_status == 0
+ @runner.run_command("grep -Ewq \"^(Proc-Type.*ENCRYPTED|-----BEGIN ENCRYPTED PRIVATE KEY-----)$\" #{name}").exit_status == 0
end
def has_matching_certificate?(cert_file)
h1 = @runner.run_command("openssl x509 -noout -modulus -in #{cert_file}")
- h2 = @runner.run_command("openssl rsa -noout -modulus -in #{name}")
+ h2 = @runner.run_command("echo | openssl rsa -noout -modulus -in #{name} -passin #{@options[:passin] || "stdin"}")
(h1.stdout == h2.stdout) && (h1.exit_status == 0) && (h2.exit_status == 0)
end
end
diff --git a/lib/serverspec/version.rb b/lib/serverspec/version.rb
index 47e97d1..d501097 100644
--- a/lib/serverspec/version.rb
+++ b/lib/serverspec/version.rb
@@ -1,3 +1,3 @@
module Serverspec
- VERSION = "2.39.1"
+ VERSION = "2.40.0"
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-serverspec.git
More information about the Pkg-ruby-extras-commits
mailing list