git: 81de655acd2e - main - libmd: stop exporting Transform() symbols

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 03:36:11 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=81de655acd2ebdf104dc4a332eaee5e62b8440a2

commit 81de655acd2ebdf104dc4a332eaee5e62b8440a2
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-03-08 18:05:24 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-09-30 03:34:20 +0000

    libmd: stop exporting Transform() symbols
    
    They're not documented in libmd and we don't have any consumers.  It's
    problematic to keep them exported, as we don't currently export their
    implementations. Make them all private.
    
    PR:             280784 (exp-run)
    Reviewed by:    fuz
    Differential Revision:  https://reviews.freebsd.org/D34503
---
 lib/libmd/Symbol.map      | 11 -----------
 lib/libmd/ripemd.h        |  3 ---
 lib/libmd/rmd160c.c       |  4 +---
 lib/libmd/sha.h           |  6 ------
 lib/libmd/sha0c.c         |  2 +-
 lib/libmd/sha1c.c         |  6 +-----
 sys/crypto/sha2/sha256.h  |  3 ---
 sys/crypto/sha2/sha256c.c |  2 --
 sys/crypto/sha2/sha512.h  |  3 ---
 sys/crypto/sha2/sha512c.c |  2 --
 sys/crypto/sha2/sha512t.h |  6 ------
 sys/kern/md5c.c           |  2 --
 12 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/lib/libmd/Symbol.map b/lib/libmd/Symbol.map
