From 1304b4b9444ce7485c863402c806300649eb870c Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 7 Jul 2025 05:01:30 -0400 Subject: [PATCH] Put back a digmd5.c functional tools --- Makefile.dist | 5 ++++- lib/lvleml.c | 4 ++-- tools/Makefile | 2 +- tools/digmd5.c | 19 +++++++++++++------ tools/toremake | 0 5 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 tools/toremake diff --git a/Makefile.dist b/Makefile.dist index e937c4b..2c58bce 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -34,10 +34,10 @@ tarfile : clean $(APLV)/bin \ $(APLV)/lib \ $(APLV)/linux \ - $(APLV)/nodb \ $(APLV)/shell \ $(APLV)/sysconfig \ $(APLV)/support \ + $(APLV)/tools \ $(APLV) @ date > $(APLV)/$(APLV).build_date @ cp -a Makefile* $(APLV)/ @@ -54,6 +54,9 @@ tarfile : clean @ cp -a \ shell/getsysos.sh \ $(APLV)/shell/ + @ cp -a \ + tools/ \ + $(APLV)/ @ cp -a support/*.sh \ $(APLV)/support @ cp -a sysconfig/* \ diff --git a/lib/lvleml.c b/lib/lvleml.c index 881e30a..d2921be 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -366,8 +366,8 @@ static char *get_auth_cram_md5(CONTYP *contact,int delay) char *decoded; char challenge[300]; char answer[300]; -char name[100]; -char passwd[100]; +char name[300]; +char passwd[300]; int phase; _Bool proceed; diff --git a/tools/Makefile b/tools/Makefile index da59d8b..e4c1536 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -14,7 +14,7 @@ exe : clean : - - rm -fr *.o $(EXE) + - rm -fr *.o $(EXE) toremake - rm -fr ../bin/* #-------------------------------------------------------------------- diff --git a/tools/digmd5.c b/tools/digmd5.c index 7cf81f8..cb915ac 100644 --- a/tools/digmd5.c +++ b/tools/digmd5.c @@ -46,14 +46,21 @@ proceed=(cleartext!=(char *)0); while (proceed==true) { switch (phase) { case 0 : //extracting data - (void) rou_alert(1,"cleartext=<%s>",cleartext); + (void) rou_alert(0,"cleartext=<%s>",cleartext); resp=dig_parseresp(cleartext); break; - case 1 : //checking - /* - if (dig_checkresp(resp,argv[0])==true) - status=0; - */ + case 1 : { //checking + char *HA0; + + if ((HA0=dig_hashresp(resp,"AUTHENTICATE",argv[0]))!=(char *)0) { + if (strcmp(HA0,resp->response)==0) { + (void) rou_alert(0,"Expected=<%s>",resp->response); + (void) rou_alert(0,"Computed=<%s>",HA0); + status=0; + } + HA0=rou_freestr(HA0); + } + } break; case 2 : //free memory resp=dig_freeresp(resp); diff --git a/tools/toremake b/tools/toremake deleted file mode 100644 index e69de29..0000000 -- 2.47.3