]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
DTLS: Don't require secure renegotiation from Cisco
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 4 May 2021 14:43:08 +0000 (15:43 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 5 May 2021 06:57:05 +0000 (07:57 +0100)
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
openssl-dtls.c
tests/bad_dtls_test.c

index 7bd38f3da8ed901cc84d0d279542958a249b2092..61cac6ee9c6f55ac2e81dfeb035019b957a28c10 100644 (file)
@@ -435,6 +435,15 @@ int start_dtls_handshake(struct openconnect_info *vpninfo, int dtls_fd)
                         */
                        SSL_CTX_set_options(vpninfo->dtls_ctx, SSL_OP_NO_ENCRYPT_THEN_MAC);
 #endif
+#ifdef SSL_OP_LEGACY_SERVER_CONNECT
+                       /*
+                        * Since https://github.com/openssl/openssl/pull/15127, OpenSSL
+                        * *requires* secure renegotiation support by default. For interop
+                        * with Cisco's resumed DTLS sessions, we have to turn that off.
+                        */
+                       if (dtlsver)
+                               SSL_CTX_set_options(vpninfo->dtls_ctx, SSL_OP_LEGACY_SERVER_CONNECT);
+#endif
 #ifdef SSL_OP_NO_EXTENDED_MASTER_SECRET
                        /* RFC7627 says:
                         *
index c123c8f8c7bd1ee735b630b10b79098a09eda571..85f023a77660ad73d35642e1a33a329dadc76573 100644 (file)
@@ -788,7 +788,8 @@ int main(int argc, char *argv[])
     ctx = SSL_CTX_new(DTLS_client_method());
     if (ctx == NULL ||
        !SSL_CTX_set_min_proto_version(ctx, DTLS1_BAD_VER) ||
-       !SSL_CTX_set_max_proto_version(ctx, DTLS1_BAD_VER)) {
+       !SSL_CTX_set_max_proto_version(ctx, DTLS1_BAD_VER) ||
+       !SSL_CTX_set_options(ctx, SSL_OP_LEGACY_SERVER_CONNECT)) {
         printf("Failed to allocate SSL_CTX\n");
         goto end_md;
     }