#include <cli.h>
#include <console.h>
#include <fdtdec.h>
+#include <hash.h>
#include <menu.h>
#include <post.h>
#include <u-boot/sha256.h>
#endif
#if defined(CONFIG_AUTOBOOT_KEYED)
-#if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)
/*
* Use a "constant-length" time compare function for this
return diff == 0;
}
-static int passwd_abort(uint64_t etime)
+static int passwd_abort_sha256(uint64_t etime)
{
const char *sha_env_str = env_get("bootstopkeysha256");
u8 sha_env[SHA256_SUM_LEN];
return abort;
}
-#else
-static int passwd_abort(uint64_t etime)
+
+static int passwd_abort_key(uint64_t etime)
{
int abort = 0;
struct {
return abort;
}
-#endif
/***************************************************************************
* Watch for 'delay' seconds for autoboot stop or autoboot delay string.
printf(CONFIG_AUTOBOOT_PROMPT, bootdelay);
# endif
- abort = passwd_abort(etime);
+ if (IS_ENABLED(CONFIG_AUTOBOOT_ENCRYPTION))
+ abort = passwd_abort_sha256(etime);
+ else
+ abort = passwd_abort_key(etime);
if (!abort)
debug_bootkeys("key timeout\n");