projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
board: stm32mp1: fix handling of DT OP-TEE reserved memory nodes
[oweals/u-boot.git]
/
lib
/
sha256.c
diff --git
a/lib/sha256.c
b/lib/sha256.c
index 7348162575ceaccda1fa0100298e47e2f0e25af9..c1fe93de012dc8006abd14e7c95c5f6c4852c58c 100644
(file)
--- a/
lib/sha256.c
+++ b/
lib/sha256.c
@@
-1,17
+1,24
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* FIPS-180-2 compliant SHA-256 implementation
*
* Copyright (C) 2001-2003 Christophe Devine
/*
* FIPS-180-2 compliant SHA-256 implementation
*
* Copyright (C) 2001-2003 Christophe Devine
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#ifndef USE_HOSTCC
#include <common.h>
*/
#ifndef USE_HOSTCC
#include <common.h>
+#include <linux/string.h>
+#else
+#include <string.h>
#endif /* USE_HOSTCC */
#include <watchdog.h>
#endif /* USE_HOSTCC */
#include <watchdog.h>
-#include <linux/string.h>
-#include <sha256.h>
+#include <u-boot/sha256.h>
+
+const uint8_t sha256_der_prefix[SHA256_DER_LEN] = {
+ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
+ 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05,
+ 0x00, 0x04, 0x20
+};
/*
* 32-bit integer manipulation macros (big endian)
/*
* 32-bit integer manipulation macros (big endian)
@@
-258,14
+265,15
@@
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
{
sha256_context ctx;
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
{
sha256_context ctx;
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- unsigned char *end, *curr;
+ const unsigned char *end;
+ unsigned char *curr;
int chunk;
#endif
sha256_starts(&ctx);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
int chunk;
#endif
sha256_starts(&ctx);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- curr = input;
+ curr =
(unsigned char *)
input;
end = input + ilen;
while (curr < end) {
chunk = end - curr;
end = input + ilen;
while (curr < end) {
chunk = end - curr;