diff --git a/configure.ac b/configure.ac index 2cffc0b..c1c8e78 100644 --- a/configure.ac +++ b/configure.ac @@ -188,10 +188,10 @@ AC_SUBST(GTK_CFLAGS) #--[ SSL ]---------------------------------------------------------------------------------------------------------------------------------------------------- -PKG_CHECK_MODULES( [SSL], [libssl], AC_DEFINE(HAVE_SSL), AC_MSG_NOTICE([libssl not present.]) ) +PKG_CHECK_MODULES( [LIBSSL], [libssl], AC_DEFINE(HAVE_LIBSSL), AC_MSG_NOTICE([libssl not present.]) ) -AC_SUBST(SSL_LIBS) -AC_SUBST(SSL_CFLAGS) +AC_SUBST(LIBSSL_LIBS) +AC_SUBST(LIBSSL_CFLAGS) #--[ Libraries ]---------------------------------------------------------------------------------------------------------------------------------------------- AC_SEARCH_LIBS( [sin], [m], AC_DEFINE(HAVE_LIBM), AC_MSG_NOTICE([libm not present.])) diff --git a/src/gtk/main.c b/src/gtk/main.c index 3460f35..d5cf924 100644 --- a/src/gtk/main.c +++ b/src/gtk/main.c @@ -70,7 +70,6 @@ static int popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title, gtk_dialog_run(GTK_DIALOG (dialog)); gtk_widget_destroy(dialog); - return 0; } diff --git a/src/lib3270/Makefile.in b/src/lib3270/Makefile.in index ccba747..e56e2cd 100644 --- a/src/lib3270/Makefile.in +++ b/src/lib3270/Makefile.in @@ -29,15 +29,15 @@ PACKAGE=@PACKAGE_NAME@ CFLAGS=@CFLAGS@ -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../../src/include -SSL_CFLAGS=@SSL_CFLAGS@ +SSL_CFLAGS=@LIBSSL_CFLAGS@ DLL_FLAGS=@DLL_FLAGS@ LDFLAGS=@LDFLAGS@ -LIBS=@LIBS@ @SSL_LIBS@ @SOCKET_LIBS@ +LIBS=@LIBS@ @LIBSSL_LIBS@ @SOCKET_LIBS@ DEBUG_CFLAGS=-DDEBUG=1 -g -DEPENDS ?= *.h ../../src/include/*.h +DEPENDS ?= *.h ../../src/include/*.h Makefile #---[ Tools ]------------------------------------------------------------------ @@ -79,7 +79,7 @@ SOURCES = XtGlue.c actions.c ansi.c charset.c ctlr.c \ #---[ Misc targets ]----------------------------------------------------------- Debug: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@ - + $(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) @echo $@ ... diff --git a/src/lib3270/host.c b/src/lib3270/host.c index 350f897..e773f72 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -258,8 +258,10 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, /* Strip leading whitespace. */ while (*s && isspace(*s)) s++; - if (!*s) { - popup_an_error(NULL,_( "Empty hostname" )); + + if (!*s) + { + popup_an_error(hSession,_( "Empty hostname" )); goto split_fail; } @@ -286,18 +288,32 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, case 'N': *non_e = True; break; -#if defined(HAVE_LIBSSL) /*[*/ +#if defined(HAVE_LIBSSL) case 'l': case 'L': *secure = True; break; -#endif /*]*/ +#else + case 'l': + case 'L': + popup_system_error(hSession, _( "SSL error" ), + _( "Unable to connect to secure hosts" ), + "%s", + _( "This version of " PACKAGE_NAME " was built without support for secure sockets layer (SSL)." ) + ); + + goto split_fail; +#endif // HAVE_LIBSSL case 'c': case 'C': *no_login = True; break; default: - popup_system_error(hSession,NULL,_("Hostname syntax error"),_("Option '%c:' not supported"),*s); + popup_system_error(hSession, _( "Hostname syntax error" ), + _( "Can't connect to host" ), + _( "Option '%c:' is not supported" ), + *s ); + goto split_fail; } *needed = True; diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index 8ef574a..06ecacd 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -1009,7 +1009,7 @@ void net_input(H3270 *session) trace_dsn("RCVD SSL_read error %ld (%s)\n", e, err_buf); - popup_an_error("SSL_read:\n%s", err_buf); + popup_an_error(NULL,"SSL_read:\n%s", err_buf); host_disconnect(session,True); return; } @@ -2019,7 +2019,7 @@ net_rawout(unsigned const char *buf, int len) e = ERR_get_error(); (void) ERR_error_string(e, err_buf); trace_dsn("RCVD SSL_write error %ld (%s)\n", e,err_buf); - popup_an_error("SSL_write:\n%s", err_buf); + popup_an_error(NULL,"SSL_write:\n%s", err_buf); host_disconnect(&h3270,False); return; } @@ -3216,7 +3216,7 @@ ssl_init(void) ssl_initted = True; ssl_ctx = SSL_CTX_new(SSLv23_method()); if (ssl_ctx == NULL) { - popup_an_error("SSL_CTX_new failed"); + popup_an_error(NULL,"SSL_CTX_new failed"); h3270.ssl_host = False; return; } @@ -3225,7 +3225,7 @@ ssl_init(void) ssl_con = SSL_new(ssl_ctx); if (ssl_con == NULL) { - popup_an_error("SSL_new failed"); + popup_an_error(NULL,"SSL_new failed"); h3270.ssl_host = False; } SSL_set_verify(ssl_con, 0/*xxx*/, NULL); @@ -3243,7 +3243,7 @@ ssl_init(void) e = ERR_get_error(); (void) ERR_error_string(e, err_buf); - popup_an_error("SSL_CTX_use_certificate_chain_file(" + popup_an_error(NULL,"SSL_CTX_use_certificate_chain_file(" "\"%s\") failed:\n%s", appres.cert_file, err_buf); } @@ -3338,7 +3338,7 @@ continue_tls(unsigned char *sbbuf, int len) if (len < 2 || sbbuf[1] != TLS_FOLLOWS) { /* Trace the junk. */ trace_dsn("%s ? %s\n", opt(TELOPT_STARTTLS), cmd(SE)); - popup_an_error("TLS negotiation failure"); + popup_an_error(NULL,"TLS negotiation failure"); net_disconnect(); return; } -- libgit2 0.21.2