*/
/********************************************************/
/* */
-/* Procedure to manage authentication in "cram-md5"*/
-/* mode, return a builded "decoded" string from */
+/* Procedure to manage authentication in */
+/* digest-md5 mode. */
+/* Return a builded "decoded" string from */
/* the exchange with the remote sereur */
/* */
/********************************************************/
cur.tv_nsec/=10000; //100 millisec
//(void) rou_asprintf(&seq,"<%05d-%s@%s>",
// cur.tv_nsec,contact->session->sessid,contact->locname);
-seq=strdup("<49591-13093-20250702204841-0377-0000@mailpostg.example.com>");
+seq=strdup("<01234567890ABCDEFGHIJKLMNOPQRST@mailpostg.example.com>");
+//seq=strdup("username = <jmp@safe.ca>");
(void) rou_alert(0,"%s JMPDBG SEQ=<%s>",OPEP,seq);
code=(char *)0;
usr=(USRTYP *)0;
phase=0;
proceed=true;
while (proceed==true) {
+ (void) rou_alert(0,"%s JMPDBG phase='%d'",OPEP,phase);
switch (phase) {
case 0 : { //preparing a string an sending it
char *b64;
b64=cnv_setb64(seq);
(void) transmit(contact,true,"%d %s",SENDB64,b64);
- line=strdup("webmaster@example.com ef8d00466c1196c0f170c735e7ea7080");
- got=strlen(line);
- //got=tcp_getline(contact->socptr,delay,&line);
+ got=tcp_getline(contact->socptr,delay,&line);
+ (void) rou_alert(0,"%s got<%s>",OPEP,line);
if (got<0)
phase=999; //Answer not received in due time
b64=rou_freestr(b64);
char *name; //extracted name
char *ptr;
- //code=cnv_getb64(line);
- code=strdup(line);
+ code=cnv_getb64(line);
+ (void) rou_alert(0,"%s JMPDBG md5 code=<%s>",OPEP,code);
name=(char *)0;
if ((ptr=strchr(code,' '))!=(char *)0) {
*ptr='\000';
break;
case 2 : { //comparing hmac
char *local;
- char hexa[100];
+ char *hexa;
//local=cnv_hashmd5(usr->passwd,(unsigned char *)seq);
local=cnv_hashmd5("mailleur",(unsigned char *)seq);
- (void) strcpy(hexa,"");
- for (int i=0;i<strlen(local);i++) {
- char convert[10];
-
- (void) strcat(convert,"---");
- (void) snprintf(convert,sizeof(convert),"%02hhX",local[i]);
- (void) strcat(hexa,convert);
- }
- (void) rou_alert(0,"JMPDBG local=<%s> hexa",hexa);
+ hexa=cnv_tohexa(local);
+ (void) rou_alert(0,"JMPDBG local =<%s>",hexa);
(void) rou_alert(0,"JMPDBG remote=<%s>",code);
+ hexa=rou_freestr(hexa);
local=rou_freestr(local);
usr=sql_freeusr(usr);
}
{
#define OPEP "lvleml.c:getauth,"
-static char *vocloc[]={"plain","login","cram-md5",(char *)0};
+static char *vocloc[]={"PLAIN","LOGIN","CRAM-MD5",(char *)0};
_Bool isok;
int code;
if ((decoded=get_auth_login(contact,delay))==(char *)0)
phase=999;
break;
- case 2 : //AUTH CRAM-MD5
+ case 2 : //AUTH DIGEST-MD5
if ((decoded=get_auth_md5(contact,delay))==(char *)0)
phase=999;
break;
/* Return true, if everything is fine */
/* */
/************************************************/
+//NOTE
+//MAIL FROM <sender> [BODY=7BIT|BODY=8BITMIME] [SIZE=number_of_bytes]
static _Bool getdata(CONTYP *contact)
{
"-STARTTLS",
"-8BITMIME",
"-ENHANCEDSTATUSCODES",
- " AUTH PLAIN LOGIN CRAM-MD5",
+ " AUTH CRAM-MD5 DIGEST-MD5",
(char *)0
};
break;
case c_auth : //Auth request
(void) getauth(contact,delay,line);
+ status=1; //JMPDBGevery thing fine
+ proceed=false;
break;
case c_rcpt : //Doing rpt scanning
if (checkto(contact,line)==false) {