find openssl via PATH
There's no need to hardcode the full path to the openssl binary, and
this causes use headaches when trying to test, so do a PATH search so
the host code can control which openssl we actually run.
BUG=chromium-os:27683
TEST=`cros_run_unit_tests --board x86-alex -p update_engine` passed
Change-Id: Ic91768b37304ad284c6446091a25477a73015bd8
Reviewed-on: https://gerrit.chromium.org/gerrit/17896
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index b820ab8..f9c1648 100644
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -159,7 +159,7 @@
LOG(INFO) << "Generating a mismatched private key.";
ASSERT_EQ(0,
System(StringPrintf(
- "/usr/bin/openssl genrsa -out %s 2048",
+ "openssl genrsa -out %s 2048",
private_key_path.c_str())));
}
int signature_size = GetSignatureSize(private_key_path);
@@ -192,7 +192,7 @@
ScopedPathUnlinker sig_unlinker(sig_file);
ASSERT_EQ(0,
System(StringPrintf(
- "/usr/bin/openssl rsautl -raw -sign -inkey %s -in %s -out %s",
+ "openssl rsautl -raw -sign -inkey %s -in %s -out %s",
private_key_path.c_str(),
hash_file.c_str(),
sig_file.c_str())));
@@ -203,7 +203,7 @@
signature_test == kSignatureGeneratedShellRotateCl2) {
ASSERT_EQ(0,
System(StringPrintf(
- "/usr/bin/openssl rsautl -raw -sign -inkey %s -in %s -out %s",
+ "openssl rsautl -raw -sign -inkey %s -in %s -out %s",
kUnittestPrivateKey2Path,
hash_file.c_str(),
sig_file2.c_str())));
diff --git a/payload_signer.cc b/payload_signer.cc
index d8993d9..0feb1b6 100644
--- a/payload_signer.cc
+++ b/payload_signer.cc
@@ -159,7 +159,7 @@
// This runs on the server, so it's okay to cop out and call openssl
// executable rather than properly use the library
vector<string> cmd;
- base::SplitString("/usr/bin/openssl rsautl -raw -sign -inkey x -in x -out x",
+ base::SplitString("openssl rsautl -raw -sign -inkey x -in x -out x",
' ',
&cmd);
cmd[cmd.size() - 5] = private_key_path;