Add function to test headers agree.

Add a function to test that structure sizes match inside and outside of
OpenSSL.
This commit is contained in:
Adam Langley 2014-06-20 12:00:00 -07:00
parent 75b833cc81
commit 95f22882a7
2 changed files with 14 additions and 0 deletions

View File

@ -2360,6 +2360,12 @@ void SSL_set_debug(SSL *s, int debug);
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);

View File

@ -3324,6 +3324,14 @@ int SSL_cutthrough_complete(const SSL *s)
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;