mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 16:35:41 +01:00
Fix multiple quality issues in the source
This PR fixes multiple issues in the source code to address issues raised by tests/scripts/check-files.py. Specifically: * incorrect file permissions * missing newline at the end of files * trailing whitespace * Tabs present * TODOs in the souce code
This commit is contained in:
parent
ad11e65448
commit
bb5e1c3973
2
include/mbedtls/ssl.h
Executable file → Normal file
2
include/mbedtls/ssl.h
Executable file → Normal file
@ -1834,7 +1834,7 @@ void mbedtls_ssl_conf_sig_hashes( mbedtls_ssl_config *conf,
|
||||
*
|
||||
* \param ssl SSL context
|
||||
* \param hostname the server hostname, may be NULL to clear hostname
|
||||
|
||||
*
|
||||
* \note Maximum hostname length MBEDTLS_SSL_MAX_HOST_NAME_LEN.
|
||||
*
|
||||
* \return 0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED on
|
||||
|
@ -232,7 +232,6 @@ int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val )
|
||||
int ret;
|
||||
size_t len = 0;
|
||||
|
||||
// TODO negative values and values larger than 128
|
||||
// DER format assumes 2s complement for numbers, so the leftmost bit
|
||||
// should be 0 for positive numbers and 1 for negative numbers.
|
||||
//
|
||||
|
@ -6916,41 +6916,6 @@ int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO
|
||||
*
|
||||
* The logic should be streamlined here:
|
||||
*
|
||||
* Instead of
|
||||
*
|
||||
* - Manually checking whether ssl->in_offt is NULL
|
||||
* - Fetching a new record if yes
|
||||
* - Setting ssl->in_offt if one finds an application record
|
||||
* - Resetting keep_current_message after handling the application data
|
||||
*
|
||||
* one should
|
||||
*
|
||||
* - Adapt read_record to set ssl->in_offt automatically
|
||||
* when a new application data record is processed.
|
||||
* - Always call mbedtls_ssl_read_record here.
|
||||
*
|
||||
* This way, the logic of ssl_read would be much clearer:
|
||||
*
|
||||
* (1) Always call record layer and see what kind of record is on
|
||||
* and have it ready for consumption (in particular, in_offt
|
||||
* properly set for application data records).
|
||||
* (2) If it's application data (either freshly fetched
|
||||
* or something already being partially processed),
|
||||
* serve the read request from it.
|
||||
* (3) If it's something different from application data,
|
||||
* handle it accordingly, e.g. potentially start a
|
||||
* renegotiation.
|
||||
*
|
||||
* This will also remove the need to manually reset
|
||||
* ssl->keep_current_message = 0 below.
|
||||
*
|
||||
*/
|
||||
|
||||
if( ssl->in_offt == NULL )
|
||||
{
|
||||
/* Start timer if not already running */
|
||||
|
@ -53,3 +53,4 @@ void ssl_set_hostname_twice( char *hostname0, char *hostname1 )
|
||||
mbedtls_ssl_free( &ssl );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user