mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 16:05:43 +01:00
Style fixes in pem, x509_crl and buf_alloc
This commit is contained in:
parent
8ec3bfe180
commit
f1ee63562a
@ -184,7 +184,7 @@ static int verify_chain()
|
||||
{
|
||||
memory_header *prv = heap.first, *cur;
|
||||
|
||||
if( heap.first == NULL || verify_header( heap.first ) != 0 )
|
||||
if( prv == NULL || verify_header( prv ) != 0 )
|
||||
{
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf( stderr, "FATAL: verification of first header "
|
||||
|
@ -435,7 +435,8 @@ int mbedtls_pem_write_buffer( const char *header, const char *footer,
|
||||
return( MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL );
|
||||
}
|
||||
|
||||
if( use_len != 0 && ( encode_buf = mbedtls_calloc( 1, use_len ) ) == NULL )
|
||||
if( use_len != 0 &&
|
||||
( ( encode_buf = mbedtls_calloc( 1, use_len ) ) == NULL ) )
|
||||
return( MBEDTLS_ERR_PEM_ALLOC_FAILED );
|
||||
|
||||
if( ( ret = mbedtls_base64_encode( encode_buf, use_len, &use_len, der_data,
|
||||
|
@ -257,7 +257,7 @@ int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain,
|
||||
{
|
||||
int ret;
|
||||
size_t len;
|
||||
unsigned char *p = NULL, *end;
|
||||
unsigned char *p = NULL, *end = NULL;
|
||||
mbedtls_x509_buf sig_params1, sig_params2, sig_oid2;
|
||||
mbedtls_x509_crl *crl = chain;
|
||||
|
||||
@ -294,7 +294,7 @@ int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain,
|
||||
/*
|
||||
* Copy raw DER-encoded CRL
|
||||
*/
|
||||
if( buflen != 0 && ( p = mbedtls_calloc( 1, buflen ) ) == NULL )
|
||||
if( buflen != 0 && ( ( p = mbedtls_calloc( 1, buflen ) ) == NULL ) )
|
||||
return( MBEDTLS_ERR_X509_ALLOC_FAILED );
|
||||
|
||||
memcpy( p, buf, buflen );
|
||||
|
Loading…
Reference in New Issue
Block a user