Add function to test headers agree.
Add a function to test that structure sizes match inside and outside of
OpenSSL.
diff --git a/ssl/ssl.h b/ssl/ssl.h
index 6b7ffe5..7221c9e 100644
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -2360,6 +2360,12 @@
int SSL_cache_hit(SSL *s);
int SSL_is_server(SSL *s);
+/* SSL_get_structure_sizes returns the sizes of the SSL, SSL_CTX and
+ * SSL_SESSION structures so that a test can ensure that outside code agrees on
+ * these values. */
+void SSL_get_structure_sizes(size_t* ssl_size, size_t* ssl_ctx_size,
+ size_t* ssl_session_size);
+
SSL_CONF_CTX *SSL_CONF_CTX_new(void);
int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx);
void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx);
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index c08dbb3..042d93b 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -3324,6 +3324,14 @@
s->state == SSL3_ST_CR_FINISHED_A));
}
+void SSL_get_structure_sizes(size_t* ssl_size, size_t* ssl_ctx_size,
+ size_t* ssl_session_size)
+{
+ *ssl_size = sizeof(SSL);
+ *ssl_ctx_size = sizeof(SSL_CTX);
+ *ssl_session_size = sizeof(SSL_SESSION);
+}
+
int ssl3_can_cutthrough(const SSL *s)
{
const SSL_CIPHER *c;