diff options
Diffstat (limited to 'src/ssl.c')
-rw-r--r-- | src/ssl.c | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -54,13 +54,8 @@ #include <netinet/in.h> #include <netinet/tcp.h> -#include "asterisk.h" -ASTERISK_FILE_VERSION(__FILE__, "$Revision: 15611 $") - -#include "asterisk/logger.h" -#include "asterisk/options.h" -#include "asterisk/config.h" -#include "asterisk/ssl_addon.h" +#include "astmanproxy.h" +#include "ssl.h" SSL_CTX *sctx; static long rec_bytes; @@ -174,7 +169,7 @@ int saccept(int s) } while( err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE); SSL_set_mode(ssl, SSL_MODE_ENABLE_PARTIAL_WRITE); - ast_log(LOG_DEBUG, "ssl_addon: Connection accepted"); + debugmsg("ssl_addon: Connection accepted"); err=1; @@ -219,8 +214,8 @@ int m_recv(int s, void *buf, size_t len, int flags) if (ret > 0) rec_bytes += ret; - if (option_debug > 2) - ast_log(LOG_DEBUG, "Received data from SSL socket - %d\n", ret); + if (debug) + debugmsg("Received data from SSL socket - %d\n", ret); return ret; } @@ -255,7 +250,7 @@ int close_sock(int socket) */ int errexit(char s[]) { - ast_log(LOG_ERROR, "SSL critical error: %s", s); + debugmsg("SSL critical error: %s", s); return -1; } @@ -283,7 +278,7 @@ int is_encrypt_request(int sslclhellotimeout, int fd) ready_fdescriptors = select (fd + 1, &listeners, NULL, NULL, &tv); if (ready_fdescriptors < 0 ) { - ast_log(LOG_ERROR, "select returned error, This should not happen: \n"); + debugmsg("select returned error, This should not happen: \n"); return 0; } else if (ready_fdescriptors == 0) { return 0; @@ -295,12 +290,12 @@ int is_encrypt_request(int sslclhellotimeout, int fd) /* for tls buf[0x02] = 0x01 and ssl v3 buf[0x02] = 0x02 */ ((buf[0x02] == 0x00) || (buf[0x02] == 0x01))) { if (option_debug > 1) - ast_log(LOG_DEBUG, "Received a SSL request\n"); + debugmsg("Received a SSL request\n"); return 1; /* check for sslv23_client_method */ } else if ((buf[0x02] == 0x01) && (buf[0x03] == 0x03) && (buf[0x04] == 0x01)) { if (option_debug > 1) - ast_log(LOG_DEBUG, "Received a SSL request for SSLv23_client_method()\n"); + debugmsg("Received a SSL request for SSLv23_client_method()\n"); return 1; } /* check for sslv2 and return -1 */ |