QUIC: Forbid NPN
authorHugo Landau <hlandau@openssl.org>
Mon, 16 Jan 2023 15:20:20 +0000 (15:20 +0000)
committerPauli <pauli@openssl.org>
Tue, 4 Jul 2023 23:02:26 +0000 (09:02 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20061)

doc/man3/SSL_CTX_set_alpn_select_cb.pod
ssl/ssl_lib.c

index 102e6578512c1bdd73b5514621b4acaf5d79ec7d..84b2bc5dfe8f2ff4d3d5cff61b0f207f2f7ee845 100644 (file)
@@ -111,6 +111,9 @@ the client can request any protocol it chooses. The value returned from
 this function need not be a member of the list of supported protocols
 provided by the callback.
 
+NPN functionality cannot be used with QUIC SSL objects. Use of ALPN is mandatory
+when using QUIC SSL objects.
+
 =head1 NOTES
 
 The protocol-lists must be in wire-format, which is defined as a vector of
index e14eeffd1beeea5496a82cf902197935f2e4ba2c..ad3afe33ebec9089d236dff05fced964adf1ecae 100644 (file)
@@ -3548,6 +3548,10 @@ void SSL_CTX_set_npn_advertised_cb(SSL_CTX *ctx,
                                    SSL_CTX_npn_advertised_cb_func cb,
                                    void *arg)
 {
+    if (IS_QUIC_CTX(ctx))
+        /* NPN not allowed for QUIC */
+        return;
+
     ctx->ext.npn_advertised_cb = cb;
     ctx->ext.npn_advertised_cb_arg = arg;
 }
@@ -3566,6 +3570,10 @@ void SSL_CTX_set_npn_select_cb(SSL_CTX *ctx,
                                SSL_CTX_npn_select_cb_func cb,
                                void *arg)
 {
+    if (IS_QUIC_CTX(ctx))
+        /* NPN not allowed for QUIC */
+        return;
+
     ctx->ext.npn_select_cb = cb;
     ctx->ext.npn_select_cb_arg = arg;
 }