Hide symbols in whrlpool
authorjoshua <joshua@openbsd.org>
Sat, 30 Mar 2024 03:45:47 +0000 (03:45 +0000)
committerjoshua <joshua@openbsd.org>
Sat, 30 Mar 2024 03:45:47 +0000 (03:45 +0000)
ok tb

lib/libcrypto/Symbols.namespace
lib/libcrypto/hidden/openssl/whrlpool.h [new file with mode: 0644]
lib/libcrypto/whrlpool/whirlpool.c

index 812a428..21f24c9 100644 (file)
@@ -2599,3 +2599,8 @@ _libre_CMS_get1_ReceiptRequest
 _libre_CMS_ReceiptRequest_create0
 _libre_CMS_add1_ReceiptRequest
 _libre_CMS_ReceiptRequest_get0_values
+_libre_WHIRLPOOL_Init
+_libre_WHIRLPOOL_Update
+_libre_WHIRLPOOL_BitUpdate
+_libre_WHIRLPOOL_Final
+_libre_WHIRLPOOL
diff --git a/lib/libcrypto/hidden/openssl/whrlpool.h b/lib/libcrypto/hidden/openssl/whrlpool.h
new file mode 100644 (file)
index 0000000..c3e4a51
--- /dev/null
@@ -0,0 +1,34 @@
+/* $OpenBSD: whrlpool.h,v 1.1 2024/03/30 03:45:47 joshua Exp $ */
+/*
+ * Copyright (c) 2024 Joshua Sing <joshua@joshuasing.dev>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBCRYPTO_WHRLPOOL_H
+#define _LIBCRYPTO_WHRLPOOL_H
+
+#ifndef _MSC_VER
+#include_next <openssl/whrlpool.h>
+#else
+#include "../include/openssl/whrlpool.h"
+#endif
+#include "crypto_namespace.h"
+
+LCRYPTO_USED(WHIRLPOOL_Init);
+LCRYPTO_USED(WHIRLPOOL_Update);
+LCRYPTO_USED(WHIRLPOOL_BitUpdate);
+LCRYPTO_USED(WHIRLPOOL_Final);
+LCRYPTO_USED(WHIRLPOOL);
+
+#endif /* _LIBCRYPTO_WHRLPOOL_H */
index 217c5a9..e1e0f7a 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: whirlpool.c,v 1.1 2024/03/29 02:41:49 jsing Exp $ */
+/* $OpenBSD: whirlpool.c,v 1.2 2024/03/30 03:45:47 joshua Exp $ */
 /**
  * The Whirlpool hashing function.
  *
@@ -650,6 +650,7 @@ WHIRLPOOL_Init(WHIRLPOOL_CTX *c)
        memset (c, 0, sizeof(*c));
        return (1);
 }
+LCRYPTO_ALIAS(WHIRLPOOL_Init);
 
 int
 WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *_inp, size_t bytes)
@@ -671,6 +672,7 @@ WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *_inp, size_t bytes)
 
        return (1);
 }
+LCRYPTO_ALIAS(WHIRLPOOL_Update);
 
 void
 WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *_inp, size_t bits)
@@ -796,6 +798,7 @@ reconsider:
                }
        }
 }
+LCRYPTO_ALIAS(WHIRLPOOL_BitUpdate);
 
 int
 WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c)
@@ -837,6 +840,7 @@ WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c)
        }
        return (0);
 }
+LCRYPTO_ALIAS(WHIRLPOOL_Final);
 
 unsigned char *
 WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md)
@@ -851,3 +855,4 @@ WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md)
        WHIRLPOOL_Final(md, &ctx);
        return (md);
 }
+LCRYPTO_ALIAS(WHIRLPOOL);