Skip to content

Commit

Permalink
Merge pull request #552 from techraf/fixing_matching_certificate
Browse files Browse the repository at this point in the history
Removed piping results to shasum to avoid test passing incorrectly
  • Loading branch information
mizzy committed Jan 15, 2016
2 parents 069e104 + 48c0bda commit 3a76cc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/serverspec/type/x509_private_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a76cc1

Please sign in to comment.