From 56dceb9b7722193ef53fb1afb981f1289eecb0b0 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 10 Nov 2008 13:32:50 +0000 Subject: sha256,sha512: new applets. +4.9kb we will require sha256/512 code for new $5$ and $6$ style password hashes anyway, they are showing up already in people's /etc/passwd... --- coreutils/Config.in | 12 ++++++++++++ coreutils/md5_sha1_sum.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 9 deletions(-) (limited to 'coreutils') diff --git a/coreutils/Config.in b/coreutils/Config.in index 8cbc92f1e..b734f8e30 100644 --- a/coreutils/Config.in +++ b/coreutils/Config.in @@ -509,6 +509,18 @@ config SHA1SUM help Compute and check SHA1 message digest +config SHA256SUM + bool "sha256sum" + default n + help + Compute and check SHA256 message digest + +config SHA512SUM + bool "sha512sum" + default n + help + Compute and check SHA512 message digest + config SLEEP bool "sleep" default n diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index a5681589b..a988b9cbf 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c @@ -8,7 +8,13 @@ #include "libbb.h" -typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t; +typedef enum { + /* 4th letter of applet_name is... */ + HASH_MD5 = 's', /* "md5>s