Skip to content

Commit

Permalink
ike-scan: prepare for removal of static buffer from MD5()
Browse files Browse the repository at this point in the history
  • Loading branch information
botovq committed May 30, 2024
1 parent 73916b2 commit 67c77ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/ike-scan/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GH_ACCOUNT= royhills
GH_PROJECT= ike-scan
GH_TAGNAME= 1.9.5
REVISION= 0

COMMENT= VPN scanner and identifier

Expand Down
22 changes: 22 additions & 0 deletions net/ike-scan/patches/patch-ike-scan_c
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 67c77ed

Please sign in to comment.