summaryrefslogtreecommitdiff
path: root/dtls.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-03-09 12:14:33 +0100
committerLinus Nordberg <linus@nordu.net>2016-08-31 15:45:49 +0200
commitfe74fb7ea6c1a31dbb0c7f4d6b214518993537a7 (patch)
treee9e42bcd5f49b79293d7757ea9bfc8c9769457d6 /dtls.c
parentb159585bb9057bc441fd44ecf2d97b3f80782927 (diff)
Stop accessing ssl->rbio directly.
Diffstat (limited to 'dtls.c')
-rw-r--r--dtls.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dtls.c b/dtls.c
index 8f8c90a..4b04675 100644
--- a/dtls.c
+++ b/dtls.c
@@ -168,8 +168,8 @@ int dtlsread(SSL *ssl, struct gqueue *q, unsigned char *buf, int num, int timeou
rbio = getrbio(ssl, q, timeout);
if (!rbio)
return 0;
- BIO_free(ssl->rbio);
- ssl->rbio = rbio;
+ BIO_free(SSL_get_rbio(ssl));
+ SSL_set_bio(ssl, rbio, SSL_get_wbio(ssl));
cnt = 0;
continue;
case SSL_ERROR_WANT_WRITE:
@@ -210,9 +210,9 @@ SSL *dtlsacccon(uint8_t acc, SSL_CTX *ctx, int s, struct sockaddr *addr, struct
if (res == 0)
break;
if (SSL_get_error(ssl, res) == SSL_ERROR_WANT_READ) {
- BIO_free(ssl->rbio);
- ssl->rbio = getrbio(ssl, rbios, 5);
- if (!ssl->rbio)
+ BIO_free(SSL_get_rbio(ssl));
+ SSL_set_bio(ssl, getrbio(ssl, rbios, 5), SSL_get_wbio(ssl));
+ if (!SSL_get_rbio(ssl))
break;
}
while ((error = ERR_get_error()))