Commit 2a12b812f491baec3b208f570c081f565ae136a0
1 parent
36dc653d
Exists in
master
and in
5 other branches
Indicador de SSL não estava atualizando em algumas situações.
Showing
4 changed files
with
25 additions
and
26 deletions
Show diff stats
src/lib3270/host.c
| ... | ... | @@ -135,12 +135,19 @@ void lib3270_set_disconnected(H3270 *hSession) |
| 135 | 135 | |
| 136 | 136 | hSession->cstate = LIB3270_NOT_CONNECTED; |
| 137 | 137 | hSession->starting = 0; |
| 138 | + hSession->secure = LIB3270_SSL_UNDEFINED; | |
| 138 | 139 | |
| 139 | 140 | set_status(hSession,OIA_FLAG_UNDERA,False); |
| 141 | + | |
| 140 | 142 | lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False); |
| 143 | + | |
| 141 | 144 | status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED); |
| 145 | + | |
| 142 | 146 | if(hSession->update_connect) |
| 143 | 147 | hSession->update_connect(hSession,0); |
| 148 | + | |
| 149 | + hSession->update_ssl(hSession,hSession->secure); | |
| 150 | + | |
| 144 | 151 | } |
| 145 | 152 | |
| 146 | 153 | /* Register a function interested in a state change. */ | ... | ... |
src/lib3270/ssl.c
| ... | ... | @@ -418,16 +418,6 @@ void ssl_info_callback(INFO_CONST SSL *s, int where, int ret) |
| 418 | 418 | |
| 419 | 419 | #endif /*]*/ |
| 420 | 420 | |
| 421 | -LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session) | |
| 422 | -{ | |
| 423 | - CHECK_SESSION_HANDLE(session); | |
| 424 | - | |
| 425 | - if(!lib3270_is_connected(session)) | |
| 426 | - return LIB3270_SSL_UNDEFINED; | |
| 427 | - | |
| 428 | - return session->secure; | |
| 429 | -} | |
| 430 | - | |
| 431 | 421 | LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession) |
| 432 | 422 | { |
| 433 | 423 | return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE; |
| ... | ... | @@ -443,12 +433,22 @@ LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession) |
| 443 | 433 | return -1; |
| 444 | 434 | } |
| 445 | 435 | |
| 436 | +LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session) | |
| 437 | +{ | |
| 438 | + CHECK_SESSION_HANDLE(session); | |
| 439 | + | |
| 440 | + return session->secure; | |
| 441 | +} | |
| 442 | + | |
| 446 | 443 | void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state) |
| 447 | 444 | { |
| 445 | + CHECK_SESSION_HANDLE(session); | |
| 446 | + | |
| 448 | 447 | if(state == session->secure) |
| 449 | 448 | return; |
| 450 | 449 | |
| 450 | + session->secure = state; | |
| 451 | 451 | trace_dsn(session,"SSL state changes to %d\n",(int) state); |
| 452 | 452 | |
| 453 | - session->update_ssl(session,session->secure = state); | |
| 453 | + session->update_ssl(session,session->secure); | |
| 454 | 454 | } | ... | ... |
src/pw3270/v3270/oia.c
| ... | ... | @@ -1081,6 +1081,8 @@ void v3270_stop_timer(GtkWidget *widget) |
| 1081 | 1081 | |
| 1082 | 1082 | void v3270_update_ssl(H3270 *session, LIB3270_SSL_STATE state) |
| 1083 | 1083 | { |
| 1084 | + debug("%s **************************************** %d",__FUNCTION__,(int) state); | |
| 1085 | + | |
| 1084 | 1086 | v3270 * terminal = GTK_V3270(session->user_data); |
| 1085 | 1087 | cairo_t * cr; |
| 1086 | 1088 | GdkRectangle * r; | ... | ... |
src/pw3270/v3270/widget.c
| ... | ... | @@ -226,28 +226,22 @@ gboolean v3270_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboa |
| 226 | 226 | { |
| 227 | 227 | if(!lib3270_connected(GTK_V3270(widget)->host)) |
| 228 | 228 | { |
| 229 | -#if GTK_CHECK_VERSION(2,14,0) | |
| 229 | +#ifndef _WIN32 | |
| 230 | 230 | gtk_tooltip_set_icon_from_icon_name(tooltip,"gtk-disconnect",GTK_ICON_SIZE_MENU); |
| 231 | -#else | |
| 232 | - gtk_tooltip_set_icon_from_stock(tooltip,GTK_STOCK_DISCONNECT,GTK_ICON_SIZE_MENU); | |
| 233 | 231 | #endif // GTK_CHECK_VERSION |
| 234 | 232 | gtk_tooltip_set_markup(tooltip,_( "<b>Identity not verified</b>\nDisconnected from host" ) ); |
| 235 | 233 | } |
| 236 | 234 | else if(lib3270_get_secure(GTK_V3270(widget)->host) == LIB3270_SSL_UNSECURE) |
| 237 | 235 | { |
| 238 | -#if GTK_CHECK_VERSION(2,14,0) | |
| 236 | +#ifndef _WIN32 | |
| 239 | 237 | gtk_tooltip_set_icon_from_icon_name(tooltip,"dialog-information",GTK_ICON_SIZE_MENU); |
| 240 | -#else | |
| 241 | - gtk_tooltip_set_icon_from_stock(tooltip,GTK_STOCK_INFO,GTK_ICON_SIZE_MENU); | |
| 242 | 238 | #endif |
| 243 | 239 | gtk_tooltip_set_markup(tooltip,_( "<b>Identity not verified</b>\nThe connection is insecure" ) ); |
| 244 | 240 | } |
| 245 | 241 | else if(!lib3270_get_SSL_verify_result(GTK_V3270(widget)->host)) |
| 246 | 242 | { |
| 247 | -#if GTK_CHECK_VERSION(2,14,0) | |
| 243 | +#ifndef _WIN32 | |
| 248 | 244 | gtk_tooltip_set_icon_from_icon_name(tooltip,"gtk-dialog-authentication",GTK_ICON_SIZE_MENU); |
| 249 | -#else | |
| 250 | - gtk_tooltip_set_icon_from_stock(tooltip,GTK_STOCK_DIALOG_AUTHENTICATION,GTK_ICON_SIZE_MENU); | |
| 251 | 245 | #endif |
| 252 | 246 | gtk_tooltip_set_markup(tooltip,_( "<b>Identity verified</b>\nThe connection is secure" ) ); |
| 253 | 247 | } |
| ... | ... | @@ -258,10 +252,8 @@ gboolean v3270_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboa |
| 258 | 252 | if(msg) |
| 259 | 253 | { |
| 260 | 254 | gchar *text = g_strdup_printf("<b>%s</b>\n%s",_("Identity not verified"),gettext(msg->text)); |
| 261 | -#if GTK_CHECK_VERSION(2,14,0) | |
| 255 | +#ifndef _WIN32 | |
| 262 | 256 | gtk_tooltip_set_icon_from_icon_name(tooltip,msg->icon,GTK_ICON_SIZE_MENU); |
| 263 | -#else | |
| 264 | - gtk_tooltip_set_icon_from_stock(tooltip,msg->icon,GTK_ICON_SIZE_MENU); | |
| 265 | 257 | #endif |
| 266 | 258 | gtk_tooltip_set_markup(tooltip,text); |
| 267 | 259 | g_free(text); |
| ... | ... | @@ -269,10 +261,8 @@ gboolean v3270_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboa |
| 269 | 261 | else |
| 270 | 262 | { |
| 271 | 263 | gchar *text = g_strdup_printf(_("<b>SSL state is undefined</b>Unexpected SSL status %ld"),lib3270_get_SSL_verify_result(GTK_V3270(widget)->host)); |
| 272 | -#if GTK_CHECK_VERSION(2,14,0) | |
| 264 | +#ifndef _WIN32 | |
| 273 | 265 | gtk_tooltip_set_icon_from_icon_name(tooltip,"dialog-error",GTK_ICON_SIZE_MENU); |
| 274 | -#else | |
| 275 | - gtk_tooltip_set_icon_from_stock(tooltip,GTK_STOCK_DIALOG_ERROR,GTK_ICON_SIZE_MENU); | |
| 276 | 266 | #endif // GTK_CHECK_VERSION |
| 277 | 267 | gtk_tooltip_set_markup(tooltip,text); |
| 278 | 268 | g_free(text); | ... | ... |