From 5ef1f87491ae232115a01572fabef3f233c2417b Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 5 Aug 2024 18:56:25 -0400 Subject: [PATCH] Starting to work on SSL exchange --- lib/devsoc.c | 1 - lib/gestcp.c | 4 ++-- lib/subrou.c | 2 +- lib/unissl.c | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/devsoc.c b/lib/devsoc.c index a9007f0..bc5b6b4 100644 --- a/lib/devsoc.c +++ b/lib/devsoc.c @@ -109,7 +109,6 @@ SOCTYP *newsoc; newsoc=(SOCTYP *)newsocket(); newsoc->proto=soc->proto; -newsoc->hostname=strdup(soc->hostname); newsoc->ip=strdup(soc->ip); newsoc->port=strdup(soc->port); newsoc->iteration=soc->iteration; diff --git a/lib/gestcp.c b/lib/gestcp.c index b803f01..a6ca573 100644 --- a/lib/gestcp.c +++ b/lib/gestcp.c @@ -155,8 +155,8 @@ while (proceed==true) { } break; case 2 : //check socket components - contact->locname=soc_getaddrinfo(contact->socptr,true,false); - contact->peerip=soc_getaddrinfo(contact->socptr,false,false); + contact->locname=soc_getaddrinfo(contact->socptr,true,true); + contact->peerip=soc_getaddrinfo(contact->socptr,false,true); if ((contact->locname==(char *)0)||(contact->peerip==(char *)0)) { (void) rou_alert(0,"%s Unable to establish contact entities",OPEP); contact=freecontact(contact); diff --git a/lib/subrou.c b/lib/subrou.c index f808aff..3c20ea8 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -20,7 +20,7 @@ //version definition #define VERSION "0.3" -#define RELEASE "23" +#define RELEASE "24" //Public variables PUBLIC int debug=0; //debug level diff --git a/lib/unissl.c b/lib/unissl.c index a68f7b3..238d6fa 100644 --- a/lib/unissl.c +++ b/lib/unissl.c @@ -56,7 +56,7 @@ proceed=true; while (proceed==true) { switch (phase) { case 0 : //Setting inital context - if ((ctx=SSL_CTX_new(tls_methode()))!=(SSL_CTX *)0) { + if ((ctx=SSL_CTX_new(tls_methode()))==(SSL_CTX *)0) { char reason[200]; (void) ERR_error_string(ERR_get_error(),reason); @@ -66,8 +66,8 @@ while (proceed==true) { } break; case 1 : //getting certificat name - certpub[0]="./cert.pem"; //JMPDBG test - certpub[1]="./key.pem"; //JMPDBG test + certpub[0]="./kleenex/cert.pem"; //JMPDBG test + certpub[1]="./kleenex/key.pem"; //JMPDBG test break; case 2 : //set certificate if (SSL_CTX_use_certificate_file(ctx,certpub[0],SSL_FILETYPE_PEM)!=1) { -- 2.47.3