diff --git a/net/radiusd-cistron/Makefile b/net/radiusd-cistron/Makefile index 58d464e87de..3108bc12e57 100644 --- a/net/radiusd-cistron/Makefile +++ b/net/radiusd-cistron/Makefile @@ -1,8 +1,10 @@ -# $OpenBSD: Makefile,v 1.12 2001/11/13 20:31:23 danh Exp $ +# $OpenBSD: Makefile,v 1.13 2001/11/20 18:54:55 danh Exp $ COMMENT= "Cistron RADIUS server" -DISTNAME= radiusd-cistron-1.6.4 +VERSION= 1.6.4 +DISTNAME= radiusd-cistron-${VERSION} +PKGNAME= radiusd-cistron-${VERSION}p1 CATEGORIES= net NEED_VERSION= 1.496 MASTER_SITES= ftp://ftp.radius.cistron.nl/pub/radius/ \ diff --git a/net/radiusd-cistron/patches/patch-src_proxy_c b/net/radiusd-cistron/patches/patch-src_proxy_c new file mode 100644 index 00000000000..edfff1e8deb --- /dev/null +++ b/net/radiusd-cistron/patches/patch-src_proxy_c @@ -0,0 +1,14 @@ +$OpenBSD: patch-src_proxy_c,v 1.1 2001/11/20 18:54:55 danh Exp $ +--- src/proxy.c.orig Tue Nov 20 12:59:28 2001 ++++ src/proxy.c Tue Nov 20 13:00:39 2001 +@@ -53,9 +53,8 @@ void random_vector(char *vector) + int randno; + int i; + +- srand(time(0) + getpid()); + for(i = 0;i < AUTH_VECTOR_LEN;) { +- randno = rand(); ++ randno = arc4random(); + memcpy(vector, &randno, sizeof(int)); + vector += sizeof(int); + i += sizeof(int); diff --git a/net/radiusd-cistron/patches/patch-src_radius_c b/net/radiusd-cistron/patches/patch-src_radius_c new file mode 100644 index 00000000000..bfdb30599a5 --- /dev/null +++ b/net/radiusd-cistron/patches/patch-src_radius_c @@ -0,0 +1,52 @@ +$OpenBSD: patch-src_radius_c,v 1.1 2001/11/20 18:54:55 danh Exp $ +--- src/radius.c.orig Tue Nov 20 13:26:31 2001 ++++ src/radius.c Tue Nov 20 13:33:21 2001 +@@ -267,10 +267,11 @@ int calc_digest(u_char *digest, AUTH_REQ + */ + int calc_acctdigest(u_char *digest, AUTH_REQ *authreq) + { +- int secretlen; ++ char zero[AUTH_VECTOR_LEN]; ++ char *recvbuf = authreq->data; ++ char *tmpbuf; + CLIENT *cl; +- char zero[AUTH_VECTOR_LEN]; +- char * recvbuf = authreq->data; ++ int secretlen; + int len = authreq->data_len; + + /* +@@ -283,13 +284,6 @@ int calc_acctdigest(u_char *digest, AUTH + } + + /* +- * Copy secret into authreq->secret so that we can +- * use it with send_acct_reply() +- */ +- secretlen = strlen(cl->secret); +- strNcpy(authreq->secret, cl->secret, sizeof(authreq->secret)); +- +- /* + * Older clients have the authentication vector set to + * all zeros. Return `1' in that case. + */ +@@ -303,9 +297,17 @@ int calc_acctdigest(u_char *digest, AUTH + * and calculate the MD5 sum. This must be the same + * as the original MD5 sum (authreq->vector). + */ ++ secretlen = strlen(authreq->secret); + memset(recvbuf + 4, 0, AUTH_VECTOR_LEN); +- memcpy(recvbuf + len, cl->secret, secretlen); +- md5_calc(digest, recvbuf, len + secretlen); ++ ++ if ((tmpbuf = malloc(len + secretlen)) == NULL) { ++ log(L_ERR|L_CONS, "no memory"); ++ exit(1); ++ } ++ memcpy(tmpbuf, recvbuf, len); ++ memcpy(tmpbuf + len, authreq->secret, secretlen); ++ md5_calc(digest, tmpbuf, len + secretlen); ++ free(tmpbuf); + + /* + * Return 0 if OK, 2 if not OK. diff --git a/net/radiusd-cistron/patches/patch-src_radtest_c b/net/radiusd-cistron/patches/patch-src_radtest_c new file mode 100644 index 00000000000..8c43eca7a5a --- /dev/null +++ b/net/radiusd-cistron/patches/patch-src_radtest_c @@ -0,0 +1,14 @@ +$OpenBSD: patch-src_radtest_c,v 1.1 2001/11/20 18:54:55 danh Exp $ +--- src/radtest.c.orig Tue Nov 20 13:04:08 2001 ++++ src/radtest.c Tue Nov 20 13:04:26 2001 +@@ -262,9 +262,8 @@ static void random_vector(char *vector) + int randno; + int i; + +- srand(time(0)); + for(i = 0;i < AUTH_VECTOR_LEN;) { +- randno = rand(); ++ randno = arc4random(); + memcpy(vector, &randno, sizeof(int)); + vector += sizeof(int); + i += sizeof(int);