phase=999; //no need to go further
}
break;
- case 5 : { //comparing challange answer
+ case 5 : { //comparing challenge answer
char *local;
char *hexa;
//(void) rou_alert(0,"%s anwr=<%s>",OPEP,answer);
//(void) rou_alert(0,"%s hexa=<%s>",OPEP,hexa);
if (strcmp(hexa,answer)!=0)
- (void) strncpy(passwd,"$1(ukn as cram_d5)",sizeof(passwd)-1);
+ (void) strncpy(passwd,"$1(ukn as cram_md5)",sizeof(passwd)-1);
(void) rou_asprintf(&decoded,"%s%s%s%s",IOBNULL,name,IOBNULL,passwd);
hexa=rou_freestr(hexa);
local=rou_freestr(local);
break;
}
if (strcmp(HA0,resp->response)!=0) {
- phase=999; //user NOT autheticated
+ //user authentication failed
+ curpass=rou_freestr(curpass);
+ (void) rou_asprintf(&curpass,"$1(ukn as digest_md5)");
}
HA0=rou_freestr(HA0);
}
case 3 : //getting "username password" accorind login type
switch (code) {
case 0 : //AUTH PLAIN
- decoded=get_auth_plain(contact,delay,local);
+ if (soc_iscrypted(contact->socptr)==true)
+ decoded=get_auth_plain(contact,delay,local);
+ else
+ (void) transmit(contact,true,"%d 5.7.3 Unsafe PLAIN auth mode",FAILED);
break;
case 1 : //AUTH LOGIN
- decoded=get_auth_login(contact,delay);
+ if (soc_iscrypted(contact->socptr)==true)
+ decoded=get_auth_login(contact,delay);
+ else
+ (void) transmit(contact,true,"%d 5.7.3 Unsafe LOGIN auth mode",FAILED);
break;
case 2 : //AUTH CRAM-MD5
decoded=get_auth_cram_md5(contact,delay);
char *str; //the message to display
}ehlo[]={
{1,"STARTTLS"},
+ {1,"AUTH CRAMD-MD5 DIGEST-MD5"},
{2,"AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5"},
{0,"SIZE "MXMSIZE},
{0,"8BITMIME"},