test: Add 3072-byte key test case for rsa test

This is so that the unittest can be built for a board that actually
uses 3072-byte RSA in RW signature verification, and run on-device.
E.g. `build --BOARD=hatch_fp test-rsa`

BRANCH=none
BUG=b:169256204
TEST=make -j buildall
TEST=make BOARD=bloonchipper test-rsa3, flash to Dragonclaw,
     rwsig verify OK, test passes.

Change-Id: I1e67f05b76b53d96fe508832a94e9af5ad896d4d
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2429392
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
This commit is contained in:
Yicheng Li 2020-09-24 10:49:43 -07:00 committed by Commit Bot
parent 4b7410fc25
commit 6cd9c9b453
4 changed files with 184 additions and 5 deletions

View File

@ -12,7 +12,11 @@
#include "util.h"
#ifdef TEST_RSA3
#if CONFIG_RSA_KEY_SIZE == 3072
#include "rsa3072-3.h"
#else
#include "rsa2048-3.h"
#endif
#else
#include "rsa2048-F4.h"
#endif

138
test/rsa3072-3.h Normal file
View File

@ -0,0 +1,138 @@
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* RSA 3072 with 3 exponent public key and verification.
* Private key in rsa3072-3.pem.
*/
/* First generate a key:
* # openssl genrsa -3 -out key.pem 3072
* # openssl rsa -in key.pem -pubout > key.pub
* Then dump the key: sudo emerge vboot_reference
* # /usr/bin/dumpRSAPublicKey -pub key.pub | xxd -i
*/
const uint8_t rsa_data[] = {
0x60, 0x00, 0x00, 0x00, 0xdd, 0x54, 0xe6, 0xe2, 0x8b, 0xdc, 0xea, 0xd2,
0x58, 0x10, 0x72, 0xf1, 0x39, 0x2d, 0x10, 0x6e, 0x37, 0x4b, 0x19, 0x0d,
0x0a, 0x02, 0x80, 0xdc, 0xb9, 0xee, 0xb4, 0x6b, 0xb6, 0x19, 0x73, 0x22,
0x43, 0x09, 0x22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x01, 0xd6, 0xae, 0xc8, 0x94, 0xba,
0x35, 0x47, 0xa9, 0x77, 0x2b, 0x68, 0xd2, 0x75, 0x19, 0x75, 0x40, 0xce,
0x11, 0x93, 0xaa, 0xb9, 0x09, 0x37, 0x91, 0xca, 0x83, 0x3d, 0x7a, 0xb1,
0x03, 0x57, 0x34, 0x06, 0x37, 0x86, 0xf9, 0x64, 0xe4, 0xcf, 0x49, 0x0b,
0x20, 0x21, 0xda, 0x0a, 0x25, 0xd4, 0x17, 0x21, 0x73, 0x39, 0xf9, 0x2f,
0xeb, 0x81, 0x6f, 0x90, 0xea, 0x83, 0xfc, 0xc7, 0xe9, 0x44, 0xd1, 0xd2,
0x8b, 0xc5, 0xf3, 0x1f, 0x35, 0x1c, 0xc5, 0xa3, 0x75, 0x36, 0xb7, 0x84,
0xed, 0x67, 0xa0, 0xbd, 0xaf, 0x6b, 0x00, 0x15, 0x5a, 0x7c, 0x5c, 0xc7,
0x95, 0x22, 0x76, 0xd9, 0x9c, 0x1f, 0xf0, 0xb2, 0x6e, 0x5b, 0xcb, 0x32,
0x88, 0xa4, 0xc6, 0x7f, 0xfa, 0x2e, 0xc6, 0x40, 0x40, 0xa3, 0xe2, 0x57,
0xb7, 0x08, 0xe0, 0xe9, 0x93, 0x10, 0x95, 0x70, 0x2d, 0x90, 0x0c, 0xeb,
0x44, 0x50, 0xbc, 0xd9, 0xc7, 0xd5, 0x2b, 0x74, 0xac, 0x6e, 0x7f, 0xcf,
0xfa, 0x8c, 0xf6, 0x76, 0x77, 0x79, 0xf8, 0xf4, 0x11, 0x8e, 0x5a, 0xe4,
0x2c, 0xa2, 0x84, 0x56, 0xdb, 0x39, 0x54, 0x82, 0x8e, 0x85, 0x31, 0xc0,
0x51, 0xf7, 0x6c, 0x2c, 0x5f, 0xbc, 0x63, 0x5c, 0xf3, 0x68, 0x4e, 0xa4,
0x52, 0xc9, 0xe8, 0x06, 0xff, 0x94, 0xd3, 0xa1,
};
const struct rsa_public_key *rsa_key = (struct rsa_public_key *)rsa_data;
BUILD_ASSERT(sizeof(*rsa_key) == sizeof(rsa_data));
/* SHA-256 sum to verify:
* # sha256sum README.md | sed -e 's/\(..\)/0x\1, /mg'
*/
const uint8_t hash[] = { 0xc7, 0xc3, 0xd0, 0xa3, 0x7e, 0xbd, 0x50, 0xe8,
0x3c, 0xb3, 0x5b, 0xed, 0x02, 0xf9, 0x8f, 0x97,
0xf8, 0xb5, 0x23, 0x43, 0x74, 0xda, 0x0a, 0x24,
0xdb, 0x04, 0xe4, 0x1e, 0xbd, 0x43, 0x02, 0xdc };
/* Incorrect hash to test the negative case */
const uint8_t hash_wrong[] = { 0x61, 0x1b, 0xd2, 0x44, 0xc7, 0x18, 0xa7, 0x2d,
0x0f, 0x2d, 0x3d, 0x0f, 0xe3, 0xb3, 0xc5, 0xe4,
0x12, 0xc2, 0x7b, 0x1e, 0x05, 0x2c, 0x6f, 0xad,
0xc4, 0xac, 0x71, 0x55, 0xe8, 0x80, 0x5c, 0x38 };
/* Generate signature using openssl:
* openssl dgst -sha256 -sign test/rsa3072-3.pem README.md | xxd -i
*/
const uint8_t sig[] = {
0xb3, 0xac, 0xcb, 0x5c, 0xbc, 0x82, 0x74, 0x14, 0xce, 0x7d, 0xbd, 0x3b,
0xc6, 0x6e, 0x2d, 0x3e, 0xfd, 0xdb, 0x76, 0xb3, 0xfe, 0xed, 0x29, 0xd6,
0xb8, 0x20, 0x8a, 0x79, 0xf8, 0xe4, 0x1b, 0xc1, 0x99, 0x21, 0x77, 0xb0,
0xa7, 0x49, 0xfc, 0x31, 0x70, 0xe2, 0x5c, 0xc9, 0xc4, 0xc8, 0x5b, 0xbd,
0xf9, 0xc9, 0x81, 0x43, 0x7e, 0x16, 0x23, 0xc7, 0xb3, 0x8f, 0x95, 0xca,
0xb2, 0x56, 0x96, 0xfc, 0x53, 0xba, 0xf3, 0x77, 0x31, 0xde, 0x69, 0x9f,
0x2e, 0xb1, 0xc0, 0xe1, 0xb9, 0x05, 0x7a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 0x20, 0x30, 0x79, 0xf0, 0x4c, 0x09, 0xe2, 0x9a, 0x34, 0xc7, 0x07,
0xf7, 0x29, 0x3a, 0xcf, 0x38, 0x18, 0x2c, 0x53, 0x2f, 0x33, 0xca, 0x95,
0xfc, 0x3b, 0x23, 0x75, 0xbc, 0x15, 0xac, 0x1a, 0xbd, 0xf1, 0xa5, 0x6c,
0x3e, 0x4b, 0xc3, 0x39, 0xb2, 0x1e, 0x18, 0xf1, 0xb9, 0x28, 0xcd, 0x13,
0x05, 0x32, 0xd5, 0x46, 0x3e, 0x9b, 0x55, 0x9f, 0x13, 0xe3, 0x5d, 0x53,
0x6a, 0xa8, 0x93, 0x33, 0xbb, 0x78, 0x1d, 0x3a, 0xeb, 0xbd, 0x3d, 0x2e,
0xd1, 0xdc, 0x1c, 0xb6, 0x76, 0x6f, 0x29, 0x9f, 0x9f, 0x59, 0x23, 0x45,
0xcc, 0x80, 0x23, 0xd7, 0x51, 0x06, 0xc8, 0x72, 0x94, 0x3a, 0xf8, 0x14,
0x4d, 0x76, 0x2d, 0x59, 0x3c, 0xd7, 0x4e, 0x17, 0x52, 0xad, 0x1a, 0xe4,
0xa9, 0xfb, 0x09, 0xc8, 0xb4, 0x28, 0x0b, 0x7d, 0xa8, 0x0a, 0x71, 0x81,
/* Padding */
0x00
};

