vboot: Remove the remainder of vb1 cryptolib

At this point, all that's left are a few constants in the cryptolib
header files, and they're only used by host-side code.  So move them to
a host-side header file and get rid of cryptolib.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; emerge-kevin coreboot depthcharge

Change-Id: I2235f0e84e13fef313afe54e749b73744b157884
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400903
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Randall Spangler
2016-10-18 13:55:19 -07:00
parent 46a382d613
commit 13c0776aab
32 changed files with 15 additions and 72 deletions

View File

@@ -28,7 +28,6 @@
#include "2sha.h" #include "2sha.h"
#include "cgpt.h" #include "cgpt.h"
#include "cgpt_nor.h" #include "cgpt_nor.h"
#include "cryptolib.h"
#include "file_keys.h" #include "file_keys.h"
// Check if cmdline |argv| has "-D". "-D" signifies that GPT structs are stored // Check if cmdline |argv| has "-D". "-D" signifies that GPT structs are stored

View File

@@ -1,3 +0,0 @@
This contains the implementation for the crypto library. This includes
implementations for SHA1, SHA256, SHA512, and RSA signature verification
(for PKCS #1 v1.5 signatures).

View File

@@ -1,13 +0,0 @@
/* Copyright (c) 2010 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.
*
* Firmware Cryptolib includes.
*/
#ifndef VBOOT_REFERENCE_CRYPTOLIB_H_
#define VBOOT_REFERENCE_CRYPTOLIB_H_
#include "rsa.h"
#endif /* VBOOT_REFERENCE_CRYPTOLIB_H_ */

View File

@@ -1,20 +0,0 @@
/* Copyright (c) 2010 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.
*/
#ifndef VBOOT_REFERENCE_RSA_H_
#define VBOOT_REFERENCE_RSA_H_
#ifndef VBOOT_REFERENCE_CRYPTOLIB_H_
#error "Do not include this file directly. Use cryptolib.h instead."
#endif
#include "sysincludes.h"
#define RSA1024NUMBYTES 128 /* 1024 bit key length */
#define RSA2048NUMBYTES 256 /* 2048 bit key length */
#define RSA4096NUMBYTES 512 /* 4096 bit key length */
#define RSA8192NUMBYTES 1024 /* 8192 bit key length */
#endif /* VBOOT_REFERENCE_RSA_H_ */

View File

@@ -8,7 +8,6 @@
#ifndef VBOOT_REFERENCE_VBOOT_COMMON_H_ #ifndef VBOOT_REFERENCE_VBOOT_COMMON_H_
#define VBOOT_REFERENCE_VBOOT_COMMON_H_ #define VBOOT_REFERENCE_VBOOT_COMMON_H_
#include "cryptolib.h"
#include "vboot_struct.h" #include "vboot_struct.h"
#ifndef ARRAY_SIZE #ifndef ARRAY_SIZE

View File

@@ -16,7 +16,6 @@
#include "2api.h" #include "2api.h"
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "cryptolib.h"
#include "futility.h" #include "futility.h"
#include "host_common.h" #include "host_common.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -12,8 +12,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "cryptolib.h"
#include "futility.h" #include "futility.h"
#include "host_common.h" #include "host_common.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -14,7 +14,6 @@
#include "2sysincludes.h" #include "2sysincludes.h"
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "cryptolib.h"
#include "futility.h" #include "futility.h"
#include "host_common.h" #include "host_common.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -18,7 +18,6 @@
#include "2sysincludes.h" #include "2sysincludes.h"
#include "2common.h" #include "2common.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "futility.h" #include "futility.h"
#include "gbb_header.h" #include "gbb_header.h"

View File

@@ -17,7 +17,6 @@
#include "2common.h" #include "2common.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "file_keys.h" #include "file_keys.h"
#include "host_common.h" #include "host_common.h"
#include "signature_digest.h" #include "signature_digest.h"

View File

@@ -12,7 +12,6 @@
#include "2rsa.h" #include "2rsa.h"
#include "host_common.h" #include "host_common.h"
#include "host_key2.h" #include "host_key2.h"
#include "cryptolib.h"
#include "utility.h" #include "utility.h"
#include "vb2_common.h" #include "vb2_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -17,9 +17,7 @@
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "host_key.h"
#include "host_misc.h" #include "host_misc.h"
#include "vb2_common.h" #include "vb2_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -17,7 +17,6 @@
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "host_key.h" #include "host_key.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -13,7 +13,6 @@
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "host_key.h" #include "host_key.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -12,7 +12,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -18,7 +18,6 @@
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "file_keys.h" #include "file_keys.h"
#include "host_common.h" #include "host_common.h"
#include "host_key2.h" #include "host_key2.h"

View File

@@ -8,7 +8,6 @@
#ifndef VBOOT_REFERENCE_FILE_KEYS_H_ #ifndef VBOOT_REFERENCE_FILE_KEYS_H_
#define VBOOT_REFERENCE_FILE_KEYS_H_ #define VBOOT_REFERENCE_FILE_KEYS_H_
#include "cryptolib.h"
#include "2sha.h" #include "2sha.h"
/* Calculates the appropriate digest for the data in [input_file] based on the /* Calculates the appropriate digest for the data in [input_file] based on the

View File

@@ -14,7 +14,6 @@
*/ */
#define _STUB_IMPLEMENTATION_ #define _STUB_IMPLEMENTATION_
#include "cryptolib.h"
#include "host_key.h" #include "host_key.h"
#include "host_key2.h" #include "host_key2.h"
#include "host_keyblock.h" #include "host_keyblock.h"

View File

@@ -8,7 +8,6 @@
#ifndef VBOOT_REFERENCE_HOST_SIGNATURE_H_ #ifndef VBOOT_REFERENCE_HOST_SIGNATURE_H_
#define VBOOT_REFERENCE_HOST_SIGNATURE_H_ #define VBOOT_REFERENCE_HOST_SIGNATURE_H_
#include "cryptolib.h"
#include "host_key.h" #include "host_key.h"
#include "utility.h" #include "utility.h"
#include "vboot_struct.h" #include "vboot_struct.h"

View File

@@ -14,7 +14,6 @@
#include "2common.h" #include "2common.h"
#include "2rsa.h" #include "2rsa.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "host_signature2.h" #include "host_signature2.h"
#include "signature_digest.h" #include "signature_digest.h"

View File

@@ -17,7 +17,6 @@
#include "2common.h" #include "2common.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "util_misc.h" #include "util_misc.h"
#include "vb2_common.h" #include "vb2_common.h"

View File

@@ -12,7 +12,10 @@
#ifndef VBOOT_REFERENCE_RSA_PADDING_TEST_H_ #ifndef VBOOT_REFERENCE_RSA_PADDING_TEST_H_
#define VBOOT_REFERENCE_RSA_PADDING_TEST_H_ #define VBOOT_REFERENCE_RSA_PADDING_TEST_H_
#include "cryptolib.h" #define RSA1024NUMBYTES 128 /* 1024 bit key length */
#define RSA2048NUMBYTES 256 /* 2048 bit key length */
#define RSA4096NUMBYTES 512 /* 4096 bit key length */
#define RSA8192NUMBYTES 1024 /* 8192 bit key length */
/* The modulus of the public key (RSA-1024). */ /* The modulus of the public key (RSA-1024). */
static const uint8_t pubkey_n[] = { static const uint8_t pubkey_n[] = {

View File

@@ -10,8 +10,6 @@
#include "2sysincludes.h" #include "2sysincludes.h"
#include "2common.h" #include "2common.h"
#include "2sha.h" #include "2sha.h"
#include "cryptolib.h"
#include "host_common.h" #include "host_common.h"
#include "timer_utils.h" #include "timer_utils.h"

View File

@@ -10,7 +10,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "cryptolib.h"
#include "sha_test_vectors.h" #include "sha_test_vectors.h"
int SHA1_tests(void) { int SHA1_tests(void) {

View File

@@ -5,15 +5,11 @@
* Common functions used by tests. * Common functions used by tests.
*/ */
#include "test_common.h"
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "cryptolib.h" #include "test_common.h"
#include "file_keys.h"
#include "utility.h"
/* Global test success flag. */ /* Global test success flag. */
int gTestSuccess = 1; int gTestSuccess = 1;

View File

@@ -9,7 +9,6 @@
#define _STUB_IMPLEMENTATION_ #define _STUB_IMPLEMENTATION_
#include "cryptolib.h"
#include "file_keys.h" #include "file_keys.h"
#include "rsa_padding_test.h" #include "rsa_padding_test.h"
#include "test_common.h" #include "test_common.h"

View File

@@ -10,6 +10,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "2sysincludes.h"
#include "test_common.h" #include "test_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -9,16 +9,16 @@
#define _STUB_IMPLEMENTATION_ #define _STUB_IMPLEMENTATION_
#include "cryptolib.h" #include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "file_keys.h" #include "file_keys.h"
#include "rsa_padding_test.h" #include "rsa_padding_test.h"
#include "test_common.h" #include "test_common.h"
#include "utility.h" #include "utility.h"
#include "vboot_api.h" #include "vboot_api.h"
#include "2common.h"
#include "2rsa.h"
/* /*
* Internal functions from 2rsa.c that have error conditions we can't trigger * Internal functions from 2rsa.c that have error conditions we can't trigger
* from the public APIs. These include checks for bad algorithms where the * from the public APIs. These include checks for bad algorithms where the

View File

@@ -10,6 +10,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "2sysincludes.h"
#include "test_common.h" #include "test_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -10,6 +10,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "2sysincludes.h"
#include "test_common.h" #include "test_common.h"
#include "vboot_common.h" #include "vboot_common.h"

View File

@@ -16,7 +16,6 @@
#include "cgptlib.h" #include "cgptlib.h"
#include "cgptlib_internal.h" #include "cgptlib_internal.h"
#include "crc32.h" #include "crc32.h"
#include "cryptolib.h"
#include "gbb_header.h" #include "gbb_header.h"
#include "gpt.h" #include "gpt.h"
#include "host_common.h" #include "host_common.h"

View File

@@ -22,7 +22,6 @@
#include "2common.h" #include "2common.h"
#include "2sha.h" #include "2sha.h"
#include "2rsa.h" #include "2rsa.h"
#include "cryptolib.h"
#include "file_keys.h" #include "file_keys.h"
#include "host_common.h" #include "host_common.h"
#include "vb2_common.h" #include "vb2_common.h"