void-packages/srcpkgs/gsoap/patches/fix-libressl.patch

44 lines
1008 B
Diff

--- gsoap/plugin/smdevp.c.orig 2017-01-15 20:09:56.876555589 +0100
+++ gsoap/plugin/smdevp.c 2017-01-15 20:10:50.012509531 +0100
@@ -306,6 +306,40 @@ the digest or signature produced.
extern "C" {
#endif
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)
+static EVP_MD_CTX *EVP_MD_CTX_new(void)
+{
+ EVP_MD_CTX *ctx = (EVP_MD_CTX *)malloc(sizeof(*ctx));
+ if (ctx != NULL)
+ EVP_MD_CTX_init(ctx);
+ return ctx;
+}
+
+static void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+ if (ctx != NULL) {
+ EVP_MD_CTX_cleanup(ctx);
+ free(ctx);
+ }
+}
+
+static HMAC_CTX *HMAC_CTX_new(void)
+{
+ HMAC_CTX *ctx = (HMAC_CTX *)malloc(sizeof(*ctx));
+ if (ctx != NULL)
+ HMAC_CTX_init(ctx);
+ return ctx;
+}
+
+static void HMAC_CTX_free(HMAC_CTX *ctx)
+{
+ if (ctx != NULL) {
+ HMAC_CTX_cleanup(ctx);
+ free(ctx);
+ }
+}
+#endif
+
/******************************************************************************\
*
* Static protos