simplify using freezero for OPENSSL_clear_free, diff from tb@ - thanks!

This commit is contained in:
thfr 2022-11-29 18:59:34 +00:00
parent 43cfd92187
commit d3c02088aa
2 changed files with 3 additions and 17 deletions

View File

@ -8,7 +8,7 @@ DISTNAME = kitty-${MODPY_EGG_VERSION}
CATEGORIES = x11
HOMEPAGE = https://sw.kovidgoyal.net/kitty/
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
REVISION = 2
REVISION = 3
# GPLv3+
PERMIT_PACKAGE = Yes
@ -24,6 +24,8 @@ EXTRACT_SUFX = .tar.xz
# C11
COMPILER = base-clang ports-gcc
CFLAGS += "-DOPENSSL_clear_free=freezero"
MODULES = lang/python
MODPY_DISTUTILS_BUILD = linux-package
MODPY_SETUP_ARGS += --verbose \

View File

@ -1,16 +0,0 @@
Use freezero() since OPENSSL_clear_free() is not available in LibreSSL.
Index: kitty/crypto.c
--- kitty/crypto.c.orig
+++ kitty/crypto.c
@@ -17,6 +17,10 @@
#include <sys/mman.h>
#include <structmember.h>
+#if defined(LIBRESSL_VERSION_NUMBER)
+#define OPENSSL_clear_free(a, b) freezero((a), (b))
+#endif
+
#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH
typedef enum HASH_ALGORITHM { SHA1_HASH, SHA224_HASH, SHA256_HASH, SHA384_HASH, SHA512_HASH } HASH_ALGORITHM;