blob: 903d38daba4f462e2df83e850c32c7b84dcfaa50 [file] [log] [blame]
Randall Spanglere166d042014-05-13 09:24:52 -07001#!/bin/bash
2
3# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# Run tests for RSA Signature verification.
8
9# Load common constants and variables.
10. "$(dirname "$0")/common.sh"
11
12set -e
13
14return_code=0
15TEST_FILE=${TESTCASE_DIR}/test_file
16
17function test_signatures {
18 algorithmcounter=0
19 for keylen in ${key_lengths[@]}
20 do
21 for hashalgo in ${hash_algos[@]}
22 do
23 echo -e "For ${COL_YELLOW}RSA-$keylen and $hashalgo${COL_STOP}:"
Bill Richardson3e3790d2014-07-14 15:05:54 -070024 ${BIN_DIR}/verify_data $algorithmcounter \
Randall Spanglere166d042014-05-13 09:24:52 -070025 ${TESTKEY_DIR}/key_rsa${keylen}.keyb \
26 ${TEST_FILE}.rsa${keylen}_${hashalgo}.sig \
27 ${TEST_FILE}
28 if [ $? -ne 0 ]
29 then
30 return_code=255
31 fi
32 let algorithmcounter=algorithmcounter+1
33 done
34 done
35 echo -e "Peforming ${COL_YELLOW}PKCS #1 v1.5 Padding Tests${COL_STOP}..."
Randall Spangler6f1b82a2014-12-03 12:29:37 -080036 ${TEST_DIR}/vb20_rsa_padding_tests ${TESTKEY_DIR}/rsa_padding_test_pubkey.keyb
Randall Spanglere166d042014-05-13 09:24:52 -070037}
38
39check_test_keys
40echo "Testing signature verification..."
41test_signatures
42
43exit $return_code
44