summaryrefslogtreecommitdiffstats
path: root/www/w3c-httpd
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1997-03-08 22:03:00 +0000
committerobrien <obrien@FreeBSD.org>1997-03-08 22:03:00 +0000
commit685c9dc3d2c4f90671599a998b57d9c7333db037 (patch)
tree6b891211b0d1d4bdf6c7ebef481e6cf638c58b1c /www/w3c-httpd
parent23595c1be784a378fb2849b1a96d8a873e3d9205 (diff)
downloadFreeBSD-ports-685c9dc3d2c4f90671599a998b57d9c7333db037.zip
FreeBSD-ports-685c9dc3d2c4f90671599a998b57d9c7333db037.tar.gz
Add patch for MD5 encrypted passwords
Closes-PR: ports/2669 Submitted by: Sergei Vnotchenko <sergey@ns.extech.msk.su> Added prelimiary support for OpenBSD and NetBSD.
Diffstat (limited to 'www/w3c-httpd')
-rw-r--r--www/w3c-httpd/files/patch-aa24
-rw-r--r--www/w3c-httpd/files/patch-bc81
2 files changed, 93 insertions, 12 deletions
diff --git a/www/w3c-httpd/files/patch-aa b/www/w3c-httpd/files/patch-aa
index 4f766df..a024808 100644
--- a/www/w3c-httpd/files/patch-aa
+++ b/www/w3c-httpd/files/patch-aa
@@ -1,12 +1,12 @@
-*** BUILD.orig Sat Sep 24 13:28:46 1994
---- BUILD Mon Dec 30 17:07:45 1996
-***************
-*** 56,61 ****
---- 56,62 ----
- if ($UNAME == "AIX") setenv WWW_MACH rs6000
- if ($UNAME == "OSF1") setenv WWW_MACH osf1
- if ($UNAME == "BSD/386") setenv WWW_MACH unix
-+ if ($UNAME == "FreeBSD") setenv WWW_MACH freebsd
- if ($UNAME == "Linux") setenv WWW_MACH linux
- if ($UNAME == "A/UX") setenv WWW_MACH aux
- if ($UNAME == "SMP_DC.SOx") setenv WWW_MACH pyramid
+--- BUILD.orig Sat Sep 24 11:28:46 1994
++++ BUILD Sat Mar 8 10:08:38 1997
+@@ -56,6 +56,9 @@
+ if ($UNAME == "AIX") setenv WWW_MACH rs6000
+ if ($UNAME == "OSF1") setenv WWW_MACH osf1
+ if ($UNAME == "BSD/386") setenv WWW_MACH unix
++if ($UNAME == "FreeBSD") setenv WWW_MACH freebsd
++if ($UNAME == "OpenBSD") setenv WWW_MACH netbsd
++if ($UNAME == "NetBSD") setenv WWW_MACH netbsd
+ if ($UNAME == "Linux") setenv WWW_MACH linux
+ if ($UNAME == "A/UX") setenv WWW_MACH aux
+ if ($UNAME == "SMP_DC.SOx") setenv WWW_MACH pyramid
diff --git a/www/w3c-httpd/files/patch-bc b/www/w3c-httpd/files/patch-bc
new file mode 100644
index 0000000..08790f2
--- /dev/null
+++ b/www/w3c-httpd/files/patch-bc
@@ -0,0 +1,81 @@
+--- Daemon/Implementation/HTPasswd.c.orig Sun Sep 25 06:48:03 1994
++++ Daemon/Implementation/HTPasswd.c Sat Mar 8 10:02:19 1997
+@@ -77,6 +77,7 @@
+ ** string at once, but then again, we are not that paranoid
+ ** about the security inside the machine.
+ **
++ NOTE: MD5: 28 characters (8 - setting, 20 - crypted password)
+ */
+ PUBLIC char *HTAA_encryptPasswd ARGS1(CONST char *, password)
+ {
+@@ -101,7 +102,7 @@
+ strncpy(chunk, cur, 8);
+ chunk[8] = (char)0;
+
+- tmp = crypt((char*)password, salt); /*crypt() doesn't change its args*/
++ tmp = crypt((char*)chunk , salt); /*crypt() doesn't change its args*/
+ strcat(result, tmp);
+
+ cur += 8;
+@@ -139,11 +140,24 @@
+ char *result;
+ int len;
+ int status;
++#ifdef MD5_PW
++ char salt[9];
++#else
++ char salt[3];
++#endif
++ char chunk[9];
++ CONST char *cur1 = password;
++ CONST char *cur2 = encrypted;
++ char *tmp;
+
+ if (!password || !encrypted)
+ return NO;
+
++#ifdef MD5_PW
++ len = 28*(((int)strlen(password)+7)/8);
++#else
+ len = 13*(((int)strlen(password)+7)/8);
++#endif
+ if (len < (int)strlen(encrypted))
+ return NO;
+
+@@ -152,25 +166,30 @@
+
+ *result = (char)0;
+ while (len > 0) {
+- char salt[3];
+- char chunk[9];
+- CONST char *cur1 = password;
+- CONST char *cur2 = encrypted;
+- char *tmp;
+
++#ifdef MD5_PW
++ for(status=0;status<8;status++) salt[status]=cur2[status];
++ salt[8]=0;
++#else
+ salt[0] = *cur2;
+ salt[1] = *(cur2+1);
+ salt[2] = (char)0;
++#endif
+
+ strncpy(chunk, cur1, 8);
+ chunk[8] = (char)0;
+
+- tmp = crypt((char*)password, salt);
++ tmp = crypt((char*)chunk, salt);
+ strcat(result, tmp);
+
+ cur1 += 8;
++#ifdef MD5_PW
++ cur2 += 28;
++ len -= 28;
++#else
+ cur2 += 13;
+ len -= 13;
++#endif
+ } /* while */
+
+ status = strncmp(result, encrypted, strlen(encrypted));
OpenPOWER on IntegriCloud