From 43dcc4bc07d55a50aeaa04743b7b473a71b00946 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sun, 15 Jul 2018 21:34:34 +0200
Subject: [PATCH] WIP Remove sha384 traces

---
 Makefile_upgrade.inc |  1 +
 lib/libmd/Makefile   |  2 +-
 lib/libmd/sha384.3   | 75 --------------------------------------------
 lib/libmd/sha512.h   |  4 ---
 4 files changed, 2 insertions(+), 80 deletions(-)
 delete mode 100644 lib/libmd/sha384.3

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index ef699195b4..ac24914f0f 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3517,6 +3517,7 @@ TO_REMOVE+=/usr/include/dev/video/bktr/bktr_i2c.h
 TO_REMOVE+=/usr/share/man/man9/callout_stop_sync.9.gz
 TO_REMOVE+=/usr/include/sys/termios.h
 TO_REMOVE+=/usr/share/zoneinfo/Etc/UCT
+TO_REMOVE+=/usr/share/man/man3/sha384.3.gz
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index 72ad1c8722..36ee8e8c1e 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -15,7 +15,7 @@ NO_STRICT_ALIASING=
 VERSION_DEF=	${.CURDIR}/../libc/Versions.def
 SYMBOL_MAPS=	${.CURDIR}/Symbol.map
 
-MAN+=	md2.3 md4.3 md5.3 sha.3 sha256.3 sha384.3 sha512.3
+MAN+=	md2.3 md4.3 md5.3 sha.3 sha256.3 sha512.3
 MLINKS+=md2.3 MD2Init.3 md2.3 MD2Update.3 md2.3 MD2Pad.3 md2.3 MD2Final.3
 MLINKS+=md2.3 MD2End.3  md2.3 MD2File.3   md2.3 MD2FileChunk.3
 MLINKS+=md2.3 MD2Data.3
diff --git a/lib/libmd/sha384.3 b/lib/libmd/sha384.3
deleted file mode 100644
index c90bbf772b..0000000000
--- a/lib/libmd/sha384.3
+++ /dev/null
@@ -1,75 +0,0 @@
-.\"
-.\" ----------------------------------------------------------------------------
-.\" "THE BEER-WARE LICENSE" (Revision 42):
-.\" <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
-.\" can do whatever you want with this stuff. If we meet some day, and you think
-.\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
-.\" ----------------------------------------------------------------------------
-.\"
-.\" 	From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp
-.\" $FreeBSD: src/lib/libmd/sha512.3,v 1.4 2005/11/17 13:00:00 ru Exp $
-.\"
-.Dd July 4, 2010
-.Dt SHA384 3
-.Os
-.Sh NAME
-.Nm SHA384_Init ,
-.Nm SHA384_Update ,
-.Nm SHA384_Final
-.Nd calculate the FIPS 180-2 ``SHA-384'' message digest
-.Sh LIBRARY
-.Lb libmd
-.Sh SYNOPSIS
-.In sys/types.h
-.In sha512.h
-.Ft void
-.Fn SHA384_Init "SHA384_CTX *context"
-.Ft void
-.Fn SHA384_Update "SHA384_CTX *context" "const u_int8_t *data" "size_t len"
-.Ft void
-.Fn SHA384_Final "u_int8_t digest[48]" "SHA384_CTX *context"
-.Sh DESCRIPTION
-The
-.Li SHA384_
-functions calculate a 384-bit cryptographic checksum (digest)
-for any number of input bytes.
-A cryptographic checksum is a one-way
-hash function; that is, it is computationally impractical to find
-the input corresponding to a particular output.
-This net result is
-a
-.Dq fingerprint
-of the input-data, which does not disclose the actual input.
-.Pp
-The
-.Fn SHA384_Init ,
-.Fn SHA384_Update ,
-and
-.Fn SHA384_Final
-functions are the core functions.
-Allocate an
-.Vt SHA384_CTX ,
-initialize it with
-.Fn SHA384_Init ,
-run over the data with
-.Fn SHA384_Update ,
-and finally extract the result using
-.Fn SHA384_Final .
-.Sh SEE ALSO
-.Xr md2 3 ,
-.Xr md4 3 ,
-.Xr md5 3 ,
-.Xr ripemd 3 ,
-.Xr sha 3
-.Sh HISTORY
-These functions appeared in
-.Dx 2.9 .
-.Sh AUTHORS
-The core hash routines were implemented by Colin Percival based on
-the published
-.Tn FIPS 180-2
-standard.
-.Sh BUGS
-No method is known to exist which finds two files having the same hash value,
-nor to find a file with a specific hash value.
-There is on the other hand no guarantee that such a method does not exist.
diff --git a/lib/libmd/sha512.h b/lib/libmd/sha512.h
index a7b398aa65..2af9ec096a 100644
--- a/lib/libmd/sha512.h
+++ b/lib/libmd/sha512.h
@@ -40,13 +40,9 @@
 #include <sys/types.h>
 #include <openssl/sha.h>
 
-#define SHA384_BLOCK_LENGTH		128
-#define SHA384_DIGEST_STRING_LENGTH	(SHA384_DIGEST_LENGTH * 2 + 1)
 #define SHA512_BLOCK_LENGTH		128
 #define SHA512_DIGEST_STRING_LENGTH	(SHA512_DIGEST_LENGTH * 2 + 1)
 
-#define SHA384_CTX SHA512_CTX
-
 __BEGIN_DECLS
 char *SHA512_End(SHA512_CTX *, char *);
 char *SHA512_Data(const void *, unsigned int, char *);
-- 
2.21.0

