Commit 0b3a12429a2f2d877077975e278ec2a82022d9ea

Authored by Perry Werneck
1 parent fdc2fb32

Adding openssl info in the version string

Fixing windows builds
Showing 2 changed files with 23 additions and 0 deletions   Show diff stats
src/core/util.c
@@ -40,6 +40,10 @@ @@ -40,6 +40,10 @@
40 #include <lib3270/selection.h> 40 #include <lib3270/selection.h>
41 #include <lib3270/log.h> 41 #include <lib3270/log.h>
42 42
  43 +#if defined(HAVE_LIBSSL)
  44 + #include <openssl/opensslv.h>
  45 +#endif // HAVE_LIBSSL
  46 +
43 #define my_isspace(c) isspace((unsigned char)c) 47 #define my_isspace(c) isspace((unsigned char)c)
44 48
45 /** 49 /**
@@ -367,7 +371,18 @@ LIB3270_EXPORT const char * lib3270_get_revision(void) @@ -367,7 +371,18 @@ LIB3270_EXPORT const char * lib3270_get_revision(void)
367 371
368 LIB3270_EXPORT char * lib3270_get_version_info(void) 372 LIB3270_EXPORT char * lib3270_get_version_info(void)
369 { 373 {
  374 +#if defined(HAVE_LIBSSL)
  375 + return lib3270_strdup_printf(
  376 + "%s version %s-%s build %s (%s)",
  377 + PACKAGE_NAME,
  378 + PACKAGE_VERSION,
  379 + PACKAGE_RELEASE,
  380 + RPQ_TIMESTAMP_VALUE,
  381 + OPENSSL_VERSION_TEXT
  382 + );
  383 +#else
370 return lib3270_strdup_printf("%s version %s-%s build %s",PACKAGE_NAME,PACKAGE_VERSION,PACKAGE_RELEASE,RPQ_TIMESTAMP_VALUE); 384 return lib3270_strdup_printf("%s version %s-%s build %s",PACKAGE_NAME,PACKAGE_VERSION,PACKAGE_RELEASE,RPQ_TIMESTAMP_VALUE);
  385 +#endif // HAVE_LIBSSL
371 } 386 }
372 387
373 void lib3270_popup_an_errno(H3270 *hSession, int errn, const char *fmt, ...) 388 void lib3270_popup_an_errno(H3270 *hSession, int errn, const char *fmt, ...)
src/ssl/negotiate.c
@@ -200,14 +200,22 @@ static int background_ssl_negotiation(H3270 *hSession, void *message) @@ -200,14 +200,22 @@ static int background_ssl_negotiation(H3270 *hSession, void *message)
200 200
201 if( (protocol = get_protocol_from_id(hSession->ssl.protocol.min_version)) != NULL ) 201 if( (protocol = get_protocol_from_id(hSession->ssl.protocol.min_version)) != NULL )
202 { 202 {
  203 +#if (OPENSSL_VERSION_NUMBER >= 0x1010009fL)
203 trace_ssl(hSession,"Minimum protocol version set to %s\n",protocol->description); 204 trace_ssl(hSession,"Minimum protocol version set to %s\n",protocol->description);
204 SSL_set_min_proto_version(hSession->ssl.con,protocol->id); 205 SSL_set_min_proto_version(hSession->ssl.con,protocol->id);
  206 +#else
  207 + trace_ssl(hSession,"Can't set minimum protocol version to %s\n",protocol->description);
  208 +#endif // OPENSSL_VERSION_NUMBER
205 } 209 }
206 210
207 if( (protocol = get_protocol_from_id(hSession->ssl.protocol.max_version)) != NULL ) 211 if( (protocol = get_protocol_from_id(hSession->ssl.protocol.max_version)) != NULL )
208 { 212 {
  213 +#if (OPENSSL_VERSION_NUMBER >= 0x1010009fL)
209 trace_ssl(hSession,"Maximum protocol version set to %s\n",protocol->description); 214 trace_ssl(hSession,"Maximum protocol version set to %s\n",protocol->description);
210 SSL_set_max_proto_version(hSession->ssl.con,protocol->id); 215 SSL_set_max_proto_version(hSession->ssl.con,protocol->id);
  216 +#else
  217 + trace_ssl(hSession,"Can't set maximum protocol version to %s\n",protocol->description);
  218 +#endif // OPENSSL_VERSION_NUMBER
211 } 219 }
212 220
213 if(SSL_set_fd(hSession->ssl.con, hSession->connection.sock) != 1) 221 if(SSL_set_fd(hSession->ssl.con, hSession->connection.sock) != 1)