summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2015-03-11 17:53:07 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-12 07:58:24 +0100
commit3a436924121456c1347acedac31c9e19b2893565 (patch)
tree7fdbc285b4ad743588c1cb2605c2524cf93e0fe6 /common
parent2505dd9b413aca61b3acd74765683ee6430a06cf (diff)
downloadbarebox-3a436924121456c1347acedac31c9e19b2893565.tar.gz
password: add support for sha512
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig4
-rw-r--r--common/password.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 258a975..200423a 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -449,6 +449,10 @@ config PASSWD_SUM_SHA256
bool "SHA256"
select SHA256
+config PASSWD_SUM_SHA512
+ bool "SHA512"
+ select SHA512
+
endchoice
endif
diff --git a/common/password.c b/common/password.c
index 4c33152..6ecf717 100644
--- a/common/password.c
+++ b/common/password.c
@@ -33,6 +33,8 @@
#define PASSWD_SUM "sha1"
#elif defined(CONFIG_PASSWD_SUM_SHA256)
#define PASSWD_SUM "sha256"
+#elif defined(CONFIG_PASSWD_SUM_SHA512)
+#define PASSWD_SUM "sha512"
#endif
int password(unsigned char *passwd, size_t length, int flags, int timeout)