From: Jean-Marc Pigeon (Delson) Date: Fri, 4 Jul 2025 08:40:05 +0000 (-0400) Subject: Procedure get_auth_cram_md5, seems to working fine. X-Git-Tag: tag-0.12~35 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=76d5f6f9775b31267e2ba19211a9d7b7e2243863;p=jmp%2Fmailleur Procedure get_auth_cram_md5, seems to working fine. --- diff --git a/lib/lvleml.c b/lib/lvleml.c index 2482888..7c65ab2 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -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