From 6009e4774bf979369e14ca3683cf7536756a7968 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 26 May 2025 10:27:15 -0400 Subject: [PATCH] cipher information proprly inserted within email header --- lib/devsoc.c | 20 ++++++++++++++++++++ lib/devsoc.h | 3 +++ lib/lvleml.c | 7 +++---- lib/unitls.c | 1 - 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lib/devsoc.c b/lib/devsoc.c index bb71daa..6757dd3 100644 --- a/lib/devsoc.c +++ b/lib/devsoc.c @@ -1508,6 +1508,26 @@ return iscrypted; */ /********************************************************/ /* */ +/* Procedure to return all cipher information */ +/* */ +/********************************************************/ +PUBLIC const char *soc_getcipherid(SOCPTR *socptr) + +{ +const char *cipherid; +SOCTYP *soc; + +cipherid=(const char *)0; +soc=(SOCTYP *)socptr; +if (soc!=(SOCTYP *)0) + cipherid=tls_getcipherid(soc->tls); +return cipherid; +} +/* +^L +*/ +/********************************************************/ +/* */ /* Procedure to get the cipher name used in cypted */ /* mode. */ /* */ diff --git a/lib/devsoc.h b/lib/devsoc.h index c8aad37..b0ffad5 100644 --- a/lib/devsoc.h +++ b/lib/devsoc.h @@ -97,6 +97,9 @@ extern _Bool soc_iscrypted(SOCPTR *socptr); //return the cipher mame used on the crypted link extern const char *soc_get_cipher_name(SOCPTR *socptr); +//return all cipher information +extern const char *soc_getcipherid(SOCPTR *socptr); + //return line socket mode (cleartext, crypted) extern const char *soc_getstrmode(SOCPTR *socptr); diff --git a/lib/lvleml.c b/lib/lvleml.c index b9a6d5d..010403d 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -200,8 +200,8 @@ proceed=true; while (proceed==true) { switch (phase) { case 0 : //Inserting the remote information - (void) fprintf(data,"Received: from %s ([%s])\n", - contact->peername,contact->peerip); + (void) fprintf(data,"Received: from %s (IP=[%s], originator=<%s>)\n", + contact->peername,contact->peerip,contact->mailfrom); break; case 1 : //Inserting the Receive information (void) fprintf(data,"\tby %s ([%s:%s]/%s-%s) with ESMTP\n", @@ -210,7 +210,7 @@ while (proceed==true) { break; case 2 : //Inserting TLS information if (soc_iscrypted(contact->socptr)==true) { - (void) fprintf(data,"\t(JMPDBG crypted)\n"); + (void) fprintf(data,"\t(%s)\n",soc_getcipherid(contact->socptr)); } break; case 3 : //Inserting ID information @@ -732,7 +732,6 @@ while (proceed==true) { break; //no need to go further } - (void) rou_alert(0,"%s JMPDBG got <%s>",OPEP,line); (void) log_fprintlog(contact->logptr,false,"%s",line); code=eml_getcode(line); switch (code) { diff --git a/lib/unitls.c b/lib/unitls.c index f4d2e93..a2992df 100644 --- a/lib/unitls.c +++ b/lib/unitls.c @@ -422,7 +422,6 @@ while (proceed==true) { cipherid=(char *)calloc(1,MXID); (void) snprintf(cipherid,MXID,"version=%s cipher=%s bits=%d verify=%s", version,name,bits,verif); - (void) rou_alert(0,"%s cipherid=<%s>",OPEP,cipherid); break; default : //SAFE Guard proceed=false; -- 2.47.3