diff options
| author | jsing <> | 2021-02-08 17:18:39 +0000 |
|---|---|---|
| committer | jsing <> | 2021-02-08 17:18:39 +0000 |
| commit | 3b4d7e2c0ce79af39e23fd41c886f65641d520d5 (patch) | |
| tree | 71eb0f54d8f97514908a654a4204466abb52e9de /src/lib/libssl/ssl_pkt.c | |
| parent | e46ddbd1e9a8bbd2eaf6ecebca7b8c3b191aca41 (diff) | |
| download | openbsd-3b4d7e2c0ce79af39e23fd41c886f65641d520d5.tar.gz openbsd-3b4d7e2c0ce79af39e23fd41c886f65641d520d5.tar.bz2 openbsd-3b4d7e2c0ce79af39e23fd41c886f65641d520d5.zip | |
Enforce read ahead with DTLS.
DTLS is largely broken/useless without read ahead being enabled, so enforce
it for DTLS. This behaviour matches both our documentation and OpenSSL.
ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_pkt.c')
| -rw-r--r-- | src/lib/libssl/ssl_pkt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl_pkt.c b/src/lib/libssl/ssl_pkt.c index 31a66753bf..1e0bd83d09 100644 --- a/src/lib/libssl/ssl_pkt.c +++ b/src/lib/libssl/ssl_pkt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_pkt.c,v 1.34 2021/01/19 18:57:09 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_pkt.c,v 1.35 2021/02/08 17:18:39 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -227,14 +227,14 @@ ssl3_read_n(SSL *s, int n, int max, int extend) | |||
| 227 | return -1; | 227 | return -1; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | if (!s->internal->read_ahead) { | 230 | if (s->internal->read_ahead || SSL_is_dtls(s)) { |
| 231 | /* ignore max parameter */ | ||
| 232 | max = n; | ||
| 233 | } else { | ||
| 234 | if (max < n) | 231 | if (max < n) |
| 235 | max = n; | 232 | max = n; |
| 236 | if (max > (int)(rb->len - rb->offset)) | 233 | if (max > (int)(rb->len - rb->offset)) |
| 237 | max = rb->len - rb->offset; | 234 | max = rb->len - rb->offset; |
| 235 | } else { | ||
| 236 | /* ignore max parameter */ | ||
| 237 | max = n; | ||
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | while (left < n) { | 240 | while (left < n) { |
