summaryrefslogtreecommitdiff
path: root/tests/vboot_common3_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vboot_common3_tests.c')
-rw-r--r--tests/vboot_common3_tests.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/vboot_common3_tests.c b/tests/vboot_common3_tests.c
index 1eba971c..b68c3dc5 100644
--- a/tests/vboot_common3_tests.c
+++ b/tests/vboot_common3_tests.c
@@ -30,14 +30,17 @@ static void ReChecksumKeyBlock(VbKeyBlockHeader *h)
}
static void KeyBlockVerifyTest(const VbPublicKey *public_key,
- const VbPrivateKey *private_key,
- const VbPublicKey *data_key)
+ const struct vb2_private_key *private_key,
+ const struct vb2_packed_key *data_key)
{
VbKeyBlockHeader *hdr;
VbKeyBlockHeader *h;
unsigned hsize;
- hdr = KeyBlockCreate(data_key, private_key, 0x1234);
+ hdr = (VbKeyBlockHeader *)
+ vb2_create_keyblock((struct vb2_packed_key *)data_key,
+ private_key,
+ 0x1234);
TEST_NEQ((size_t)hdr, 0, "KeyBlockVerify() prerequisites");
if (!hdr)
return;
@@ -162,9 +165,7 @@ int test_permutation(int signing_key_algorithm, int data_key_algorithm,
int signing_rsa_len = siglen_map[signing_key_algorithm] * 8;
int data_rsa_len = siglen_map[data_key_algorithm] * 8;
- VbPrivateKey *signing_private_key = NULL;
VbPublicKey *signing_public_key = NULL;
- VbPublicKey *data_public_key = NULL;
printf("***Testing signing algorithm: %s\n",
algo_strings[signing_key_algorithm]);
@@ -172,8 +173,8 @@ int test_permutation(int signing_key_algorithm, int data_key_algorithm,
algo_strings[data_key_algorithm]);
sprintf(filename, "%s/key_rsa%d.pem", keys_dir, signing_rsa_len);
- signing_private_key = PrivateKeyReadPem(filename,
- signing_key_algorithm);
+ struct vb2_private_key *signing_private_key =
+ vb2_read_private_key_pem(filename, signing_key_algorithm);
if (!signing_private_key) {
fprintf(stderr, "Error reading signing_private_key: %s\n",
filename);
@@ -190,8 +191,8 @@ int test_permutation(int signing_key_algorithm, int data_key_algorithm,
}
sprintf(filename, "%s/key_rsa%d.keyb", keys_dir, data_rsa_len);
- data_public_key = PublicKeyReadKeyb(filename,
- data_key_algorithm, 1);
+ struct vb2_packed_key *data_public_key = (struct vb2_packed_key *)
+ PublicKeyReadKeyb(filename, data_key_algorithm, 1);
if (!data_public_key) {
fprintf(stderr, "Error reading data_public_key: %s\n",
filename);