Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4944)
return 0;
}
+
+/*
+ * This function returns 1 if TLS exporter is ready to export keying
+ * material, or 0 if otherwise.
+ */
+int ossl_statem_export_allowed(SSL *s)
+{
+ return s->s3->previous_server_finished_len != 0
+ && s->statem.hand_state != TLS_ST_SW_FINISHED;
+}
void ossl_statem_check_finish_init(SSL *s, int send);
void ossl_statem_set_hello_verify_done(SSL *s);
__owur int ossl_statem_app_data_allowed(SSL *s);
+__owur int ossl_statem_export_allowed(SSL *s);
/* Flush the write BIO */
int statem_flush(SSL *s);
unsigned int hashsize, datalen;
int ret = 0;
- if (ctx == NULL)
+ if (ctx == NULL || !ossl_statem_export_allowed(s))
goto err;
if (!use_context)
{
}
+int ossl_statem_export_allowed(SSL *s)
+{
+ return 1;
+}
+
/* End of mocked out code */
static int test_secret(SSL *s, unsigned char *prk,