]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Provide better errors for some QUIC failures
authorMatt Caswell <matt@openssl.org>
Fri, 10 Mar 2023 15:02:26 +0000 (15:02 +0000)
committerPauli <pauli@openssl.org>
Sun, 19 Mar 2023 22:35:38 +0000 (09:35 +1100)
For example if would be helpful if we got more useful information if the
caller forgot to set the peer address.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20514)

crypto/err/openssl.txt
include/openssl/sslerr.h
ssl/quic/quic_impl.c
ssl/ssl_err.c
ssl/sslerr.h

index d0336d972981b80d72888e150d681dbc55c1987b..3f7f4bf109267346b010b7c2212348cbfb2a142a 100644 (file)
@@ -1493,6 +1493,7 @@ SSL_R_RECORDS_NOT_RELEASED:321:records not released
 SSL_R_RECORD_LAYER_FAILURE:313:record layer failure
 SSL_R_RECORD_LENGTH_MISMATCH:213:record length mismatch
 SSL_R_RECORD_TOO_SMALL:298:record too small
+SSL_R_REMOTE_PEER_ADDRESS_NOT_SET:346:remote peer address not set
 SSL_R_RENEGOTIATE_EXT_TOO_LONG:335:renegotiate ext too long
 SSL_R_RENEGOTIATION_ENCODING_ERR:336:renegotiation encoding err
 SSL_R_RENEGOTIATION_MISMATCH:337:renegotiation mismatch
index b8809ad28abd09fdfd114615dc841a845a82c8e3..43aa1c3742655f2691015a71a1dbe358467d8bfd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
 # define SSL_R_RECORD_LAYER_FAILURE                       313
 # define SSL_R_RECORD_LENGTH_MISMATCH                     213
 # define SSL_R_RECORD_TOO_SMALL                           298
+# define SSL_R_REMOTE_PEER_ADDRESS_NOT_SET                346
 # define SSL_R_RENEGOTIATE_EXT_TOO_LONG                   335
 # define SSL_R_RENEGOTIATION_ENCODING_ERR                 336
 # define SSL_R_RENEGOTIATION_MISMATCH                     337
index 4c34ab8e4049d542795957e08bb6d26e5286fe6f..48e1cf7c0ef8116fceb12a4565865290953ca3ab 100644 (file)
@@ -652,7 +652,7 @@ int ossl_quic_do_handshake(QUIC_CONNECTION *qc)
 
     if (BIO_ADDR_family(&qc->init_peer_addr) == AF_UNSPEC) {
         /* Peer address must have been set. */
-        QUIC_RAISE_NON_NORMAL_ERROR(qc, ERR_R_PASSED_INVALID_ARGUMENT, NULL);
+        QUIC_RAISE_NON_NORMAL_ERROR(qc, SSL_R_REMOTE_PEER_ADDRESS_NOT_SET, NULL);
         return -1; /* Non-protocol error */
     }
 
@@ -664,7 +664,7 @@ int ossl_quic_do_handshake(QUIC_CONNECTION *qc)
 
     if (qc->net_rbio == NULL || qc->net_wbio == NULL) {
         /* Need read and write BIOs. */
-        QUIC_RAISE_NON_NORMAL_ERROR(qc, ERR_R_PASSED_INVALID_ARGUMENT, NULL);
+        QUIC_RAISE_NON_NORMAL_ERROR(qc, SSL_R_BIO_NOT_SET, NULL);
         return -1; /* Non-protocol error */
     }
 
index 73dedbc5b3fabe6adb18051219f1accb7bb9e8e7..bec6733a00b3a9a89821847a406362bf32a21097 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -358,6 +358,8 @@ static const ERR_STRING_DATA SSL_str_reasons[] = {
     {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORD_LENGTH_MISMATCH),
     "record length mismatch"},
     {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RECORD_TOO_SMALL), "record too small"},
+    {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_REMOTE_PEER_ADDRESS_NOT_SET),
+    "remote peer address not set"},
     {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RENEGOTIATE_EXT_TOO_LONG),
     "renegotiate ext too long"},
     {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_RENEGOTIATION_ENCODING_ERR),
index 6715ac6a3254903b586d9cbd737058c24c991b20..f28230f0875caeefbbb8c5c94b4957ef6af79e81 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy