summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2018-01-21 11:30:36 +0900
committerMatt Caswell <matt@openssl.org>2018-02-02 23:54:14 +0000
commit1f5878b8e25a785dde330bf485e6ed5a6ae09a1a (patch)
tree57b6050a9997ebedb1cea76b4bfb1de9b5997923 /ssl/statem/statem.c
parentb1a51abb935163cbb0b0089ad9ee8ff174341bbd (diff)
Make sure that exporting keying material is allowed
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4944)
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 45cb9ab092..95c369a883 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -941,3 +941,13 @@ int ossl_statem_app_data_allowed(SSL *s)
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;
+}