summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-09-03 17:01:02 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-09-03 17:01:02 +0000
commit4aada770c91e9484a8a01770df41902863df3a74 (patch)
tree86d983535f0d95fa4edbdbebf06ca948a888543c
parentc5ed2d34695c27e0bc584acc805ba15fdd7131ef (diff)
add sha512/256 support to check that the libc code is right :)
-rw-r--r--bin/md5/cksum.16
-rw-r--r--bin/md5/md5.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/bin/md5/cksum.1 b/bin/md5/cksum.1
index 452007aadba..af52a4ac7e8 100644
--- a/bin/md5/cksum.1
+++ b/bin/md5/cksum.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cksum.1,v 1.38 2014/03/20 22:06:21 tedu Exp $
+.\" $OpenBSD: cksum.1,v 1.39 2016/09/03 17:01:01 tedu Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" @(#)cksum.1 8.2 (Berkeley) 4/28/95
.\"
-.Dd $Mdocdate: March 20 2014 $
+.Dd $Mdocdate: September 3 2016 $
.Dt CKSUM 1
.Os
.Sh NAME
@@ -73,7 +73,7 @@ The options are as follows:
.It Fl a Ar algorithms
Use the specified algorithm(s) instead of the default (cksum).
Supported algorithms include cksum, md5, rmd160, sha1,
-sha224, sha256, sha384, and sha512.
+sha224, sha256, sha384, sha512/256, and sha512.
Multiple algorithms may be specified, separated by a comma or whitespace.
Additionally, multiple
.Fl a
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index 3c2c49b2c4e..ee44bd159f1 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.86 2016/08/26 05:50:29 guenther Exp $ */
+/* $OpenBSD: md5.c,v 1.87 2016/09/03 17:01:01 tedu Exp $ */
/*
* Copyright (c) 2001,2003,2005-2007,2010,2013,2014
@@ -154,6 +154,17 @@ struct hash_function {
(void (*)(unsigned char *, void *))SHA384Final,
(char *(*)(void *, char *))SHA384End
},
+ {
+ "SHA512/256",
+ SHA512_256_DIGEST_LENGTH,
+ STYLE_MD5,
+ 0,
+ NULL,
+ (void (*)(void *))SHA512_256Init,
+ (void (*)(void *, const unsigned char *, size_t))SHA512_256Update,
+ (void (*)(unsigned char *, void *))SHA512_256Final,
+ (char *(*)(void *, char *))SHA512_256End
+ },
#endif /* !defined(SHA2_ONLY) */
{
"SHA512",