mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 10:14:55 +00:00
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:
@@ -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
|
||||||
|
|||||||
@@ -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).
|
|
||||||
@@ -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_ */
|
|
||||||
@@ -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_ */
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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[] = {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user