diff options
author | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-11-28 18:50:11 +0100 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-11-30 10:26:37 +0000 |
commit | aea00f496b1cf41fd5b568b4c6079c2ab76eafd4 (patch) | |
tree | a42e9c303964a884ae0ffb8218d2b3cf8696d212 /util/broadcom/secimage/crypto.c | |
parent | 48418757cb48a08d0e0d4db25a950ba74b77b21e (diff) | |
download | coreboot-aea00f496b1cf41fd5b568b4c6079c2ab76eafd4.tar.xz |
broadcom: Remove SoC and board support
The reason for this code cleanup is the legacy
Google Purin board which isn't available anymore
and AFAIK never made it into the stores.
* Remove broadcom cygnus SoC support
* Remove /util/broadcom tool
* Remove Google Purin mainboard
* Remove MAINTAINERS entries
Change-Id: I148dd7eb0192d396cb69bc26c4062f88a764771a
Signed-off-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/29905
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/broadcom/secimage/crypto.c')
-rw-r--r-- | util/broadcom/secimage/crypto.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/util/broadcom/secimage/crypto.c b/util/broadcom/secimage/crypto.c deleted file mode 100644 index 2fe52b68cf..0000000000 --- a/util/broadcom/secimage/crypto.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2015 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include <stdio.h> -#include <string.h> -#include <stdint.h> -#include "secimage.h" -#include <openssl/hmac.h> - -/*---------------------------------------------------------------------- - * Name : HmacSha256Hash - * Purpose : - * Input : none - * Output : none - *---------------------------------------------------------------------*/ -int HmacSha256Hash(uint8_t *data, uint32_t len, uint8_t *hash, uint8_t *key) -{ - unsigned int hash_len = 0; - - if (!HMAC(EVP_sha256(), key, 32, data, len, hash, &hash_len)) { - printf("HMAC failed\n"); - return -1; - } else if (hash_len != 32) { - printf("HMAC reported unexpected md_len of %u\n", hash_len); - return -2; - } - - return 0; -} - -/*---------------------------------------------------------------------- - * Name : AppendHMACSignature - * Purpose : Appends HMAC signature at the end of the data - *---------------------------------------------------------------------*/ -int AppendHMACSignature(uint8_t *data, uint32_t length, char *filename, - uint32_t offset) -{ - uint8_t hmackey[32]; - uint32_t len; - uint32_t status; - uint8_t *digest = data + length; - - len = ReadBinaryFile(filename, hmackey, 32); - if (len != 32) { - printf("Error reading hmac key file\n"); - return 0; - } - - status = HmacSha256Hash(&data[offset], length - offset, digest, - hmackey); - - if (status) { - printf("HMAC-SHA256 hash error\n"); - return 0; - } - - return 32; -} |