Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: delta_performer_unittest.cc

Issue 6771024: AU: Switch to 2048 bit RSA keys; Pad SHA256 hashes appropriately. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: remove debug log statement Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « delta_performer.cc ('k') | payload_signer.h » ('j') | payload_signer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_performer_unittest.cc
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index 586d582c92dbeef69f70217f9ef3c5e2d488d746..0c2d9b9a1dd25c56c65c34c10508ecd21725ebd8 100755
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -149,7 +149,7 @@ void SignGeneratedShellPayload(SignatureTest signature_test,
LOG(INFO) << "Generating a mismatched private key.";
ASSERT_EQ(0,
System(StringPrintf(
- "/usr/bin/openssl genrsa -out %s 1024",
+ "/usr/bin/openssl genrsa -out %s 2048",
private_key_path.c_str())));
}
int signature_size = GetSignatureSize(private_key_path);
@@ -164,12 +164,18 @@ void SignGeneratedShellPayload(SignatureTest signature_test,
signature_size,
hash_file.c_str())));
+ // Pad the hash
+ vector<char> hash;
+ ASSERT_TRUE(utils::ReadFile(hash_file, &hash));
+ ASSERT_TRUE(PayloadSigner::PadRSA2048SHA256Hash(&hash));
+ ASSERT_TRUE(WriteFileVector(hash_file, hash));
+
string sig_file;
ASSERT_TRUE(utils::MakeTempFile("/tmp/signature.XXXXXX", &sig_file, NULL));
ScopedPathUnlinker sig_unlinker(sig_file);
ASSERT_EQ(0,
System(StringPrintf(
- "/usr/bin/openssl rsautl -pkcs -sign -inkey %s -in %s -out %s",
+ "/usr/bin/openssl rsautl -raw -sign -inkey %s -in %s -out %s",
private_key_path.c_str(),
hash_file.c_str(),
sig_file.c_str())));
« no previous file with comments | « delta_performer.cc ('k') | payload_signer.h » ('j') | payload_signer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698