]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Fix probleme on realm contents (no '-' within realm?)
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 6 Jul 2025 19:29:30 +0000 (15:29 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 6 Jul 2025 19:29:30 +0000 (15:29 -0400)
lib/lvleml.c
lib/unidig.c
lib/unidig.h

index 03f7d30dda636f71e93e19b7dbc82e5d32dacd98..b0502cf23b706074b46b8b508f6b1ef43fe08e5c 100644 (file)
@@ -493,6 +493,7 @@ while (proceed==true) {
   (void) rou_alert(0,"%s JMPDBG phase='%d'",OPEP,phase);
   switch (phase) {
     case 0      :  {    //Building the challenge sequence
+      char *nchal;
       
       #define   FMT     "realm=\"%s\",nonce=\"%s\",qop=\"auth\",algorithm=md5-sess,charset=utf-8"
       char *nonce;
@@ -501,6 +502,10 @@ while (proceed==true) {
       nonce=strdup("abcdef");
       (void) snprintf(challenge,sizeof(challenge),FMT,contact->locname,nonce);
       nonce=rou_freestr(nonce);
+      nchal=dig_getchallenge();
+      (void) rou_alert(0,"good chal=<%s>",challenge);
+      (void) rou_alert(0,"bad chal=<%s>",nchal);
+      (void) strcpy(challenge,nchal);
       }
       break;
     case 1      :  {    //sending challenge to remote
@@ -524,6 +529,7 @@ while (proceed==true) {
       if (strlen(answer)==0)
         phase=999;      //no need to go further
       }
+      break;
     case 3      :       //Parsing the answer
       if ((resp=dig_parseresp(answer))==(RSPTYP *)0)
         phase=999;      //Unable to parse answer
index e93f51b75c10241a535f3e31e6450d1a581ffc99..4b730bab3e062d8b3268c707cae33853e8c842e4 100644 (file)
@@ -85,6 +85,7 @@ if (strlen(entry)>0) {
           resp->qop=strdup(ptr);
           break;
         case 6  :       //realm
+          (void) rou_alert(0,"REALM=<%s>",ptr);
           resp->realm=rou_freestr(resp->realm);
           resp->realm=strdup(ptr);
           break;
index cecc3c157f7ebf9bed7aa282cab1edae6222c9a6..ba1e40ef3af94c383d79801ab01422c8ebbbb2a8 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef        UNIDIG
 #define UNIDIG
 
-#define REALM    APPNAME"-email"
+#define REALM    APPNAME".email"
 
 typedef struct  {       //DIGEST-MD5 challange response structure
         char *username; //username requesting authentication