]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: ssl_fc_has_early should work for BoringSSL
authorEmmanuel Hocdet <manu@gandi.net>
Wed, 7 Aug 2019 12:44:49 +0000 (14:44 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 7 Aug 2019 16:44:49 +0000 (18:44 +0200)
CO_FL_EARLY_SSL_HS/CO_FL_EARLY_DATA are removed for BoringSSL. Early
data can be checked via BoringSSL API and ssl_fc_has_early can used it.

This should be backported to all versions till 1.8.

src/ssl_sock.c

index 918671464384d42b4fde5c411de365d4a0e24b52..a95ff65b68e71500925f6be37991f560bd17a5a4 100644 (file)
@@ -6609,9 +6609,16 @@ smp_fetch_ssl_fc_has_early(const struct arg *args, struct sample *smp, const cha
 
        smp->flags = 0;
        smp->data.type = SMP_T_BOOL;
+#ifdef OPENSSL_IS_BORINGSSL
+       {
+               struct ssl_sock_ctx *ctx = conn->xprt_ctx;
+               smp->data.u.sint = (SSL_in_early_data(ctx->ssl) &&
+                                   SSL_early_data_accepted(ctx->ssl));
+       }
+#else
        smp->data.u.sint = ((conn->flags & CO_FL_EARLY_DATA)  &&
            (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE))) ? 1 : 0;
-
+#endif
        return 1;
 }