index 9ac73e5bb5fd..86523a5933a1 100644
--- a/lib/libmd/Symbol.map
+++ b/lib/libmd/Symbol.map
@@ -17,7 +17,6 @@ FBSD_1.7 {
 	MD5FileChunk;
 	MD5Final;
 	MD5Init;
-	MD5Transform;
 	MD5Update;
 	RIPEMD160_Data;
 	RIPEMD160_End;
@@ -27,7 +26,6 @@ FBSD_1.7 {
 	RIPEMD160_FileChunk;
 	RIPEMD160_Final;
 	RIPEMD160_Init;
-	RIPEMD160_Transform;
 	RIPEMD160_Update;
 	RMD160_version;
 	SHA1_Data;
@@ -38,7 +36,6 @@ FBSD_1.7 {
 	SHA1_FileChunk;
 	SHA1_Final;
 	SHA1_Init;
-	SHA1_Transform;
 	SHA1_Update;
 	SHA1_version;
 	SHA224_Data;
@@ -58,7 +55,6 @@ FBSD_1.7 {
 	SHA256_FileChunk;
 	SHA256_Final;
 	SHA256_Init;
-	SHA256_Transform;
 	SHA256_Update;
 	SHA384_Data;
 	SHA384_End;
@@ -95,7 +91,6 @@ FBSD_1.7 {
 	SHA512_FileChunk;
 	SHA512_Final;
 	SHA512_Init;
-	SHA512_Transform;
 	SHA512_Update;
 	SHA_Data;
 	SHA_End;
@@ -151,7 +146,6 @@ FBSDprivate_1.0 {
 	_libmd_MD5FileChunk;
 	_libmd_MD5Final;
 	_libmd_MD5Init;
-	_libmd_MD5Transform;
 	_libmd_MD5Update;
 	_libmd_RIPEMD160_Data;
 	_libmd_RIPEMD160_End;
@@ -161,7 +155,6 @@ FBSDprivate_1.0 {
 	_libmd_RIPEMD160_FileChunk;
 	_libmd_RIPEMD160_Final;
 	_libmd_RIPEMD160_Init;
-	_libmd_RIPEMD160_Transform;
 	_libmd_RIPEMD160_Update;
 	_libmd_RMD160_version;
 	_libmd_SHA1_Data;
@@ -172,7 +165,6 @@ FBSDprivate_1.0 {
 	_libmd_SHA1_FileChunk;
 	_libmd_SHA1_Final;
 	_libmd_SHA1_Init;
-	_libmd_SHA1_Transform;
 	_libmd_SHA1_Update;
 	_libmd_SHA1_version;
 	_libmd_SHA224_Data;
@@ -192,7 +184,6 @@ FBSDprivate_1.0 {
 	_libmd_SHA256_FileChunk;
 	_libmd_SHA256_Final;
 	_libmd_SHA256_Init;
-	_libmd_SHA256_Transform;
 	_libmd_SHA256_Update;
 	_libmd_SHA384_Data;
 	_libmd_SHA384_End;
@@ -229,7 +220,6 @@ FBSDprivate_1.0 {
 	_libmd_SHA512_FileChunk;
 	_libmd_SHA512_Final;
 	_libmd_SHA512_Init;
-	_libmd_SHA512_Transform;
 	_libmd_SHA512_Update;
 	_libmd_SHA_Data;
 	_libmd_SHA_End;
@@ -239,7 +229,6 @@ FBSDprivate_1.0 {
 	_libmd_SHA_FileChunk;
 	_libmd_SHA_Final;
 	_libmd_SHA_Init;
-	_libmd_SHA_Transform;
 	_libmd_SHA_Update;
 	_libmd_SHA_version;
 	_libmd_SKEIN1024_Data;
diff --git a/lib/libmd/ripemd.h b/lib/libmd/ripemd.h
index fa9f513ebfd8..7f82a54a5176 100644
--- a/lib/libmd/ripemd.h
+++ b/lib/libmd/ripemd.h
@@ -110,9 +110,6 @@ __BEGIN_DECLS
 #define RIPEMD160_Data		_libmd_RIPEMD160_Data
 #endif
 
-#ifndef RIPEMD160_Transform
-#define RIPEMD160_Transform	_libmd_RIPEMD160_Transform
-#endif
 #ifndef RMD160_version
 #define RMD160_version		_libmd_RMD160_version
 #endif
diff --git a/lib/libmd/rmd160c.c b/lib/libmd/rmd160c.c
index afc20545dd3d..5642a9a29a1c 100644
--- a/lib/libmd/rmd160c.c
+++ b/lib/libmd/rmd160c.c
@@ -226,7 +226,7 @@ void RIPEMD160_Update(RIPEMD160_CTX *c, const void *in, size_t len)
 		}
 	}
 
-void RIPEMD160_Transform(RIPEMD160_CTX *c, unsigned char *b)
+static void RIPEMD160_Transform(RIPEMD160_CTX *c, unsigned char *b)
 	{
 	u_int32_t p[16];
 #if BYTE_ORDER != LITTLE_ENDIAN
@@ -540,8 +540,6 @@ __weak_reference(_libmd_RIPEMD160_Init, RIPEMD160_Init);
 __weak_reference(_libmd_RIPEMD160_Update, RIPEMD160_Update);
 #undef RIPEMD160_Final
 __weak_reference(_libmd_RIPEMD160_Final, RIPEMD160_Final);
-#undef RIPEMD160_Transform
-__weak_reference(_libmd_RIPEMD160_Transform, RIPEMD160_Transform);
 #undef RMD160_version
 __weak_reference(_libmd_RMD160_version, RMD160_version);
 #endif
diff --git a/lib/libmd/sha.h b/lib/libmd/sha.h
index 6c7b0c0c30b3..49f65d91bfda 100644
--- a/lib/libmd/sha.h
+++ b/lib/libmd/sha.h
@@ -107,9 +107,6 @@ __BEGIN_DECLS
 #define SHA_Data	_libmd_SHA_Data
 #endif
 
-#ifndef SHA_Transform
-#define SHA_Transform	_libmd_SHA_Transform
-#endif
 #ifndef SHA_version
 #define SHA_version	_libmd_SHA_version
 #endif
@@ -145,9 +142,6 @@ __BEGIN_DECLS
 #define SHA1_Data	_libmd_SHA1_Data
 #endif
 
-#ifndef SHA1_Transform
-#define SHA1_Transform	_libmd_SHA1_Transform
-#endif
 #ifndef SHA1_version
 #define SHA1_version	_libmd_SHA1_version
 #endif
diff --git a/lib/libmd/sha0c.c b/lib/libmd/sha0c.c
index 4c39ed842ea9..a36617b6ca60 100644
--- a/lib/libmd/sha0c.c
+++ b/lib/libmd/sha0c.c
@@ -242,7 +242,7 @@ void SHA_Update(SHA_CTX *c, const void *in, size_t len)
 	p[sw]=l;
 	}
 
-void SHA_Transform(SHA_CTX *c, unsigned char *b)
+static void SHA_Transform(SHA_CTX *c, unsigned char *b)
 	{
 	u_int32_t p[16];
 #if BYTE_ORDER == LITTLE_ENDIAN
diff --git a/lib/libmd/sha1c.c b/lib/libmd/sha1c.c
index 42b554c83ed1..6e80407e4ec0 100644
--- a/lib/libmd/sha1c.c
+++ b/lib/libmd/sha1c.c
@@ -270,7 +270,7 @@ SHA1_Update(SHA_CTX *c, const void *in, size_t len)
 	p[sw]=l;
 	}
 
-void SHA1_Transform(SHA_CTX *c, unsigned char *b)
+static void SHA1_Transform(SHA_CTX *c, unsigned char *b)
 	{
 	u_int32_t p[16];
 #if BYTE_ORDER != BIG_ENDIAN
@@ -483,8 +483,6 @@ __weak_reference(_libmd_SHA_Init, SHA_Init);
 __weak_reference(_libmd_SHA_Update, SHA_Update);
 #undef SHA_Final
 __weak_reference(_libmd_SHA_Final, SHA_Final);
-#undef SHA_Transform
-__weak_reference(_libmd_SHA_Transform, SHA_Transform);
 #undef SHA_version
 __weak_reference(_libmd_SHA_version, SHA_version);
 #undef SHA1_Init
@@ -493,8 +491,6 @@ __weak_reference(_libmd_SHA1_Init, SHA1_Init);
 __weak_reference(_libmd_SHA1_Update, SHA1_Update);
 #undef SHA1_Final
 __weak_reference(_libmd_SHA1_Final, SHA1_Final);
-#undef SHA1_Transform
-__weak_reference(_libmd_SHA1_Transform, SHA1_Transform);
 #undef SHA1_version
 __weak_reference(_libmd_SHA1_version, SHA1_version);
 #endif
diff --git a/sys/crypto/sha2/sha256.h b/sys/crypto/sha2/sha256.h
index 60c417e0fb8d..7bee1002c25c 100644
--- a/sys/crypto/sha2/sha256.h
+++ b/sys/crypto/sha2/sha256.h
@@ -73,9 +73,6 @@ __BEGIN_DECLS
 #define SHA256_Data		_libmd_SHA256_Data
 #endif
 
-#ifndef SHA256_Transform
-#define SHA256_Transform	_libmd_SHA256_Transform
-#endif
 #ifndef SHA256_version
 #define SHA256_version		_libmd_SHA256_version
 #endif
diff --git a/sys/crypto/sha2/sha256c.c b/sys/crypto/sha2/sha256c.c
index a3bebc4bee55..b7f7295c5c85 100644
--- a/sys/crypto/sha2/sha256c.c
+++ b/sys/crypto/sha2/sha256c.c
@@ -391,8 +391,6 @@ __weak_reference(_libmd_SHA256_Init, SHA256_Init);
 __weak_reference(_libmd_SHA256_Update, SHA256_Update);
 #undef SHA256_Final
 __weak_reference(_libmd_SHA256_Final, SHA256_Final);
-#undef SHA256_Transform
-__weak_reference(_libmd_SHA256_Transform, SHA256_Transform);
 
 #undef SHA224_Init
 __weak_reference(_libmd_SHA224_Init, SHA224_Init);
diff --git a/sys/crypto/sha2/sha512.h b/sys/crypto/sha2/sha512.h
index a119af36276a..4a3e2cadf022 100644
--- a/sys/crypto/sha2/sha512.h
+++ b/sys/crypto/sha2/sha512.h
@@ -72,9 +72,6 @@ __BEGIN_DECLS
 #define SHA512_Data		_libmd_SHA512_Data
 #endif
 
-#ifndef SHA512_Transform
-#define SHA512_Transform	_libmd_SHA512_Transform
-#endif
 #ifndef SHA512_version
 #define SHA512_version		_libmd_SHA512_version
 #endif
diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c
index 8eda238870e8..076cb30a1dfa 100644
--- a/sys/crypto/sha2/sha512c.c
+++ b/sys/crypto/sha2/sha512c.c
@@ -511,8 +511,6 @@ __weak_reference(_libmd_SHA512_Init, SHA512_Init);
 __weak_reference(_libmd_SHA512_Update, SHA512_Update);
 #undef SHA512_Final
 __weak_reference(_libmd_SHA512_Final, SHA512_Final);
-#undef SHA512_Transform
-__weak_reference(_libmd_SHA512_Transform, SHA512_Transform);
 
 #undef SHA512_224_Init
 __weak_reference(_libmd_SHA512_224_Init, SHA512_224_Init);
diff --git a/sys/crypto/sha2/sha512t.h b/sys/crypto/sha2/sha512t.h
index 51df4e4dfb2e..2274fa2704b9 100644
--- a/sys/crypto/sha2/sha512t.h
+++ b/sys/crypto/sha2/sha512t.h
@@ -69,9 +69,6 @@ __BEGIN_DECLS
 #define SHA512_224_Data		_libmd_SHA512_224_Data
 #endif
 
-#ifndef SHA512_224_Transform
-#define SHA512_224_Transform	_libmd_SHA512_224_Transform
-#endif
 #ifndef SHA512_224_version
 #define SHA512_224_version	_libmd_SHA512_224_version
 #endif
@@ -104,9 +101,6 @@ __BEGIN_DECLS
 #define SHA512_256_Data		_libmd_SHA512_256_Data
 #endif
 
-#ifndef SHA512_256_Transform
-#define SHA512_256_Transform	_libmd_SHA512_256_Transform
-#endif
 #ifndef SHA512_256_version
 #define SHA512_256_version	_libmd_SHA512_256_version
 #endif
diff --git a/sys/kern/md5c.c b/sys/kern/md5c.c
index b1ceac656cdd..0922d0f8cc61 100644
--- a/sys/kern/md5c.c
+++ b/sys/kern/md5c.c
@@ -338,6 +338,4 @@ __weak_reference(_libmd_MD5Init, MD5Init);
 __weak_reference(_libmd_MD5Update, MD5Update);
 #undef MD5Final
 __weak_reference(_libmd_MD5Final, MD5Final);
-#undef MD5Transform
-__weak_reference(_libmd_MD5Transform, MD5Transform);
 #endif