$OpenBSD: patch-src_modules_tls_tls_bio_c,v 1.3 2021/02/06 21:32:06 sthen Exp $

Index: src/modules/tls/tls_bio.c
--- src/modules/tls/tls_bio.c.orig
+++ src/modules/tls/tls_bio.c
@@ -102,6 +102,19 @@ static void BIO_set_init(BIO *b, int init)
 #endif
 
 #else
+#if defined(LIBRESSL_VERSION_NUMBER)
+/*
+ * libressl doesn't have OPENSSL_zalloc
+ */
+static void *CRYPTO_zalloc(size_t num, const char *file, int line)
+{
+	void *ret = CRYPTO_malloc(num, file, line);
+	if (ret != NULL)
+		memset(ret, 0, num);
+	return ret;
+}
+# define OPENSSL_zalloc(num) CRYPTO_zalloc(num, __FILE__, __LINE__)
+#endif
 static BIO_METHOD *tls_mbuf_method = NULL;
 #endif
 
