From 48c0bda2571795ea465f0a5bd016067702460c7d Mon Sep 17 00:00:00 2001 From: techraf Date: Fri, 15 Jan 2016 07:38:16 +0900 Subject: [PATCH] Removed piping results to shasum to avoid test passing incorrectly --- lib/serverspec/type/x509_private_key.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/serverspec/type/x509_private_key.rb b/lib/serverspec/type/x509_private_key.rb index 402049e3..1bb95686 100644 --- a/lib/serverspec/type/x509_private_key.rb +++ b/lib/serverspec/type/x509_private_key.rb @@ -12,9 +12,8 @@ def encrypted? end def has_matching_certificate?(cert_file) - mac_op = "openssl sha -sha512" - h1 = @runner.run_command("openssl x509 -noout -modulus -in #{cert_file} | #{mac_op}") - h2 = @runner.run_command("openssl rsa -noout -modulus -in #{name} | #{mac_op}") + h1 = @runner.run_command("openssl x509 -noout -modulus -in #{cert_file}") + h2 = @runner.run_command("openssl rsa -noout -modulus -in #{name}") (h1.stdout == h2.stdout) && (h1.exit_status == 0) && (h2.exit_status == 0) end end