[ipxe-devel] [PATCH] [digest] Add sha256sum command

Denis 'GNUtoo' Carikli GNUtoo at no-log.org
Tue May 23 16:07:59 UTC 2017


Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
 src/hci/commands/digest_cmd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/hci/commands/digest_cmd.c b/src/hci/commands/digest_cmd.c
index 71308064..b41c2a91 100644
--- a/src/hci/commands/digest_cmd.c
+++ b/src/hci/commands/digest_cmd.c
@@ -29,6 +29,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/crypto.h>
 #include <ipxe/md5.h>
 #include <ipxe/sha1.h>
+#include <ipxe/sha256.h>
 #include <usr/imgmgmt.h>
 
 /** @file
@@ -112,6 +113,10 @@ static int sha1sum_exec ( int argc, char **argv ) {
 	return digest_exec ( argc, argv, &sha1_algorithm );
 }
 
+static int sha256sum_exec ( int argc, char **argv ) {
+	return digest_exec ( argc, argv, &sha256_algorithm );
+}
+
 struct command md5sum_command __command = {
 	.name = "md5sum",
 	.exec = md5sum_exec,
@@ -121,3 +126,8 @@ struct command sha1sum_command __command = {
 	.name = "sha1sum",
 	.exec = sha1sum_exec,
 };
+
+struct command sha256sum_command __command = {
+	.name = "sha256sum",
+	.exec = sha256sum_exec,
+};
-- 
2.13.0




More information about the ipxe-devel mailing list