mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 16:41:04 +00:00
Fix unused variable/function compilation warnings
This PR fixes a number of unused variable/function compilation warnings that arise when using a config.h that does not define the macro MBEDTLS_PEM_PARSE_C.
This commit is contained in:
parent
13945f6665
commit
480a958e54
|
@ -5,6 +5,9 @@ mbed TLS ChangeLog (Sorted per branch, date)
|
||||||
Bugfix
|
Bugfix
|
||||||
* Fix redefinition of macro ssl_set_bio to undefined symbol
|
* Fix redefinition of macro ssl_set_bio to undefined symbol
|
||||||
mbedtls_ssl_set_bio_timeout in compat-1.3.h. #673
|
mbedtls_ssl_set_bio_timeout in compat-1.3.h. #673
|
||||||
|
* Fix unused variable/function compilation warnings in pem.c and x509_csr.c
|
||||||
|
that are reported when building mbed TLS with a config.h that does not
|
||||||
|
define MBEDTLS_PEM_PARSE_C. #562
|
||||||
* Fixed multiple buffer overreads in mbedtls_pem_read_buffer() when parsing
|
* Fixed multiple buffer overreads in mbedtls_pem_read_buffer() when parsing
|
||||||
the input string in PEM format to extract the different components. Found
|
the input string in PEM format to extract the different components. Found
|
||||||
by Eyal Itkin.
|
by Eyal Itkin.
|
||||||
|
|
|
@ -44,12 +44,12 @@
|
||||||
#define mbedtls_free free
|
#define mbedtls_free free
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PEM_PARSE_C)
|
||||||
/* Implementation that should never be optimized out by the compiler */
|
/* Implementation that should never be optimized out by the compiler */
|
||||||
static void mbedtls_zeroize( void *v, size_t n ) {
|
static void mbedtls_zeroize( void *v, size_t n ) {
|
||||||
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_PEM_PARSE_C)
|
|
||||||
void mbedtls_pem_init( mbedtls_pem_context *ctx )
|
void mbedtls_pem_init( mbedtls_pem_context *ctx )
|
||||||
{
|
{
|
||||||
memset( ctx, 0, sizeof( mbedtls_pem_context ) );
|
memset( ctx, 0, sizeof( mbedtls_pem_context ) );
|
||||||
|
|
|
@ -259,8 +259,8 @@ int mbedtls_x509_csr_parse_der( mbedtls_x509_csr *csr,
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen )
|
int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen )
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
#if defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_PEM_PARSE_C)
|
||||||
|
int ret;
|
||||||
size_t use_len;
|
size_t use_len;
|
||||||
mbedtls_pem_context pem;
|
mbedtls_pem_context pem;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue