From 67c77edac6554f7c3922c76cdfb43bfcc93664e0 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 30 May 2024 17:12:20 +0000 Subject: [PATCH] ike-scan: prepare for removal of static buffer from MD5() https://github.com/royhills/ike-scan/pull/41 --- net/ike-scan/Makefile | 1 + net/ike-scan/patches/patch-ike-scan_c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 net/ike-scan/patches/patch-ike-scan_c diff --git a/net/ike-scan/Makefile b/net/ike-scan/Makefile index 26121bcb8299..b3a7349bd62c 100644 --- a/net/ike-scan/Makefile +++ b/net/ike-scan/Makefile @@ -1,6 +1,7 @@ GH_ACCOUNT= royhills GH_PROJECT= ike-scan GH_TAGNAME= 1.9.5 +REVISION= 0 COMMENT= VPN scanner and identifier diff --git a/net/ike-scan/patches/patch-ike-scan_c b/net/ike-scan/patches/patch-ike-scan_c new file mode 100644 index 000000000000..fc3ce5de9dea --- /dev/null +++ b/net/ike-scan/patches/patch-ike-scan_c @@ -0,0 +1,22 @@ +https://github.com/royhills/ike-scan/pull/41 + +Index: ike-scan.c +--- ike-scan.c.orig ++++ ike-scan.c +@@ -1329,6 +1329,7 @@ add_host(const char *name, unsigned timeout, unsigned + memset(he->icookie, '\0', sizeof(he->icookie)); + memcpy(he->icookie, cookie_data, cookie_data_len); + } else { ++ unsigned char md[MD5_DIGEST_LENGTH]; + /* + * We cast the timeval elements to unsigned long because different vendors + * use different types for them (int, long, unsigned int and unsigned long). +@@ -1337,7 +1338,7 @@ add_host(const char *name, unsigned timeout, unsigned + */ + snprintf(str, sizeof(str), "%lu %lu %u %s", (unsigned long) now.tv_sec, + (unsigned long) now.tv_usec, *num_hosts, inet_ntoa(he->addr)); +- memcpy(he->icookie, MD5((unsigned char *)str, strlen(str), NULL), ++ memcpy(he->icookie, MD5((unsigned char *)str, strlen(str), md), + sizeof(he->icookie)); + } + }