From 76a25b57afbfad619bfe1482f0d90eba74cb4923 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Tue, 8 Jul 2025 06:57:30 -0400 Subject: [PATCH] tools chkhex seems to be working fine --- lib/unidig.c | 39 ++++++++++++++++++++++++++++++++ tools/Makefile | 37 ++++++++++++++++++++++++++++-- tools/chkhex.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 tools/chkhex.c diff --git a/lib/unidig.c b/lib/unidig.c index c812dbb..c327a5e 100644 --- a/lib/unidig.c +++ b/lib/unidig.c @@ -310,6 +310,45 @@ return hashmd5; */ /********************************************************/ /* */ +/* Procedure to convert an MD5TYP array in */ +/* hexadecimal structure to be a pure/plain MD5TYP */ +/* array. */ +/* Return (MD5TYP *)0 if trouble. */ +/* */ +/********************************************************/ +PUBLIC MD5TYP *dig_get_plain_md5(char *hexa) + +{ +MD5TYP *plain; + +plain=(MD5TYP *)0; +if (strlen(hexa)==sizeof(MD5TYP)*2) { + _Bool ok; + MD5TYP travail; + char tmp[3]; + + ok=true; + (void) memset(travail,'\000',sizeof(travail)); + (void) memset(tmp,'\000',sizeof(tmp)); + for (register int i=0;i +#include +#include +#include +#include +#include + +#include "subcnv.h" +#include "unidig.h" + +/* + +*/ +/********************************************************/ +/* */ +/* Main routine */ +/* Read the the hexadecimal number */ +/* convert it to binary and convert-it back*/ +/* to hexadecimal and compare it. */ +/* */ +/********************************************************/ +int main(int argc,char *argv[]) + +{ +int status; + +status=0; +for (int i=1;i\n",argv[i]); + } +return status; +} -- 2.47.3