TLS: new method to specify SSL/TLS version

SSL/TLS protocols only listed in ssl_protocols should be used.
The name "ssl_protocols" comes from nginx.

Resolves #428.
This commit is contained in:
Koichiro IWAO
2016-12-13 15:49:13 +09:00
committed by metalefty
parent 657f6f3756
commit e94ab10e14
8 changed files with 49 additions and 16 deletions
+7 -6
View File
@@ -535,7 +535,7 @@ ssl_tls_print_error(const char *func, SSL *connection, int value)
/*****************************************************************************/
int APP_CC
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
const char *tls_ciphers)
{
int connection_status;
@@ -544,13 +544,14 @@ ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
/**
* SSL_OP_NO_SSLv2
* SSLv3 is used by, eg. Microsoft RDC for Mac OS X.
* No SSLv3 if disableSSLv3=yes so only tls used
*/
options |= SSL_OP_NO_SSLv2;
if (disableSSLv3)
{
options |= SSL_OP_NO_SSLv3;
}
/**
* Disable SSL protocols not listed in ssl_protocols.
*/
options |= ssl_protocols;
#if defined(SSL_OP_NO_COMPRESSION)
/**
+1 -1
View File
@@ -96,7 +96,7 @@ struct ssl_tls
struct ssl_tls *APP_CC
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
int APP_CC
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
const char *tls_ciphers);
int APP_CC
ssl_tls_disconnect(struct ssl_tls *self);
+2 -2
View File
@@ -882,7 +882,7 @@ trans_get_out_s(struct trans *self, int size)
/* returns error */
int APP_CC
trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
int disableSSLv3, const char *tls_ciphers)
long ssl_protocols, const char *tls_ciphers)
{
self->tls = ssl_tls_create(self, key, cert);
if (self->tls == NULL)
@@ -891,7 +891,7 @@ trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
return 1;
}
if (ssl_tls_accept(self->tls, disableSSLv3, tls_ciphers) != 0)
if (ssl_tls_accept(self->tls, ssl_protocols, tls_ciphers) != 0)
{
g_writeln("trans_set_tls_mode: ssl_tls_accept failed");
return 1;
+1 -1
View File
@@ -125,7 +125,7 @@ struct stream* APP_CC
trans_get_out_s(struct trans* self, int size);
int APP_CC
trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
int disableSSLv3, const char *tls_ciphers);
long ssl_protocols, const char *tls_ciphers);
int APP_CC
trans_shutdown_tls_mode(struct trans *self);
int APP_CC
+1 -1
View File
@@ -143,7 +143,7 @@ struct xrdp_client_info
int use_frame_acks;
int max_unacknowledged_frame_count;
int disableSSLv3; /* 0 = no, 1 = yes */
long ssl_protocols;
char tls_ciphers[64];
int client_os_major;