]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Procedure get_auth_cram_md5, seems to working fine.
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 4 Jul 2025 08:40:05 +0000 (04:40 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 4 Jul 2025 08:40:05 +0000 (04:40 -0400)
lib/lvleml.c

index 24828888ec4df227260a3dd4f7e565a38866442a..7c65ab26cdf855c718ccd1b3fa5176c5be50fbd6 100644 (file)
@@ -397,7 +397,6 @@ while (proceed==true) {
         res=cnv_getb64(line);
         (void) snprintf(answer,sizeof(answer),"%s",res);
         res=rou_freestr(res);
-        (void) rou_alert(0,"%s JMPDBG challenge answer=<%s>",OPEP,answer);
         line=rou_freestr(line);
         }
       if (strlen(answer)==0)
@@ -412,8 +411,6 @@ while (proceed==true) {
         ptr++;
         (void) strncpy(name,answer,sizeof(name));
         (void) memmove(answer,ptr,strlen(ptr)+1);
-        (void) rou_alert(0,"%s JMPDBG user name=<%s> answer=<%s>",
-                            OPEP,name,answer);
         }
       if (strlen(name)==0)
         phase=999;      //no need to go further
@@ -437,13 +434,11 @@ while (proceed==true) {
       (void) rou_alert(0,"%s passwd=<%s>",OPEP,passwd);
       local=cnv_hashmd5(passwd,(unsigned char *)challenge); 
       hexa=cnv_tohexa(local);
-      (void) rou_alert(0,"%s anwr=<%s>",OPEP,answer);
-      (void) rou_alert(0,"%s hexa=<%s>",OPEP,hexa);
-      if (strcmp(hexa,answer)==0) {
+      //(void) rou_alert(0,"%s anwr=<%s>",OPEP,answer);
+      //(void) rou_alert(0,"%s hexa=<%s>",OPEP,hexa);
+      if (strcmp(hexa,answer)==0) 
         (void) rou_asprintf(&decoded,"%s%s%s%s",
                                       IOBNULL,name,IOBNULL,passwd);
-        (void) rou_alert(0,"JMPDBG decoded=<%s>",decoded);
-        }
       hexa=rou_freestr(hexa);
       local=rou_freestr(local);
       }
@@ -676,8 +671,10 @@ if ((data[1]!=(char *)0)&&(data[2]!=(char *)0)) {
  usr=(USRTYP *)0;
  if (sql_mngusr(sqlptr,sql_select,data[1],&usr)==true) {
    char *crypted;
-   crypted=crypt(data[2],usr->passwd); 
+  
+   crypted=usr->passwd;
+   if (usr->passwd[0]=='$')
+     crypted=crypt(data[2],usr->passwd); 
    if ((crypted!=(char *)0)&&(strcmp(crypted,usr->passwd)==0))
       isok=true;      //Passord match
     usr=sql_freeusr(usr);
@@ -777,6 +774,7 @@ while (proceed==true) {
       break;
     case 5      :       //we have a decoded sequence, check password
       isok=checklogin(contact->sqlptr,decoded);
+      (void) rou_alert(0,"%s checklogin='%d'",OPEP,isok);
       break;
     case 6      :       //we have login status
       if (strlen(decoded)>0) {   //always