X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fstatem%2Fstatem.c;h=a5748534878153d70f030f186865aa8a3d99c6d9;hp=818e648176e45d6bf2573c15566a1c81c6de7e55;hb=b38ede8043439d99a3c6c174f17b91875cce66ac;hpb=e454f3add638fda5c2aa32cd368c8929c0b1eb09 diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c index 818e648176..a574853487 100644 --- a/ssl/statem/statem.c +++ b/ssl/statem/statem.c @@ -951,3 +951,18 @@ int ossl_statem_export_allowed(SSL *s) return s->s3->previous_server_finished_len != 0 && s->statem.hand_state != TLS_ST_SW_FINISHED; } + +/* + * Return 1 if early TLS exporter is ready to export keying material, + * or 0 if otherwise. + */ +int ossl_statem_export_early_allowed(SSL *s) +{ + /* + * The early exporter secret is only present on the server if we + * have accepted early_data. It is present on the client as long + * as we have sent early_data. + */ + return s->ext.early_data == SSL_EARLY_DATA_ACCEPTED + || (!s->server && s->ext.early_data != SSL_EARLY_DATA_NOT_SENT); +}