Only allow SSL_set_session before the handshake.
Otherwise things break horribly. Explicitly abort to help catch bugs.
Change-Id: I66e2bf8808199b3331b3adde68d73758a601eb8c
Reviewed-on: https://boringssl-review.googlesource.com/10761
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index ce2ba41..4ff25ce 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -1683,7 +1683,9 @@
/* SSL_set_session, for a client, configures |ssl| to offer to resume |session|
* in the initial handshake and returns one. The caller retains ownership of
- * |session|. */
+ * |session|.
+ *
+ * It is an error to call this function after the handshake has begun. */
OPENSSL_EXPORT int SSL_set_session(SSL *ssl, SSL_SESSION *session);
/* SSL_get_session returns a non-owning pointer to |ssl|'s session. For