mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 23:45:42 +01:00
Normalize spelling to serialiZation
We have explicit recommendations to use US spelling for technical writing, so let's apply this to code as well for uniformity. (My fingers tend to prefer UK spelling, so this needs to be fixed in many places.) sed -i 's/\([Ss]eriali\)s/\1z/g' **/*.[ch] **/*.function **/*.data ChangeLog
This commit is contained in:
parent
e0cd1d0184
commit
35ccdbb636
@ -21,7 +21,7 @@ Features
|
|||||||
MBEDTLS_SSL_DTLS_CONNECTION_ID (disabled by default), and at run-time
|
MBEDTLS_SSL_DTLS_CONNECTION_ID (disabled by default), and at run-time
|
||||||
through the new APIs mbedtls_ssl_conf_cid() and mbedtls_ssl_set_cid().
|
through the new APIs mbedtls_ssl_conf_cid() and mbedtls_ssl_set_cid().
|
||||||
* Add new API functions mbedtls_ssl_session_save() and
|
* Add new API functions mbedtls_ssl_session_save() and
|
||||||
mbedtls_ssl_session_load() to allow serialising a session, for example to
|
mbedtls_ssl_session_load() to allow serializing a session, for example to
|
||||||
store it in non-volatile storage, and later using it for TLS session
|
store it in non-volatile storage, and later using it for TLS session
|
||||||
resumption.
|
resumption.
|
||||||
|
|
||||||
|
@ -813,7 +813,7 @@ typedef void mbedtls_ssl_async_cancel_t( mbedtls_ssl_context *ssl );
|
|||||||
*
|
*
|
||||||
* Note: when changing this definition, we need to check and update:
|
* Note: when changing this definition, we need to check and update:
|
||||||
* - in tests/suites/test_suite_ssl.function:
|
* - in tests/suites/test_suite_ssl.function:
|
||||||
* ssl_populate_session() and ssl_serialise_session_save_load()
|
* ssl_populate_session() and ssl_serialize_session_save_load()
|
||||||
* - in library/ssl_tls.c:
|
* - in library/ssl_tls.c:
|
||||||
* mbedtls_ssl_session_init() and mbedtls_ssl_session_free()
|
* mbedtls_ssl_session_init() and mbedtls_ssl_session_free()
|
||||||
* mbedtls_ssl_session_save() and ssl_session_load()
|
* mbedtls_ssl_session_save() and ssl_session_load()
|
||||||
@ -2154,14 +2154,14 @@ int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session
|
|||||||
#endif /* MBEDTLS_SSL_CLI_C */
|
#endif /* MBEDTLS_SSL_CLI_C */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load serialised session data into a session structure.
|
* \brief Load serialized session data into a session structure.
|
||||||
* On client, this can be used for loading saved sessions
|
* On client, this can be used for loading saved sessions
|
||||||
* before resuming them with mbedstls_ssl_set_session().
|
* before resuming them with mbedstls_ssl_set_session().
|
||||||
* On server, this can be used for alternative implementations
|
* On server, this can be used for alternative implementations
|
||||||
* of session cache or session tickets.
|
* of session cache or session tickets.
|
||||||
*
|
*
|
||||||
* \warning If a peer certificate chain is associated with the session,
|
* \warning If a peer certificate chain is associated with the session,
|
||||||
* the serialised state will only contain the peer's
|
* the serialized state will only contain the peer's
|
||||||
* end-entity certificate and the result of the chain
|
* end-entity certificate and the result of the chain
|
||||||
* verification (unless verification was disabled), but not
|
* verification (unless verification was disabled), but not
|
||||||
* the rest of the chain.
|
* the rest of the chain.
|
||||||
@ -2172,9 +2172,9 @@ int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session
|
|||||||
* \param session The session structure to be populated. It must have been
|
* \param session The session structure to be populated. It must have been
|
||||||
* initialised with mbedtls_ssl_session_init() but not
|
* initialised with mbedtls_ssl_session_init() but not
|
||||||
* populated yet.
|
* populated yet.
|
||||||
* \param buf The buffer holding the serialised session data. It must be a
|
* \param buf The buffer holding the serialized session data. It must be a
|
||||||
* readable buffer of at least \p len bytes.
|
* readable buffer of at least \p len bytes.
|
||||||
* \param len The size of the serialised data in bytes.
|
* \param len The size of the serialized data in bytes.
|
||||||
*
|
*
|
||||||
* \return \c 0 if successful.
|
* \return \c 0 if successful.
|
||||||
* \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed.
|
* \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed.
|
||||||
@ -2187,7 +2187,7 @@ int mbedtls_ssl_session_load( mbedtls_ssl_session *session,
|
|||||||
size_t len );
|
size_t len );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Save session structure as serialised data in a buffer.
|
* \brief Save session structure as serialized data in a buffer.
|
||||||
* On client, this can be used for saving session data,
|
* On client, this can be used for saving session data,
|
||||||
* potentially in non-volatile storage, for resuming later.
|
* potentially in non-volatile storage, for resuming later.
|
||||||
* On server, this can be used for alternative implementations
|
* On server, this can be used for alternative implementations
|
||||||
@ -2219,7 +2219,7 @@ int mbedtls_ssl_session_save( const mbedtls_ssl_session *session,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get a pointer to the current session structure, for example
|
* \brief Get a pointer to the current session structure, for example
|
||||||
* to serialise it.
|
* to serialize it.
|
||||||
*
|
*
|
||||||
* \warning Ownership of the session remains with the SSL context, and
|
* \warning Ownership of the session remains with the SSL context, and
|
||||||
* the returned pointer is only guaranteed to be valid until
|
* the returned pointer is only guaranteed to be valid until
|
||||||
|
@ -8862,7 +8862,7 @@ int mbedtls_ssl_session_save( const mbedtls_ssl_session *session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unserialise session, see mbedtls_ssl_session_save().
|
* Unserialize session, see mbedtls_ssl_session_save().
|
||||||
*
|
*
|
||||||
* This internal version is wrapped by a public function that cleans up in
|
* This internal version is wrapped by a public function that cleans up in
|
||||||
* case of error.
|
* case of error.
|
||||||
@ -8968,7 +8968,7 @@ static int ssl_session_load( mbedtls_ssl_session *session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unserialise session: public wrapper for error cleaning
|
* Unserialize session: public wrapper for error cleaning
|
||||||
*/
|
*/
|
||||||
int mbedtls_ssl_session_load( mbedtls_ssl_session *session,
|
int mbedtls_ssl_session_load( mbedtls_ssl_session *session,
|
||||||
const unsigned char *buf,
|
const unsigned char *buf,
|
||||||
|
@ -315,7 +315,7 @@ int main( void )
|
|||||||
" reconnect=%%d number of reconnections using session resumption\n" \
|
" reconnect=%%d number of reconnections using session resumption\n" \
|
||||||
" default: 0 (disabled)\n" \
|
" default: 0 (disabled)\n" \
|
||||||
" reco_delay=%%d default: 0 seconds\n" \
|
" reco_delay=%%d default: 0 seconds\n" \
|
||||||
" reco_mode=%%d 0: copy session, 1: serialise session\n" \
|
" reco_mode=%%d 0: copy session, 1: serialize session\n" \
|
||||||
" default: 1\n" \
|
" default: 1\n" \
|
||||||
" reconnect_hard=%%d default: 0 (disabled)\n" \
|
" reconnect_hard=%%d default: 0 (disabled)\n" \
|
||||||
USAGE_TICKETS \
|
USAGE_TICKETS \
|
||||||
|
@ -8714,94 +8714,94 @@ Record crypt, little space, NULL cipher, SSL3, MD5, short tag, EtM
|
|||||||
depends_on:MBEDTLS_CIPHER_NULL_CIPHER:MBEDTLS_SSL_PROTO_SSL3:MBEDTLS_MD5_C:MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
depends_on:MBEDTLS_CIPHER_NULL_CIPHER:MBEDTLS_SSL_PROTO_SSL3:MBEDTLS_MD5_C:MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
ssl_crypt_record_small:MBEDTLS_CIPHER_NULL:MBEDTLS_MD_MD5:1:1:MBEDTLS_SSL_MINOR_VERSION_0:0:0
|
ssl_crypt_record_small:MBEDTLS_CIPHER_NULL:MBEDTLS_MD_MD5:1:1:MBEDTLS_SSL_MINOR_VERSION_0:0:0
|
||||||
|
|
||||||
Session serialisation, save-load: no ticket, no cert
|
Session serialization, save-load: no ticket, no cert
|
||||||
ssl_serialise_session_save_load:0:""
|
ssl_serialize_session_save_load:0:""
|
||||||
|
|
||||||
Session serialisation, save-load: small ticket, no cert
|
Session serialization, save-load: small ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_save_load:42:""
|
ssl_serialize_session_save_load:42:""
|
||||||
|
|
||||||
Session serialisation, save-load: large ticket, no cert
|
Session serialization, save-load: large ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_save_load:1023:""
|
ssl_serialize_session_save_load:1023:""
|
||||||
|
|
||||||
Session serialisation, save-load: no ticket, cert
|
Session serialization, save-load: no ticket, cert
|
||||||
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_load:0:"data_files/server5.crt"
|
ssl_serialize_session_save_load:0:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, save-load: small ticket, cert
|
Session serialization, save-load: small ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_load:42:"data_files/server5.crt"
|
ssl_serialize_session_save_load:42:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, save-load: large ticket, cert
|
Session serialization, save-load: large ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_load:1023:"data_files/server5.crt"
|
ssl_serialize_session_save_load:1023:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load-save: no ticket, no cert
|
Session serialization, load-save: no ticket, no cert
|
||||||
ssl_serialise_session_load_save:0:""
|
ssl_serialize_session_load_save:0:""
|
||||||
|
|
||||||
Session serialisation, load-save: small ticket, no cert
|
Session serialization, load-save: small ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_load_save:42:""
|
ssl_serialize_session_load_save:42:""
|
||||||
|
|
||||||
Session serialisation, load-save: large ticket, no cert
|
Session serialization, load-save: large ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_load_save:1023:""
|
ssl_serialize_session_load_save:1023:""
|
||||||
|
|
||||||
Session serialisation, load-save: no ticket, cert
|
Session serialization, load-save: no ticket, cert
|
||||||
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_save:0:"data_files/server5.crt"
|
ssl_serialize_session_load_save:0:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load-save: small ticket, cert
|
Session serialization, load-save: small ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_save:42:"data_files/server5.crt"
|
ssl_serialize_session_load_save:42:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load-save: large ticket, cert
|
Session serialization, load-save: large ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_save:1023:"data_files/server5.crt"
|
ssl_serialize_session_load_save:1023:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, save buffer size: no ticket, no cert
|
Session serialization, save buffer size: no ticket, no cert
|
||||||
ssl_serialise_session_save_buf_size:0:""
|
ssl_serialize_session_save_buf_size:0:""
|
||||||
|
|
||||||
Session serialisation, save buffer size: small ticket, no cert
|
Session serialization, save buffer size: small ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_save_buf_size:42:""
|
ssl_serialize_session_save_buf_size:42:""
|
||||||
|
|
||||||
Session serialisation, save buffer size: large ticket, no cert
|
Session serialization, save buffer size: large ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_save_buf_size:1023:""
|
ssl_serialize_session_save_buf_size:1023:""
|
||||||
|
|
||||||
Session serialisation, save buffer size: no ticket, cert
|
Session serialization, save buffer size: no ticket, cert
|
||||||
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_buf_size:0:"data_files/server5.crt"
|
ssl_serialize_session_save_buf_size:0:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, save buffer size: small ticket, cert
|
Session serialization, save buffer size: small ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_buf_size:42:"data_files/server5.crt"
|
ssl_serialize_session_save_buf_size:42:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, save buffer size: large ticket, cert
|
Session serialization, save buffer size: large ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_save_buf_size:1023:"data_files/server5.crt"
|
ssl_serialize_session_save_buf_size:1023:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load buffer size: no ticket, no cert
|
Session serialization, load buffer size: no ticket, no cert
|
||||||
ssl_serialise_session_load_buf_size:0:""
|
ssl_serialize_session_load_buf_size:0:""
|
||||||
|
|
||||||
Session serialisation, load buffer size: small ticket, no cert
|
Session serialization, load buffer size: small ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_load_buf_size:42:""
|
ssl_serialize_session_load_buf_size:42:""
|
||||||
|
|
||||||
Session serialisation, load buffer size: large ticket, no cert
|
Session serialization, load buffer size: large ticket, no cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C
|
||||||
ssl_serialise_session_load_buf_size:1023:""
|
ssl_serialize_session_load_buf_size:1023:""
|
||||||
|
|
||||||
Session serialisation, load buffer size: no ticket, cert
|
Session serialization, load buffer size: no ticket, cert
|
||||||
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_buf_size:0:"data_files/server5.crt"
|
ssl_serialize_session_load_buf_size:0:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load buffer size: small ticket, cert
|
Session serialization, load buffer size: small ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_buf_size:42:"data_files/server5.crt"
|
ssl_serialize_session_load_buf_size:42:"data_files/server5.crt"
|
||||||
|
|
||||||
Session serialisation, load buffer size: large ticket, cert
|
Session serialization, load buffer size: large ticket, cert
|
||||||
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
depends_on:MBEDTLS_SSL_SESSION_TICKETS:MBEDTLS_SSL_CLI_C:MBEDTLS_X509_USE_C:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECDSA_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C:MBEDTLS_FS_IO
|
||||||
ssl_serialise_session_load_buf_size:1023:"data_files/server5.crt"
|
ssl_serialize_session_load_buf_size:1023:"data_files/server5.crt"
|
||||||
|
@ -267,7 +267,7 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Populate a session structure for serialisation tests.
|
* Populate a session structure for serialization tests.
|
||||||
* Choose dummy values, mostly non-0 to distinguish from the init default.
|
* Choose dummy values, mostly non-0 to distinguish from the init default.
|
||||||
*/
|
*/
|
||||||
static int ssl_populate_session( mbedtls_ssl_session *session,
|
static int ssl_populate_session( mbedtls_ssl_session *session,
|
||||||
@ -639,7 +639,7 @@ exit:
|
|||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE */
|
/* BEGIN_CASE */
|
||||||
void ssl_serialise_session_save_load( int ticket_len, char *crt_file )
|
void ssl_serialize_session_save_load( int ticket_len, char *crt_file )
|
||||||
{
|
{
|
||||||
mbedtls_ssl_session original, restored;
|
mbedtls_ssl_session original, restored;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
@ -655,14 +655,14 @@ void ssl_serialise_session_save_load( int ticket_len, char *crt_file )
|
|||||||
/* Prepare a dummy session to work on */
|
/* Prepare a dummy session to work on */
|
||||||
TEST_ASSERT( ssl_populate_session( &original, ticket_len, crt_file ) == 0 );
|
TEST_ASSERT( ssl_populate_session( &original, ticket_len, crt_file ) == 0 );
|
||||||
|
|
||||||
/* Serialise it */
|
/* Serialize it */
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &original, NULL, 0, &len )
|
TEST_ASSERT( mbedtls_ssl_session_save( &original, NULL, 0, &len )
|
||||||
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||||
TEST_ASSERT( ( buf = mbedtls_calloc( 1, len ) ) != NULL );
|
TEST_ASSERT( ( buf = mbedtls_calloc( 1, len ) ) != NULL );
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &original, buf, len, &len )
|
TEST_ASSERT( mbedtls_ssl_session_save( &original, buf, len, &len )
|
||||||
== 0 );
|
== 0 );
|
||||||
|
|
||||||
/* Restore session from serialised data */
|
/* Restore session from serialized data */
|
||||||
TEST_ASSERT( mbedtls_ssl_session_load( &restored, buf, len) == 0 );
|
TEST_ASSERT( mbedtls_ssl_session_load( &restored, buf, len) == 0 );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -725,7 +725,7 @@ exit:
|
|||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE depends_on:MBEDTLS_SEE_FUTURE_PR */
|
/* BEGIN_CASE depends_on:MBEDTLS_SEE_FUTURE_PR */
|
||||||
void ssl_serialise_session_load_save( int ticket_len, char *crt_file )
|
void ssl_serialize_session_load_save( int ticket_len, char *crt_file )
|
||||||
{
|
{
|
||||||
mbedtls_ssl_session session;
|
mbedtls_ssl_session session;
|
||||||
unsigned char *buf1 = NULL, *buf2 = NULL;
|
unsigned char *buf1 = NULL, *buf2 = NULL;
|
||||||
@ -740,7 +740,7 @@ void ssl_serialise_session_load_save( int ticket_len, char *crt_file )
|
|||||||
/* Prepare a dummy session to work on */
|
/* Prepare a dummy session to work on */
|
||||||
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
||||||
|
|
||||||
/* Get desired buffer size for serialising */
|
/* Get desired buffer size for serializing */
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &len0 )
|
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &len0 )
|
||||||
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||||
|
|
||||||
@ -748,22 +748,22 @@ void ssl_serialise_session_load_save( int ticket_len, char *crt_file )
|
|||||||
buf1 = mbedtls_calloc( 1, len0 );
|
buf1 = mbedtls_calloc( 1, len0 );
|
||||||
TEST_ASSERT( buf1 != NULL );
|
TEST_ASSERT( buf1 != NULL );
|
||||||
|
|
||||||
/* Serialise to buffer and free live session */
|
/* Serialize to buffer and free live session */
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, buf1, len0, &len1 )
|
TEST_ASSERT( mbedtls_ssl_session_save( &session, buf1, len0, &len1 )
|
||||||
== 0 );
|
== 0 );
|
||||||
TEST_ASSERT( len0 == len1 );
|
TEST_ASSERT( len0 == len1 );
|
||||||
mbedtls_ssl_session_free( &session );
|
mbedtls_ssl_session_free( &session );
|
||||||
|
|
||||||
/* Restore session from serialised data */
|
/* Restore session from serialized data */
|
||||||
TEST_ASSERT( mbedtls_ssl_session_load( &session, buf1, len1 ) == 0 );
|
TEST_ASSERT( mbedtls_ssl_session_load( &session, buf1, len1 ) == 0 );
|
||||||
|
|
||||||
/* Allocate second buffer and serialise to it */
|
/* Allocate second buffer and serialize to it */
|
||||||
buf2 = mbedtls_calloc( 1, len0 );
|
buf2 = mbedtls_calloc( 1, len0 );
|
||||||
TEST_ASSERT( buf2 != NULL );
|
TEST_ASSERT( buf2 != NULL );
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, buf2, len0, &len2 )
|
TEST_ASSERT( mbedtls_ssl_session_save( &session, buf2, len0, &len2 )
|
||||||
== 0 );
|
== 0 );
|
||||||
|
|
||||||
/* Make sure both serialised versions are identical */
|
/* Make sure both serialized versions are identical */
|
||||||
TEST_ASSERT( len1 == len2 );
|
TEST_ASSERT( len1 == len2 );
|
||||||
TEST_ASSERT( memcmp( buf1, buf2, len1 ) == 0 );
|
TEST_ASSERT( memcmp( buf1, buf2, len1 ) == 0 );
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ exit:
|
|||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE */
|
/* BEGIN_CASE */
|
||||||
void ssl_serialise_session_save_buf_size( int ticket_len, char *crt_file )
|
void ssl_serialize_session_save_buf_size( int ticket_len, char *crt_file )
|
||||||
{
|
{
|
||||||
mbedtls_ssl_session session;
|
mbedtls_ssl_session session;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
@ -787,7 +787,7 @@ void ssl_serialise_session_save_buf_size( int ticket_len, char *crt_file )
|
|||||||
|
|
||||||
mbedtls_ssl_session_init( &session );
|
mbedtls_ssl_session_init( &session );
|
||||||
|
|
||||||
/* Prepare dummy session and get serialised size */
|
/* Prepare dummy session and get serialized size */
|
||||||
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &good_len )
|
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &good_len )
|
||||||
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||||
@ -811,7 +811,7 @@ exit:
|
|||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE */
|
/* BEGIN_CASE */
|
||||||
void ssl_serialise_session_load_buf_size( int ticket_len, char *crt_file )
|
void ssl_serialize_session_load_buf_size( int ticket_len, char *crt_file )
|
||||||
{
|
{
|
||||||
mbedtls_ssl_session session;
|
mbedtls_ssl_session session;
|
||||||
unsigned char *good_buf = NULL, *bad_buf = NULL;
|
unsigned char *good_buf = NULL, *bad_buf = NULL;
|
||||||
@ -823,7 +823,7 @@ void ssl_serialise_session_load_buf_size( int ticket_len, char *crt_file )
|
|||||||
|
|
||||||
mbedtls_ssl_session_init( &session );
|
mbedtls_ssl_session_init( &session );
|
||||||
|
|
||||||
/* Prepare serialised session data */
|
/* Prepare serialized session data */
|
||||||
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
TEST_ASSERT( ssl_populate_session( &session, ticket_len, crt_file ) == 0 );
|
||||||
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &good_len )
|
TEST_ASSERT( mbedtls_ssl_session_save( &session, NULL, 0, &good_len )
|
||||||
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
== MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||||
|
Loading…
Reference in New Issue
Block a user