Commit 9488401a authored by Nickilo's avatar Nickilo

Bug ssl variable globale sslReady

parent dc09dd61
......@@ -53,7 +53,7 @@ void readsmtp (SSL *ssl) {
while (loopCount<10 && found==0) {
loopCount++;
if (sslReady==1) {
if (ssl) {
zend_printf("SSL");
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 */
......@@ -87,7 +87,7 @@ void readsmtp (SSL *ssl) {
*
*/
void sendsmtp (char *msg,SSL *ssl) {
if (sslReady==1) {
if (ssl) {
if (INI_BOOL("mail_php.enable_debug")) {
zend_printf(msg);
}
......@@ -110,7 +110,7 @@ void sendsmtp (char *msg,SSL *ssl) {
*
*/
void writesmtp (char *msg,SSL *ssl) {
if (sslReady==1) {
if (ssl) {
if (INI_BOOL("mail_php.enable_debug")) {
zend_printf(msg);
}
......@@ -207,7 +207,7 @@ void appli (char *login,char *pass, char *from, char *to, char *reply, char *sub
size_t passBase64Len;
int nb;
char *toone;
SSL *ssl; /* Contexte SSL */
SSL *ssl=NULL; /* Contexte SSL */
/* Encodage login */
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
SSL_connect(ssl);
/* Ecrire sur le SSL */
sslReady=1;
zend_printf("TLS INIT OK\n");
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
sendsmtp("\r\n",ssl);
sendsmtp("QUIT\r\n",ssl);
if (sslReady==1) {
if (ssl) {
SSL_shutdown(ssl);
}
}
......
......@@ -36,9 +36,6 @@ int to_server_socket = -1;
/* Configuration du ssl on ou off */
int sslOn=0;
/* Le ssl est pret */
int sslReady=0;
/* Constante pour l'encodage en base 64 */
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