MINOR: ssl: ssl_fc_has_early should work for BoringSSL

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.
This commit is contained in:
Emmanuel Hocdet 2019-08-07 14:44:49 +02:00 committed by Olivier Houchard
parent f967c31e75
commit c9858010c2

View 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;
}