From 106a59cf23893ccd1893ba4a9fcdbeb4237ab5aa Mon Sep 17 00:00:00 2001 From: cameronrich Date: Tue, 5 Jul 2016 20:16:05 +0000 Subject: [PATCH] Removed some printfs in skeleton mode git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@258 9a5d90b5-6617-0410-8a86-bb477d3ed2e3 --- ssl/loader.c | 12 +++++++++--- ssl/openssl.c | 2 -- ssl/tls1.c | 7 +++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ssl/loader.c b/ssl/loader.c index 34ee3248d..3d0732390 100644 --- a/ssl/loader.c +++ b/ssl/loader.c @@ -82,7 +82,9 @@ EXP_FUNC int STDCALL ssl_obj_load(SSL_CTX *ssl_ctx, int obj_type, #ifdef CONFIG_SSL_HAS_PEM ret = ssl_obj_PEM_load(ssl_ctx, obj_type, ssl_obj, password); #else +#ifdef CONFIG_SSL_FULL_MODE printf("%s", unsupported_str); +#endif ret = SSL_ERROR_NOT_SUPPORTED; #endif } @@ -93,7 +95,9 @@ error: ssl_obj_free(ssl_obj); return ret; #else +#ifdef CONFIG_SSL_FULL_MODE printf("%s", unsupported_str); +#endif return SSL_ERROR_NOT_SUPPORTED; #endif /* CONFIG_SSL_SKELETON_MODE */ } @@ -150,7 +154,9 @@ static int do_obj(SSL_CTX *ssl_ctx, int obj_type, break; #endif default: +#ifdef CONFIG_SSL_FULL_MODE printf("%s", unsupported_str); +#endif ret = SSL_ERROR_NOT_SUPPORTED; break; } @@ -223,7 +229,7 @@ static int pem_decrypt(const char *where, const char *end, if (password == NULL || strlen(password) == 0) { #ifdef CONFIG_SSL_FULL_MODE - printf("Error: Need a password for this PEM file\n"); TTY_FLUSH(); + printf("Error: Need a password for this PEM file\n"); #endif goto error; } @@ -240,7 +246,7 @@ static int pem_decrypt(const char *where, const char *end, else { #ifdef CONFIG_SSL_FULL_MODE - printf("Error: Unsupported password cipher\n"); TTY_FLUSH(); + printf("Error: Unsupported password cipher\n"); #endif goto error; } @@ -475,7 +481,7 @@ error: #ifdef CONFIG_SSL_FULL_MODE if (ret) { - printf("Error: Certificate or key not loaded\n"); TTY_FLUSH(); + printf("Error: Certificate or key not loaded\n"); } #endif diff --git a/ssl/openssl.c b/ssl/openssl.c index 3518a7081..d0343e568 100644 --- a/ssl/openssl.c +++ b/ssl/openssl.c @@ -85,8 +85,6 @@ SSL * SSL_new(SSL_CTX *ssl_ctx) ssl = ssl_new(ssl_ctx, -1); /* fd is set later */ #ifdef CONFIG_SSL_ENABLE_CLIENT - ssl_func_type - if (ssl_func_type == SSLv3_client_method || ssl_func_type == TLSv1_client_method) { diff --git a/ssl/tls1.c b/ssl/tls1.c index 55a3bae8b..4407afe3c 100644 --- a/ssl/tls1.c +++ b/ssl/tls1.c @@ -1223,7 +1223,9 @@ int basic_read(SSL *ssl, uint8_t **in_data) /* check for sslv2 "client hello" */ if (buf[0] & 0x80 && buf[2] == 1) { - printf("Error: no SSLv23 handshaking allowed\n"); TTY_FLUSH(); +#ifdef CONFIG_SSL_FULL_MODE + printf("Error: no SSLv23 handshaking allowed\n"); +#endif ret = SSL_ERROR_NOT_SUPPORTED; goto error; /* not an error - just get out of here */ } @@ -2054,7 +2056,6 @@ void DISPLAY_STATE(SSL *ssl, int is_send, uint8_t state, int not_ok) } printf("%s\n", str); - TTY_FLUSH(); } /** @@ -2174,7 +2175,6 @@ EXP_FUNC void STDCALL ssl_display_error(int error_code) } printf("\n"); - TTY_FLUSH(); } /** @@ -2235,7 +2235,6 @@ void DISPLAY_ALERT(SSL *ssl, int alert) } printf("\n"); - TTY_FLUSH(); } #endif /* CONFIG_SSL_FULL_MODE */