-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ike-scan: prepare for removal of static buffer from MD5()
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |