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

Unified Diff: src/platform/vboot_reference/tests/run_tests.sh

Issue 552227: Utility to output digests in format suitable for RSA signatures. (Closed)
Patch Set: Nit fixes. Created 10 years, 11 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 | « src/platform/vboot_reference/tests/Makefile ('k') | src/platform/vboot_reference/tests/signature_digest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/tests/run_tests.sh
diff --git a/src/platform/vboot_reference/tests/run_tests.sh b/src/platform/vboot_reference/tests/run_tests.sh
index bfde0a20fdcd004c12947d6d18c431d6da598b3b..7fe68fe09813c0bd87c312ff44264e3391756ffc 100755
--- a/src/platform/vboot_reference/tests/run_tests.sh
+++ b/src/platform/vboot_reference/tests/run_tests.sh
@@ -28,32 +28,32 @@ function generate_keys {
# Generate public key signatures on an input file for various combinations
# of message digest algorithms and RSA key sizes.
function generate_signatures {
- for i in ${hash_algos[@]}
+ algorithmcounter=0
+ for keylen in ${key_lengths[@]}
do
- for j in ${key_lengths[@]}
+ for hashalgo in ${hash_algos[@]}
do
- openssl dgst -binary -$i $1 >$1.digest.$i
- openssl pkeyutl -in $1.digest.$i -inkey key_rsa$j.pem \
- -pkeyopt digest:$i > $1.rsa$j\_$i.sig
+ ./signature_digest $algorithmcounter $1 | openssl rsautl -sign -pkcs \
+ -inkey key_rsa${keylen}.pem > $1.rsa${keylen}\_${hashalgo}.sig
+ let algorithmcounter=algorithmcounter+1
done
done
}
function test_signatures {
algorithmcounter=0
- for rsaalgo in ${key_lengths[@]}
+ for keylen in ${key_lengths[@]}
do
for hashalgo in ${hash_algos[@]}
do
- echo "For RSA-$rsaalgo and $hashalgo:"
- ./verify_data $algorithmcounter key_rsa${rsaalgo}.keyb \
- ${TEST_FILE}.rsa${rsaalgo}_${hashalgo}.sig ${TEST_FILE}
+ echo "For RSA-$keylen and $hashalgo:"
+ ./verify_data $algorithmcounter key_rsa${keylen}.keyb \
+ ${TEST_FILE}.rsa${keylen}\_${hashalgo}.sig ${TEST_FILE}
let algorithmcounter=algorithmcounter+1
done
done
}
-
function pre_work {
# Generate a file with random bytes for signature tests.
echo "Generating test file..."
@@ -65,7 +65,7 @@ function pre_work {
}
function cleanup {
- rm ${TEST_FILE} ${TEST_FILE}.digest.* ${TEST_FILE}.*.sig key_rsa*.*
+ rm ${TEST_FILE} ${TEST_FILE}.*.sig key_rsa*.*
}
echo "Testing message digests..."
« no previous file with comments | « src/platform/vboot_reference/tests/Makefile ('k') | src/platform/vboot_reference/tests/signature_digest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698