Skip to content

Commit

Permalink
Merge pull request #99 from ssahani/tls
Browse files Browse the repository at this point in the history
dtls: Fix crash when connection fails
  • Loading branch information
ssahani authored May 20, 2024
2 parents f366508 + 81316b6 commit 1fe78f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/netlog/netlog-dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ int dtls_connect(DTLSManager *m, SocketAddress *address) {
"Failed to allocate memory for bio: %m");

BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_CONNECTED, 0, &address);
SSL_set_bio(ssl , bio, bio);
SSL_set_bio(ssl, bio, bio);
m->bio = TAKE_PTR(bio);

/* Cerification verification */
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_NONE && m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_INVALID) {
Expand Down Expand Up @@ -163,7 +164,6 @@ int dtls_connect(DTLSManager *m, SocketAddress *address) {
/* Set and activate timeouts */
BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_RECV_TIMEOUT, 0, &timeout);

m->bio = TAKE_PTR(bio);
m->ssl = TAKE_PTR(ssl);
m->ctx = ctx;
m->fd = fd;
Expand Down

0 comments on commit 1fe78f9

Please sign in to comment.