All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Fix for SHA256 Password Bug
@ 2017-09-05 12:00 Charles Eidsness
  0 siblings, 0 replies; only message in thread
From: Charles Eidsness @ 2017-09-05 12:00 UTC (permalink / raw)
  To: u-boot

Hi All,

The SHA256 password feature doesn't seem to be working. The size argument
that was passed to hash_block was undefined. I'm not sure if this patch is
the best approach, but it does fix it:

--- uboot-2017.01/common/autoboot.c.orig        2017-09-05
07:52:56.635162924 -0400
+++ uboot-2017.01/common/autoboot.c     2017-09-05 07:53:42.295593489 -0400
@@ -31,6 +31,8 @@
 #if defined(CONFIG_AUTOBOOT_KEYED)
 #if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)

+#include <hash.h>
+
 /*
  * Use a "constant-length" time compare function for this
  * hash compare:
@@ -57,7 +59,6 @@
        const char *algo_name = "sha256";
        u_int presskey_len = 0;
        int abort = 0;
-       int size;
        int ret;

        if (sha_env_str == NULL)
@@ -89,7 +90,7 @@

                        /* Calculate sha256 upon each new char */
                        hash_block(algo_name, (const void *)presskey,
-                                  presskey_len, sha, &size);
+                                  presskey_len, sha, NULL);

                        /* And check if sha matches saved value in env */
                        if (slow_equals(sha, sha_env, SHA256_SUM_LEN))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-05 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 12:00 [U-Boot] Fix for SHA256 Password Bug Charles Eidsness

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.