Commit 6750617b8ea6e7b593e511f8c0a8a18934330acb
1 parent
423a6f75
Exists in
master
and in
3 other branches
Partial fix of non-ssl windows build.
Showing
6 changed files
with
16 additions
and
8 deletions
Show diff stats
src/core/connect.c
| @@ -233,6 +233,7 @@ static int notify_crl_error(H3270 *hSession, int rc, const SSL_ERROR_MESSAGE *me | @@ -233,6 +233,7 @@ static int notify_crl_error(H3270 *hSession, int rc, const SSL_ERROR_MESSAGE *me | ||
| 233 | 233 | ||
| 234 | #if defined(HAVE_LIBSSL) | 234 | #if defined(HAVE_LIBSSL) |
| 235 | set_ssl_state(hSession,LIB3270_SSL_UNDEFINED); | 235 | set_ssl_state(hSession,LIB3270_SSL_UNDEFINED); |
| 236 | + hSession->ssl.host = 0; | ||
| 236 | #endif // HAVE_LIBSSL | 237 | #endif // HAVE_LIBSSL |
| 237 | 238 | ||
| 238 | snprintf(hSession->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",hSession->m3279 ? '9' : '8', hSession->model_num); | 239 | snprintf(hSession->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",hSession->m3279 ? '9' : '8', hSession->model_num); |
| @@ -240,7 +241,6 @@ static int notify_crl_error(H3270 *hSession, int rc, const SSL_ERROR_MESSAGE *me | @@ -240,7 +241,6 @@ static int notify_crl_error(H3270 *hSession, int rc, const SSL_ERROR_MESSAGE *me | ||
| 240 | lib3270_trace_event(hSession,"Reconnecting to %s\n",lib3270_get_url(hSession)); | 241 | lib3270_trace_event(hSession,"Reconnecting to %s\n",lib3270_get_url(hSession)); |
| 241 | 242 | ||
| 242 | hSession->ever_3270 = False; | 243 | hSession->ever_3270 = False; |
| 243 | - hSession->ssl.host = 0; | ||
| 244 | 244 | ||
| 245 | return net_reconnect(hSession,seconds); | 245 | return net_reconnect(hSession,seconds); |
| 246 | 246 |
src/core/host.c
| @@ -153,7 +153,10 @@ void lib3270_set_disconnected(H3270 *hSession) | @@ -153,7 +153,10 @@ void lib3270_set_disconnected(H3270 *hSession) | ||
| 153 | 153 | ||
| 154 | hSession->cstate = LIB3270_NOT_CONNECTED; | 154 | hSession->cstate = LIB3270_NOT_CONNECTED; |
| 155 | hSession->starting = 0; | 155 | hSession->starting = 0; |
| 156 | + | ||
| 157 | +#if defined(HAVE_LIBSSL) | ||
| 156 | hSession->ssl.state = LIB3270_SSL_UNDEFINED; | 158 | hSession->ssl.state = LIB3270_SSL_UNDEFINED; |
| 159 | +#endif // HAVE_LIBSSL | ||
| 157 | 160 | ||
| 158 | set_status(hSession,LIB3270_FLAG_UNDERA,False); | 161 | set_status(hSession,LIB3270_FLAG_UNDERA,False); |
| 159 | 162 | ||
| @@ -164,7 +167,9 @@ void lib3270_set_disconnected(H3270 *hSession) | @@ -164,7 +167,9 @@ void lib3270_set_disconnected(H3270 *hSession) | ||
| 164 | if(hSession->cbk.update_connect) | 167 | if(hSession->cbk.update_connect) |
| 165 | hSession->cbk.update_connect(hSession,0); | 168 | hSession->cbk.update_connect(hSession,0); |
| 166 | 169 | ||
| 170 | +#if defined(HAVE_LIBSSL) | ||
| 167 | hSession->cbk.update_ssl(hSession,hSession->ssl.state); | 171 | hSession->cbk.update_ssl(hSession,hSession->ssl.state); |
| 172 | +#endif // HAVE_LIBSSL | ||
| 168 | 173 | ||
| 169 | } | 174 | } |
| 170 | 175 | ||
| @@ -304,8 +309,6 @@ static void update_host(H3270 *h) | @@ -304,8 +309,6 @@ static void update_host(H3270 *h) | ||
| 304 | h->host.srvc | 309 | h->host.srvc |
| 305 | )); | 310 | )); |
| 306 | 311 | ||
| 307 | - trace("hosturl=[%s] ssl=%s",h->host.full,h->ssl.enabled ? "yes" : "no"); | ||
| 308 | - | ||
| 309 | } | 312 | } |
| 310 | 313 | ||
| 311 | LIB3270_EXPORT int lib3270_set_luname(H3270 *hSession, const char *luname) | 314 | LIB3270_EXPORT int lib3270_set_luname(H3270 *hSession, const char *luname) |
src/core/session.c
| @@ -287,7 +287,7 @@ static void set_peer_certificate(const X509 GNUC_UNUSED(*cert)) | @@ -287,7 +287,7 @@ static void set_peer_certificate(const X509 GNUC_UNUSED(*cert)) | ||
| 287 | 287 | ||
| 288 | } | 288 | } |
| 289 | #else | 289 | #else |
| 290 | -static void set_peer_certificate)(const void GNUC_UNUSED(*cert)) | 290 | +static void set_peer_certificate(const void GNUC_UNUSED(*cert)) |
| 291 | { | 291 | { |
| 292 | 292 | ||
| 293 | } | 293 | } |
src/core/telnet.c
| @@ -435,15 +435,18 @@ static int net_connected(H3270 *hSession) | @@ -435,15 +435,18 @@ static int net_connected(H3270 *hSession) | ||
| 435 | } | 435 | } |
| 436 | */ | 436 | */ |
| 437 | 437 | ||
| 438 | - trace_dsn(hSession,"Connected to %s%s.\n", hSession->host.current,hSession->ssl.host? " using SSL": ""); | ||
| 439 | - | ||
| 440 | #if defined(HAVE_LIBSSL) | 438 | #if defined(HAVE_LIBSSL) |
| 441 | /* Set up SSL. */ | 439 | /* Set up SSL. */ |
| 440 | + trace_dsn(hSession,"Connected to %s%s.\n", hSession->host.current,hSession->ssl.host? " using SSL": ""); | ||
| 441 | + | ||
| 442 | if(hSession->ssl.con && hSession->ssl.state == LIB3270_SSL_UNDEFINED) | 442 | if(hSession->ssl.con && hSession->ssl.state == LIB3270_SSL_UNDEFINED) |
| 443 | { | 443 | { |
| 444 | if(ssl_negotiate(hSession)) | 444 | if(ssl_negotiate(hSession)) |
| 445 | return -1; | 445 | return -1; |
| 446 | } | 446 | } |
| 447 | +#else | ||
| 448 | + trace_dsn(hSession,"Connected to %s.\n", hSession->host.current); | ||
| 449 | + | ||
| 447 | #endif | 450 | #endif |
| 448 | 451 | ||
| 449 | lib3270_setup_session(hSession); | 452 | lib3270_setup_session(hSession); |
src/core/windows/connect.c
| @@ -308,9 +308,10 @@ int net_reconnect(H3270 *hSession, int seconds) | @@ -308,9 +308,10 @@ int net_reconnect(H3270 *hSession, int seconds) | ||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | hSession->ever_3270 = False; | 310 | hSession->ever_3270 = False; |
| 311 | - hSession->ssl.host = 0; | ||
| 312 | 311 | ||
| 313 | #if defined(HAVE_LIBSSL) | 312 | #if defined(HAVE_LIBSSL) |
| 313 | + hSession->ssl.host = 0; | ||
| 314 | + | ||
| 314 | if(hSession->ssl.enabled) | 315 | if(hSession->ssl.enabled) |
| 315 | { | 316 | { |
| 316 | hSession->ssl.host = 1; | 317 | hSession->ssl.host = 1; |
src/include/lib3270-internals.h
| @@ -837,6 +837,8 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); | @@ -837,6 +837,8 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); | ||
| 837 | LIB3270_INTERNAL X509_CRL * lib3270_get_crl(H3270 *hSession, SSL_ERROR_MESSAGE * message, const char *url); | 837 | LIB3270_INTERNAL X509_CRL * lib3270_get_crl(H3270 *hSession, SSL_ERROR_MESSAGE * message, const char *url); |
| 838 | #endif // SSL_ENABLE_CRL_CHECK | 838 | #endif // SSL_ENABLE_CRL_CHECK |
| 839 | 839 | ||
| 840 | +#endif | ||
| 841 | + | ||
| 840 | /// @brief Clear element at adress. | 842 | /// @brief Clear element at adress. |
| 841 | LIB3270_INTERNAL void clear_chr(H3270 *hSession, int baddr); | 843 | LIB3270_INTERNAL void clear_chr(H3270 *hSession, int baddr); |
| 842 | 844 | ||
| @@ -847,5 +849,4 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); | @@ -847,5 +849,4 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); | ||
| 847 | 849 | ||
| 848 | LIB3270_INTERNAL char * lib3270_get_user_name(); | 850 | LIB3270_INTERNAL char * lib3270_get_user_name(); |
| 849 | 851 | ||
| 850 | -#endif | ||
| 851 | 852 |