projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
env: net: U_BOOT_ENV_CALLBACKs should not depend on CMD_NET
[oweals/u-boot.git]
/
common
/
autoboot.c
diff --git
a/common/autoboot.c
b/common/autoboot.c
index 42fbd7614a8126d92a35325c8fbbd0bb3be18786..b28bd6823d824e73557b64b66fd6ad202ad8a592 100644
(file)
--- a/
common/autoboot.c
+++ b/
common/autoboot.c
@@
-9,8
+9,10
@@
#include <bootretry.h>
#include <cli.h>
#include <console.h>
#include <bootretry.h>
#include <cli.h>
#include <console.h>
+#include <env.h>
#include <fdtdec.h>
#include <hash.h>
#include <fdtdec.h>
#include <hash.h>
+#include <memalign.h>
#include <menu.h>
#include <post.h>
#include <u-boot/sha256.h>
#include <menu.h>
#include <post.h>
#include <u-boot/sha256.h>
@@
-71,8
+73,8
@@
static int passwd_abort_sha256(uint64_t etime)
{
const char *sha_env_str = env_get("bootstopkeysha256");
u8 sha_env[SHA256_SUM_LEN];
{
const char *sha_env_str = env_get("bootstopkeysha256");
u8 sha_env[SHA256_SUM_LEN];
- u8
sha[SHA256_SUM_LEN]
;
- char
presskey[MAX_DELAY_STOP_STR]
;
+ u8
*sha
;
+ char
*presskey
;
const char *algo_name = "sha256";
u_int presskey_len = 0;
int abort = 0;
const char *algo_name = "sha256";
u_int presskey_len = 0;
int abort = 0;
@@
-93,6
+95,9
@@
static int passwd_abort_sha256(uint64_t etime)
return 0;
}
return 0;
}
+ presskey = malloc_cache_aligned(MAX_DELAY_STOP_STR);
+ sha = malloc_cache_aligned(SHA256_SUM_LEN);
+ size = SHA256_SUM_LEN;
/*
* We don't know how long the stop-string is, so we need to
* generate the sha256 hash upon each input character and
/*
* We don't know how long the stop-string is, so we need to
* generate the sha256 hash upon each input character and
@@
-101,8
+106,11
@@
static int passwd_abort_sha256(uint64_t etime)
do {
if (tstc()) {
/* Check for input string overflow */
do {
if (tstc()) {
/* Check for input string overflow */
- if (presskey_len >= MAX_DELAY_STOP_STR)
+ if (presskey_len >= MAX_DELAY_STOP_STR) {
+ free(presskey);
+ free(sha);
return 0;
return 0;
+ }
presskey[presskey_len++] = getc();
presskey[presskey_len++] = getc();
@@
-116,6
+124,8
@@
static int passwd_abort_sha256(uint64_t etime)
}
} while (!abort && get_ticks() <= etime);
}
} while (!abort && get_ticks() <= etime);
+ free(presskey);
+ free(sha);
return abort;
}
return abort;
}