mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
Reduce code for SSL_connect and SSL_accept
There is no need to call SSL_set_accept_state + SSL_do_handshake when we know that SSL_accept should be done. vio/viossl.c: Replace the double calls to "SSL_set_accept_state" and "SSL_do_handshake" with one call to "SSL_accept" Same with "SSL_connect"
This commit is contained in:
parent
3f01b5df81
commit
0514595761
1 changed files with 4 additions and 6 deletions
10
vio/viossl.c
10
vio/viossl.c
|
|
@ -167,10 +167,9 @@ int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
|
|||
SSL_clear(ssl);
|
||||
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
|
||||
SSL_set_fd(ssl, vio->sd);
|
||||
SSL_set_accept_state(ssl);
|
||||
if (SSL_do_handshake(ssl) < 1)
|
||||
if (SSL_accept(ssl) < 1)
|
||||
{
|
||||
DBUG_PRINT("error", ("SSL_do_handshake failure"));
|
||||
DBUG_PRINT("error", ("SSL_accept failure"));
|
||||
report_errors(ssl);
|
||||
SSL_free(ssl);
|
||||
vio->ssl_arg= 0;
|
||||
|
|
@ -242,10 +241,9 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
|
|||
SSL_clear(ssl);
|
||||
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
|
||||
SSL_set_fd(ssl, vio->sd);
|
||||
SSL_set_connect_state(ssl);
|
||||
if (SSL_do_handshake(ssl) < 1)
|
||||
if (SSL_connect(ssl) < 1)
|
||||
{
|
||||
DBUG_PRINT("error", ("SSL_do_handshake failure"));
|
||||
DBUG_PRINT("error", ("SSL_connect failure"));
|
||||
report_errors(ssl);
|
||||
SSL_free(ssl);
|
||||
vio->ssl_arg= 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue