Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit ff580e3

Browse files
committed
QUIC: SSLerr() -> ERR_raise(ERR_LIB_SSL)
1 parent bf2ab6e commit ff580e3

5 files changed

Lines changed: 15 additions & 16 deletions

File tree

ssl/s3_msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int ssl3_dispatch_alert(SSL *s)
8383
if (SSL_IS_QUIC(s)) {
8484
if (!s->quic_method->send_alert(s, s->quic_write_level,
8585
s->s3.send_alert[1])) {
86-
SSLerr(SSL_F_SSL3_DISPATCH_ALERT, ERR_R_INTERNAL_ERROR);
86+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
8787
return 0;
8888
}
8989
i = 1;

ssl/ssl_lib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ int ssl_read_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
18281828
{
18291829
#ifndef OPENSSL_NO_QUIC
18301830
if (SSL_IS_QUIC(s)) {
1831-
SSLerr(SSL_F_SSL_READ_INTERNAL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
1831+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
18321832
return -1;
18331833
}
18341834
#endif
@@ -1965,7 +1965,7 @@ static int ssl_peek_internal(SSL *s, void *buf, size_t num, size_t *readbytes)
19651965
{
19661966
#ifndef OPENSSL_NO_QUIC
19671967
if (SSL_IS_QUIC(s)) {
1968-
SSLerr(SSL_F_SSL_PEEK_INTERNAL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
1968+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
19691969
return -1;
19701970
}
19711971
#endif
@@ -2031,7 +2031,7 @@ int ssl_write_internal(SSL *s, const void *buf, size_t num, size_t *written)
20312031
{
20322032
#ifndef OPENSSL_NO_QUIC
20332033
if (SSL_IS_QUIC(s)) {
2034-
SSLerr(SSL_F_SSL_WRITE_INTERNAL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
2034+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
20352035
return -1;
20362036
}
20372037
#endif

ssl/ssl_quic.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,26 @@ int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level,
131131
size_t l, offset;
132132

133133
if (!SSL_IS_QUIC(ssl)) {
134-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
134+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
135135
return 0;
136136
}
137137

138138
/* Level can be different than the current read, but not less */
139139
if (level < ssl->quic_read_level
140140
|| (ssl->quic_input_data_tail != NULL && level < ssl->quic_input_data_tail->level)
141141
|| level < ssl->quic_latest_level_received) {
142-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED);
142+
ERR_raise(ERR_LIB_SSL, SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED);
143143
return 0;
144144
}
145145

146146
if (ssl->quic_buf == NULL) {
147147
BUF_MEM *buf;
148148
if ((buf = BUF_MEM_new()) == NULL) {
149-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_INTERNAL_ERROR);
149+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
150150
return 0;
151151
}
152152
if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
153-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_INTERNAL_ERROR);
153+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
154154
BUF_MEM_free(buf);
155155
return 0;
156156
}
@@ -163,15 +163,14 @@ int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level,
163163
/* A TLS message must not cross an encryption level boundary */
164164
if (ssl->quic_buf->length != ssl->quic_next_record_start
165165
&& level != ssl->quic_latest_level_received) {
166-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA,
167-
SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED);
166+
ERR_raise(ERR_LIB_SSL, SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED);
168167
return 0;
169168
}
170169
ssl->quic_latest_level_received = level;
171170

172171
offset = ssl->quic_buf->length;
173172
if (!BUF_MEM_grow(ssl->quic_buf, offset + len)) {
174-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_INTERNAL_ERROR);
173+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
175174
return 0;
176175
}
177176
memcpy(ssl->quic_buf->data + offset, data, len);
@@ -193,7 +192,7 @@ int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level,
193192

194193
qd = OPENSSL_zalloc(sizeof(*qd));
195194
if (qd == NULL) {
196-
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_INTERNAL_ERROR);
195+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
197196
return 0;
198197
}
199198

@@ -305,7 +304,7 @@ int SSL_process_quic_post_handshake(SSL *ssl)
305304
int ret;
306305

307306
if (SSL_in_init(ssl) || !SSL_IS_QUIC(ssl)) {
308-
SSLerr(SSL_F_SSL_PROCESS_QUIC_POST_HANDSHAKE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
307+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
309308
return 0;
310309
}
311310

ssl/statem/statem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ int statem_flush(SSL *s)
905905
#ifndef OPENSSL_NO_QUIC
906906
if (SSL_IS_QUIC(s)) {
907907
if (!s->quic_method->flush_flight(s)) {
908-
SSLerr(SSL_F_STATEM_FLUSH, ERR_R_INTERNAL_ERROR);
908+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
909909
return 0;
910910
}
911911
} else

ssl/statem/statem_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ int ssl3_do_write(SSL *s, int type)
5454
if (!ret) {
5555
ret = -1;
5656
/* QUIC can't sent anything out sice the above failed */
57-
SSLerr(SSL_F_SSL3_DO_WRITE, ERR_R_INTERNAL_ERROR);
57+
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
5858
} else {
5959
written = s->init_num;
6060
}
6161
} else {
6262
/* QUIC doesn't use ChangeCipherSpec */
6363
ret = -1;
64-
SSLerr(SSL_F_SSL3_DO_WRITE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
64+
ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
6565
}
6666
} else
6767
#endif

0 commit comments

Comments
 (0)