Commit 9488401a authored by Nickilo's avatar Nickilo

Bug ssl variable globale sslReady

parent dc09dd61
...@@ -53,7 +53,7 @@ void readsmtp (SSL *ssl) { ...@@ -53,7 +53,7 @@ void readsmtp (SSL *ssl) {
while (loopCount<10 && found==0) { while (loopCount<10 && found==0) {
loopCount++; loopCount++;
if (sslReady==1) { if (ssl) {
zend_printf("SSL"); zend_printf("SSL");
int longueur=SSL_read(ssl, buf, PACKET_SIZE); int longueur=SSL_read(ssl, buf, PACKET_SIZE);
buf[longueur]='\0'; /* Positionner le caractere de fin de chaine pour ne pas avoir les dechets du buffer */ buf[longueur]='\0'; /* Positionner le caractere de fin de chaine pour ne pas avoir les dechets du buffer */
...@@ -87,7 +87,7 @@ void readsmtp (SSL *ssl) { ...@@ -87,7 +87,7 @@ void readsmtp (SSL *ssl) {
* *
*/ */
void sendsmtp (char *msg,SSL *ssl) { void sendsmtp (char *msg,SSL *ssl) {
if (sslReady==1) { if (ssl) {
if (INI_BOOL("mail_php.enable_debug")) { if (INI_BOOL("mail_php.enable_debug")) {
zend_printf(msg); zend_printf(msg);
} }
...@@ -110,7 +110,7 @@ void sendsmtp (char *msg,SSL *ssl) { ...@@ -110,7 +110,7 @@ void sendsmtp (char *msg,SSL *ssl) {
* *
*/ */
void writesmtp (char *msg,SSL *ssl) { void writesmtp (char *msg,SSL *ssl) {
if (sslReady==1) { if (ssl) {
if (INI_BOOL("mail_php.enable_debug")) { if (INI_BOOL("mail_php.enable_debug")) {
zend_printf(msg); zend_printf(msg);
} }
...@@ -207,7 +207,7 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub ...@@ -207,7 +207,7 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub
size_t passBase64Len; size_t passBase64Len;
int nb; int nb;
char *toone; char *toone;
SSL *ssl; /* Contexte SSL */ SSL *ssl=NULL; /* Contexte SSL */
/* Encodage login */ /* Encodage login */
loginBase64Len = base64_encode(login, strlen(login), &loginBase64); loginBase64Len = base64_encode(login, strlen(login), &loginBase64);
...@@ -262,7 +262,6 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub ...@@ -262,7 +262,6 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub
SSL_connect(ssl); SSL_connect(ssl);
/* Ecrire sur le SSL */ /* Ecrire sur le SSL */
sslReady=1;
zend_printf("TLS INIT OK\n"); zend_printf("TLS INIT OK\n");
writesmtp(INI_STR("mail_php.smtp_helo"),ssl); writesmtp(INI_STR("mail_php.smtp_helo"),ssl);
...@@ -360,7 +359,7 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub ...@@ -360,7 +359,7 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub
sendsmtp("\r\n",ssl); sendsmtp("\r\n",ssl);
sendsmtp("QUIT\r\n",ssl); sendsmtp("QUIT\r\n",ssl);
if (sslReady==1) { if (ssl) {
SSL_shutdown(ssl); SSL_shutdown(ssl);
} }
} }
......
...@@ -36,9 +36,6 @@ int to_server_socket = -1; ...@@ -36,9 +36,6 @@ int to_server_socket = -1;
/* Configuration du ssl on ou off */ /* Configuration du ssl on ou off */
int sslOn=0; int sslOn=0;
/* Le ssl est pret */
int sslReady=0;
/* Constante pour l'encodage en base 64 */ /* Constante pour l'encodage en base 64 */
static const char table64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char table64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment