diff options
| author | jsing <> | 2022-08-21 18:17:11 +0000 |
|---|---|---|
| committer | jsing <> | 2022-08-21 18:17:11 +0000 |
| commit | 241884636e350bc9aa3c9962e626ddcc8e4a566e (patch) | |
| tree | dc3c14b415ce2176d29ac41f539377869c8b6095 /src | |
| parent | d58559eafcd772ecb4569040cf44ba5dbc793c65 (diff) | |
| download | openbsd-241884636e350bc9aa3c9962e626ddcc8e4a566e.tar.gz openbsd-241884636e350bc9aa3c9962e626ddcc8e4a566e.tar.bz2 openbsd-241884636e350bc9aa3c9962e626ddcc8e4a566e.zip | |
Ensure that SSL_{peek,read,write}() are not called if QUIC is in use.
ok tb@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 9af1934dd6..515065de6c 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_lib.c,v 1.301 2022/08/17 07:39:19 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.302 2022/08/21 18:17:11 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 | * |
| @@ -1029,6 +1029,11 @@ SSL_read(SSL *s, void *buf, int num) | |||
| 1029 | return -1; | 1029 | return -1; |
| 1030 | } | 1030 | } |
| 1031 | 1031 | ||
| 1032 | if (SSL_is_quic(s)) { | ||
| 1033 | SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
| 1034 | return (-1); | ||
| 1035 | } | ||
| 1036 | |||
| 1032 | if (s->internal->handshake_func == NULL) { | 1037 | if (s->internal->handshake_func == NULL) { |
| 1033 | SSLerror(s, SSL_R_UNINITIALIZED); | 1038 | SSLerror(s, SSL_R_UNINITIALIZED); |
| 1034 | return (-1); | 1039 | return (-1); |
| @@ -1068,6 +1073,11 @@ SSL_peek(SSL *s, void *buf, int num) | |||
| 1068 | return -1; | 1073 | return -1; |
| 1069 | } | 1074 | } |
| 1070 | 1075 | ||
| 1076 | if (SSL_is_quic(s)) { | ||
| 1077 | SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
| 1078 | return (-1); | ||
| 1079 | } | ||
| 1080 | |||
| 1071 | if (s->internal->handshake_func == NULL) { | 1081 | if (s->internal->handshake_func == NULL) { |
| 1072 | SSLerror(s, SSL_R_UNINITIALIZED); | 1082 | SSLerror(s, SSL_R_UNINITIALIZED); |
| 1073 | return (-1); | 1083 | return (-1); |
| @@ -1106,6 +1116,11 @@ SSL_write(SSL *s, const void *buf, int num) | |||
| 1106 | return -1; | 1116 | return -1; |
| 1107 | } | 1117 | } |
| 1108 | 1118 | ||
| 1119 | if (SSL_is_quic(s)) { | ||
| 1120 | SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
| 1121 | return (-1); | ||
| 1122 | } | ||
| 1123 | |||
| 1109 | if (s->internal->handshake_func == NULL) { | 1124 | if (s->internal->handshake_func == NULL) { |
| 1110 | SSLerror(s, SSL_R_UNINITIALIZED); | 1125 | SSLerror(s, SSL_R_UNINITIALIZED); |
| 1111 | return (-1); | 1126 | return (-1); |
