From ff1ab69986b9451eb06b2a90e1d09af94d85609e Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Sun, 6 Apr 2025 19:41:56 -0400 Subject: [PATCH] TLS connection seems to be working --- Makefile | 10 +++------- lib/devsoc.c | 4 ---- lib/gestcp.c | 2 +- lib/lvleml.c | 7 +++---- lib/subrou.c | 2 +- lib/unitls.c | 3 +-- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 4616842..0b5df99 100644 --- a/Makefile +++ b/Makefile @@ -75,20 +75,16 @@ dbgfeed : debug tlsrcvr : @ clear @ openssl s_client \ - -status \ - -msg \ - -debug \ + -crlf \ -CAfile certs/safe_CA.pem \ -cert certs/localhost_cert.pem \ -key certs/localhost_key.pem \ - -connect $(TESTIP):$(TESTPORT) \ - -starttls \ - smtp + -starttls smtp \ + -connect $(TESTIP):$(TESTPORT) xxx : @ clear @ openssl s_client \ - -state \ -crlf \ -key certs/localhost_key.pem \ -cert certs/localhost_cert.pem \ diff --git a/lib/devsoc.c b/lib/devsoc.c index 3c23c89..2766eaa 100644 --- a/lib/devsoc.c +++ b/lib/devsoc.c @@ -920,9 +920,7 @@ if (soc!=(SOCTYP *)0) { break; } (void) sigprocmask(SIG_SETMASK,(sigset_t *)0,&origmask); - (void) rou_alert(0,"%s JMPDBG Entering poll",OPEP); status=poll(polling,1,millisec); - (void) rou_alert(0,"%s JMPDBG Exiting poll",OPEP); (void) sigprocmask(SIG_SETMASK,&origmask,(sigset_t *)0); switch (status) { case -1 : //polling error @@ -1143,8 +1141,6 @@ while (proceed==true) { } soc->carin+=got; //managing carpile soc->carpile[soc->carin]='\000'; - (void) rou_alert(0,"%s JMPDBG so fare within carpile=<%s>", - OPEP,soc->carpile); break; } break; diff --git a/lib/gestcp.c b/lib/gestcp.c index 9fbfbd6..5531085 100644 --- a/lib/gestcp.c +++ b/lib/gestcp.c @@ -47,7 +47,7 @@ got=0; phase=0; proceed=true; while (proceed==true) { - (void) rou_alert(0,"JMPDBG %s phase='%d'",OPEP,phase); + //(void) rou_alert(0,"JMPDBG %s phase='%d'",OPEP,phase); switch (phase) { case 0 : //link still open? if (soc_receive(socptr)<0) { diff --git a/lib/lvleml.c b/lib/lvleml.c index aad5583..d2bbba7 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -112,7 +112,7 @@ if (contact!=(CONTYP *)0) { static _Bool dohelo(CONTYP *contact,char *parameter) { -#define OPEP "unieml.c:dohelo" +#define OPEP "lvleml.c:dohelo" #define DETAIL "HELO argument is mandatory, closing connection" _Bool done; @@ -172,7 +172,7 @@ static char *ehlostr[]= { (char *)0 }; -#define OPEP "unieml.c:doehlo" +#define OPEP "lvleml.c:doehlo" #define DETAIL "syntax error (domain part missing), closing connection" _Bool done; @@ -202,8 +202,7 @@ while (proceed==true) { if (contact->tlsok==true) strstart++; for (int i=strstart;ehlostr[i]!=(char *)0;i++) { - (void) rou_alert(0,"%s, JMPDNG i='%d'",OPEP,i); - (void) transmit(contact,"%d%s JMPDBG",CMDOK,ehlostr[i]); + (void) transmit(contact,"%d%s",CMDOK,ehlostr[i]); } done=true; break; diff --git a/lib/subrou.c b/lib/subrou.c index 0c217a5..7c75678 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -21,7 +21,7 @@ //version definition #define VERSION "0.6" -#define RELEASE "48" +#define RELEASE "49" #define BRANCH "dvl" //Public variables diff --git a/lib/unitls.c b/lib/unitls.c index 23307d8..23354d0 100644 --- a/lib/unitls.c +++ b/lib/unitls.c @@ -404,7 +404,7 @@ if (server==true) phase=0; proceed=true; while (proceed==true) { - (void) rou_alert(0,"%s JMPDBG phase='%d', serveur='%d'",OPEP,phase,server); + //(void) rou_alert(0,"%s JMPDBG phase='%d', serveur='%d'",OPEP,phase,server); switch (phase) { case 0 : //prepare the structure first; tls=(TLSTYP *)calloc(1,sizeof(TLSTYP)); @@ -523,7 +523,6 @@ if (tls!=(TLSTYP *)0) { status=0; proceed=false; sofar=SSL_write(tls->ssl,buffer,tosend); - (void) rou_alert(0,"%s JMPDBG sofar='%d'",OPEP,sofar); switch (sofar) { case -1 : //trouble to write switch (status=SSL_get_error(tls->ssl,-1)) { -- 2.47.3