]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Improving digmd5.c (tools)
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 7 Jul 2025 22:50:11 +0000 (18:50 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 7 Jul 2025 22:50:11 +0000 (18:50 -0400)
lib/unidig.h
tools/DIGEST-MD5 [moved from lib/DIGEST-MD5 with 100% similarity]
tools/DIGEST-MD5-1 [moved from lib/DIGEST-MD5-1 with 100% similarity]
tools/DIGEST-MD5-2 [moved from lib/DIGEST-MD5-2 with 100% similarity]
tools/digmd5.c

index 417322d87f3e9befbf5452d3891d493ec8617c49..d742a85ffac68e5c881cdde8acc027ebaa8c7a16 100644 (file)
@@ -30,10 +30,13 @@ extern RSPTYP *dig_freeresp(RSPTYP *resp);
 //the structure
 extern RSPTYP *dig_parseresp(char *response);
 
-//procedure to convert a string to a 128 Bit sequence
-//as a string
+//procedure to hash (md5) a string result is a MD5 arrays
 extern MD5TYP *dig_hashmd5(unsigned char *seq,unsigned int length);
 
+//procedure to convert an MD5 string (HEXA representation)
+//to an pure MD5TYP structure
+extern MD5TYP *dig_get_plain_md5(char *hexa);
+
 //Procedure to crypt a string with MD5 hash function
 extern char *dig_cryptmd5(const void *key,unsigned char *seq);
 
similarity index 100%
rename from lib/DIGEST-MD5
rename to tools/DIGEST-MD5
similarity index 100%
rename from lib/DIGEST-MD5-1
rename to tools/DIGEST-MD5-1
similarity index 100%
rename from lib/DIGEST-MD5-2
rename to tools/DIGEST-MD5-2
index cb915acdebe1666b31d81e291e30c3c2785cb597..a5a688193faf33de796c281231496ec0be1d48d6 100644 (file)
@@ -97,6 +97,7 @@ _Bool proceed;
 
 status=0;
 params=(ARGTYP *)0;
+foreground=true;
 phase=0;
 proceed=true;
 while (proceed==true) {
@@ -107,8 +108,9 @@ while (proceed==true) {
       break;
     case 1      :       //check if we have file to scan
       if (params->argc!=2) {
-        (void) rou_alert(0,"Unable to proceed with test\n");
-        (void) rou_alert(0,"\tthe test pattern number should be 2\n");
+        (void) rou_alert(0,"Unable to proceed with test");
+        (void) rou_alert(0,"\tthe test pattern number should be 2");
+        (void) rou_alert(0,"\tsee Makefile 'tstmd5:' entry as example");
         status=-1;
         phase=999;
         }
@@ -121,6 +123,14 @@ while (proceed==true) {
       break;
     case 3      :       //doing main task
       status=chkresponse(params->argc,params->argv);
+      switch (status) {
+        case 0  :
+          (void) rou_alert(0,"dig_hashresp is working ok");
+          break;
+        default :
+          (void) rou_alert(0,"dig_hashresp is NOT working fine");
+          break;
+        }
       break;
     case 4      :       //main task completed
       (void) prc_cleantitle();