39
test/rsa3072-3.pem Normal file
View File

@ -0,0 +1,39 @@
-----BEGIN RSA PRIVATE KEY-----
MIIG4wIBAAKCAYEA1Jzb+OeqqkVkwgDD2PmKyi3Ng2JXst11OXfXc8X8tCE3lGfT
oxLQZtgBtC2L+Jal+yvnAgZRchi2bZ+nKCC1I1k15dgH+hEKje/Td1kJqTD9ypS3
D6lpdZ8/85M4jhtp5mW93hmCDIG8W/rOra/s69zmGeobYILrKXIEcHoBdpzSrdzQ
thJtwxCggTMEI5wzV/A9JLsYEeqq1x3zGMf9XPmqTxebuhQlkGEW7Tl4wXNYm7+R
DQ0SKMa2Jcede0bYkiI1om1T+Jii0xowGjjYSeP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@ enum sensor_id {
#ifdef TEST_RSA
#define CONFIG_RSA
#undef CONFIG_RSA_KEY_SIZE
#define CONFIG_RSA_KEY_SIZE 2048
#undef CONFIG_RSA_EXPONENT_3
#ifdef CONFIG_RSA_EXPONENT_3
#error Your board uses RSA exponent 3, please build rsa3 test instead!
#endif
#define CONFIG_RWSIG_TYPE_RWSIG
#endif
#ifdef TEST_RSA3
#define CONFIG_RSA
#undef CONFIG_RSA_KEY_SIZE
#define CONFIG_RSA_KEY_SIZE 2048
#define CONFIG_RSA_EXPONENT_3
#define CONFIG_RWSIG_TYPE_RWSIG
#endif