QUIC APL: Add support for querying frame type causing closure
authorHugo Landau <hlandau@openssl.org>
Tue, 24 Oct 2023 07:15:18 +0000 (08:15 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 25 Oct 2023 08:42:03 +0000 (09:42 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22485)

doc/man3/SSL_get_conn_close_info.pod
include/openssl/ssl.h.in
ssl/quic/quic_impl.c

index b82e434f2b0881670b9969b0d66c2973806cafd6..fb8e0d25d3812e2e3e0436109c2d8dca0a3c6c41 100644 (file)
@@ -14,7 +14,7 @@ closed
  #define SSL_CONN_CLOSE_FLAG_TRANSPORT
 
  typedef struct ssl_conn_close_info_st {
-     uint64_t error_code;
+     uint64_t error_code, frame_type;
      char     *reason;
      size_t   reason_len;
      uint32_t flags;
@@ -42,6 +42,13 @@ This is a 62-bit QUIC error code. It is either a 62-bit application error code
 QUIC transport error code (if B<SSL_CONN_CLOSE_FLAG_TRANSPORT> is set in
 I<flags>).
 
+=item I<frame_type>
+
+If B<SSL_CONN_CLOSE_FLAG_TRANSPORT> is set, this may be set to a QUIC frame type
+number which caused the connection to be closed. It may also be set to 0 if no
+frame type was specified as causing the connection to be closed. If
+B<SSL_CONN_CLOSE_FLAG_TRANSPORT> is not set, this is set to 0.
+
 =item I<reason>
 
 If non-NULL, this is intended to be a UTF-8 textual string briefly describing
index 59b587e657e67eae5115d4efa3613259fe3e3d07..9f91039f8a121c3324dee7801ed49a2bd51e5534 100644 (file)
@@ -2348,7 +2348,7 @@ __owur int SSL_get_stream_write_error_code(SSL *ssl, uint64_t *app_error_code);
 #define SSL_CONN_CLOSE_FLAG_TRANSPORT   (1U << 1)
 
 typedef struct ssl_conn_close_info_st {
-    uint64_t    error_code;
+    uint64_t    error_code, frame_type;
     const char  *reason;
     size_t      reason_len;
     uint32_t    flags;
index bdf5d5fea882dea4cce5f73a741b8bf89352c8f1..d3310f87288e6e5cf8e9417f1dfdd8732b1c12dd 100644 (file)
@@ -3441,6 +3441,7 @@ int ossl_quic_get_conn_close_info(SSL *ssl,
         return 0;
 
     info->error_code    = tc->error_code;
+    info->frame_type    = tc->frame_type;
     info->reason        = tc->reason;
     info->reason_len    = tc->reason_len;
     info->flags         = 0;