www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From th...@pinky.acsu.buffalo.edu
Subject Re: general/6149: ap_MD5 calls return a null for some combinations of username/password
Date Tue, 06 Jun 2000 13:30:01 GMT
The following reply was made to PR general/6149; it has been noted by GNATS.

From: thiel@pinky.acsu.buffalo.edu
To: submit@bugz.apache.org, apache-bugdb@apache.org
Cc:  
Subject: Re: general/6149: ap_MD5 calls return a null for some combinations of username/password
Date: Tue, 6 Jun 2000 09:26:17 -0400 (EDT)

 An update on this problem. Here is a code snippit that a co-worker
 of mine wrote using your MD5 calls. It produces a set of username/
 password pairs that give an "empty string" as a result (sorry, not
 a null).
 
 #include "httpd.h"
 #include "http_config.h"
 #include "http_core.h"
 #include "http_log.h"
 #include "http_main.h"
 #include "http_protocol.h"
 #include "util_script.h"
 #include "ap_md5.h"
 #include <stdlib.h>
 
 
 char c[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','0'};
 
 int main(int argc, char **argv) {
   AP_MD5_CTX md5_context;
   unsigned char input_digest[16];
   char username[9], password[9];
   int i,j;
 
   srand(time(0));
 
   while (1) {
     i = rand()%8;
     for (j=0;j<i;j++)
         username[j] = c[rand()%36];
     username[i]='\0';
     i = rand()%8;
     for (j=0;j<i;j++)
         password[j] = c[rand()%36];
     password[i]='\0';
 
     ap_MD5Init(&md5_context);
     ap_MD5Update(&md5_context, username, strlen(username));
     ap_MD5Update(&md5_context, password, strlen(password));
     ap_MD5Final(input_digest, &md5_context);
     if (! *input_digest)
         printf("%s %s %s\n",username,password, input_digest);
   }
 }
 
 
 

Mime
View raw message