From 7dd1add60b0d2527f1a80ddcb9020529cb3a7911 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 15 Oct 2019 16:14:20 -0300 Subject: [PATCH] Fixing warnings and SSL information dialogs. --- src/core/wait.c | 2 +- src/include/lib3270.h | 2 +- src/ssl/linux/ldap.c | 2 ++ src/ssl/negotiate.c | 4 +++- src/ssl/properties.c | 10 ++-------- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/core/wait.c b/src/core/wait.c index d20d873..74ce1fc 100644 --- a/src/core/wait.c +++ b/src/core/wait.c @@ -34,7 +34,7 @@ /*---[ Implement ]------------------------------------------------------------------------------------------*/ -LIB3270_EXPORT int lib3270_wait_for_update(H3270 *hSession, int seconds) +LIB3270_EXPORT int lib3270_wait_for_update(H3270 GNUC_UNUSED(*hSession), int GNUC_UNUSED(seconds)) { return errno = ENOTSUP; } diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 49f7788..4099e44 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -493,7 +493,7 @@ LIB3270_EXPORT const char * lib3270_get_crl_url(const H3270 *hSession); LIB3270_EXPORT int lib3270_set_crl_prefered_protocol(H3270 *hSession, const char *protocol); - LIB3270_EXPORT const char * lib3270_get_crl_prefered_protocol(H3270 *hSession); + LIB3270_EXPORT const char * lib3270_get_crl_prefered_protocol(const H3270 *hSession); /** * @brief Get hostname for the connect/reconnect operations. diff --git a/src/ssl/linux/ldap.c b/src/ssl/linux/ldap.c index 2c32958..2bb3cfe 100644 --- a/src/ssl/linux/ldap.c +++ b/src/ssl/linux/ldap.c @@ -39,6 +39,8 @@ #include #include +#include "utilc.h" + #if defined(HAVE_LIBSSL) && defined(SSL_ENABLE_CRL_CHECK) && defined(HAVE_LDAP) #include diff --git a/src/ssl/negotiate.c b/src/ssl/negotiate.c index 45c0bca..ffe5831 100644 --- a/src/ssl/negotiate.c +++ b/src/ssl/negotiate.c @@ -134,7 +134,7 @@ static int background_ssl_init(H3270 *hSession, void *message) } #if !defined(SSL_DEFAULT_CRL_URL) && defined(SSL_ENABLE_CRL_CHECK) -int x509_store_ctx_error_callback(int ok, X509_STORE_CTX *ctx) +int x509_store_ctx_error_callback(int ok, X509_STORE_CTX GNUC_UNUSED(*ctx)) { debug("%s(%d)",__FUNCTION__,ok); @@ -266,6 +266,8 @@ static int background_ssl_negotiation(H3270 *hSession, void *message) else rv = X509_V_OK; + SSL_set_verify_result(hSession->ssl.con, rv); + X509_STORE_CTX_free(csc); #else diff --git a/src/ssl/properties.c b/src/ssl/properties.c index 80e9b63..c3aadca 100644 --- a/src/ssl/properties.c +++ b/src/ssl/properties.c @@ -176,7 +176,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" - const char * lib3270_get_crl_prefered_protocol(H3270 *hSession) + const char * lib3270_get_crl_prefered_protocol(const H3270 *hSession) { #ifdef SSL_ENABLE_CRL_CHECK if(hSession->ssl.crl.prefer) @@ -198,13 +198,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio if(hSession->ssl.crl.prefer) { - free(hSession->ssl.crl.prefer); - hSession->ssl.crl.prefer = NULL; - } - - if(hSession->ssl.crl.prefer) - { - X509_CRL_free(hSession->ssl.crl.prefer); + lib3270_free(hSession->ssl.crl.prefer); hSession->ssl.crl.prefer = NULL; } -- libgit2 0.21.2