From 9cd52ce928b25dcd74c7f617458707a5e9c496ef Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Wed, 2 Jul 2025 19:22:15 -0400 Subject: [PATCH] Starting to implement CRAM-MD5 function --- Makefile | 2 +- lib/lvleml.c | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6e7b9b2..5bd0a00 100644 --- a/Makefile +++ b/Makefile @@ -145,10 +145,10 @@ tlsref: -starttls smtp \ -connect courriel.colba.net:587 +# -connect mx2.free.fr:25 # -connect mailprod1.safe.ca:587 # -connect courriel.colba.net:25 # -connect courriel.colba.net:587 -# -connect smtp.google.com:25 # -connect $(TESTSRV):$(TESTPORT) #-------------------------------------------------------------------- diff --git a/lib/lvleml.c b/lib/lvleml.c index 66f0361..8cdfc4b 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -341,6 +341,24 @@ return decoded; */ /********************************************************/ /* */ +/* Procedure to manage authentication in "cram-md5"*/ +/* mode, return a builded "decoded" string from */ +/* the exchange with the remote sereur */ +/* */ +/********************************************************/ +static char *get_auth_md5(CONTYP *contact,int delay) + +{ +char *decoded; + +decoded=(char *)0; +return decoded; +} +/* +^L +*/ +/********************************************************/ +/* */ /* Procedure to manage authentication in "login" */ /* mode, return "decoded", NULL if not extracted */ /* */ @@ -464,7 +482,7 @@ static _Bool getauth(CONTYP *contact,int delay,char *buffer) { #define OPEP "lvleml.c:getauth," -static char *vocloc[]={"plain","login",(char *)0}; +static char *vocloc[]={"plain","login","cram-md5",(char *)0}; _Bool isok; int code; @@ -519,6 +537,10 @@ while (proceed==true) { if ((decoded=get_auth_login(contact,delay))==(char *)0) phase=999; break; + case 2 : //AUTH CRAM-MD5 + if ((decoded=get_auth_md5(contact,delay))==(char *)0) + phase=999; + break; default : //not yet implemented (void) transmit(contact,true,"%d 5.7.3 Unknown auth mode",FAILED); (void) rou_alert(0,"%s auth type <%d> not yet implemented",OPEP); @@ -971,7 +993,7 @@ static char *ehlostr[]= { "-STARTTLS", "-8BITMIME", "-ENHANCEDSTATUSCODES", - " AUTH PLAIN LOGIN", + " AUTH PLAIN LOGIN CRAM-MD5", (char *)0 }; -- 2.47.3