mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 08:55:40 +01:00
Consistently use (type *) instead of (type*) for pointer conversion
This commit is contained in:
parent
2ba9fbdfe9
commit
484caf0abc
@ -127,7 +127,7 @@ int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs )
|
||||
|
||||
if( X->n < nblimbs )
|
||||
{
|
||||
if( ( p = (mbedtls_mpi_uint*)mbedtls_calloc( nblimbs, ciL ) ) == NULL )
|
||||
if( ( p = (mbedtls_mpi_uint *)mbedtls_calloc( nblimbs, ciL ) ) == NULL )
|
||||
return( MBEDTLS_ERR_MPI_ALLOC_FAILED );
|
||||
|
||||
if( X->p != NULL )
|
||||
@ -169,7 +169,7 @@ int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs )
|
||||
if( i < nblimbs )
|
||||
i = nblimbs;
|
||||
|
||||
if( ( p = (mbedtls_mpi_uint*)mbedtls_calloc( i, ciL ) ) == NULL )
|
||||
if( ( p = (mbedtls_mpi_uint *)mbedtls_calloc( i, ciL ) ) == NULL )
|
||||
return( MBEDTLS_ERR_MPI_ALLOC_FAILED );
|
||||
|
||||
if( X->p != NULL )
|
||||
|
@ -331,13 +331,13 @@ int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx,
|
||||
? MBEDTLS_CHACHAPOLY_ENCRYPT
|
||||
: MBEDTLS_CHACHAPOLY_DECRYPT;
|
||||
|
||||
result = mbedtls_chachapoly_starts( (mbedtls_chachapoly_context*) ctx->cipher_ctx,
|
||||
result = mbedtls_chachapoly_starts( (mbedtls_chachapoly_context *) ctx->cipher_ctx,
|
||||
ctx->iv,
|
||||
mode );
|
||||
if ( result != 0 )
|
||||
return( result );
|
||||
|
||||
return( mbedtls_chachapoly_update_aad( (mbedtls_chachapoly_context*) ctx->cipher_ctx,
|
||||
return( mbedtls_chachapoly_update_aad( (mbedtls_chachapoly_context *) ctx->cipher_ctx,
|
||||
ad, ad_len ) );
|
||||
}
|
||||
#endif
|
||||
@ -391,7 +391,7 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i
|
||||
if ( ctx->cipher_info->type == MBEDTLS_CIPHER_CHACHA20_POLY1305 )
|
||||
{
|
||||
*olen = ilen;
|
||||
return( mbedtls_chachapoly_update( (mbedtls_chachapoly_context*) ctx->cipher_ctx,
|
||||
return( mbedtls_chachapoly_update( (mbedtls_chachapoly_context *) ctx->cipher_ctx,
|
||||
ilen, input, output ) );
|
||||
}
|
||||
#endif
|
||||
@ -924,7 +924,7 @@ int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx,
|
||||
if ( tag_len != 16U )
|
||||
return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
||||
return( mbedtls_chachapoly_finish( (mbedtls_chachapoly_context*) ctx->cipher_ctx,
|
||||
return( mbedtls_chachapoly_finish( (mbedtls_chachapoly_context *) ctx->cipher_ctx,
|
||||
tag ) );
|
||||
}
|
||||
#endif
|
||||
@ -975,7 +975,7 @@ int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx,
|
||||
if ( tag_len != sizeof( check_tag ) )
|
||||
return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
||||
ret = mbedtls_chachapoly_finish( (mbedtls_chachapoly_context*) ctx->cipher_ctx,
|
||||
ret = mbedtls_chachapoly_finish( (mbedtls_chachapoly_context *) ctx->cipher_ctx,
|
||||
check_tag );
|
||||
if ( ret != 0 )
|
||||
{
|
||||
|
@ -1987,7 +1987,7 @@ static int chachapoly_setkey_wrap( void *ctx,
|
||||
if( key_bitlen != 256U )
|
||||
return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
||||
if ( 0 != mbedtls_chachapoly_setkey( (mbedtls_chachapoly_context*)ctx, key ) )
|
||||
if ( 0 != mbedtls_chachapoly_setkey( (mbedtls_chachapoly_context *)ctx, key ) )
|
||||
return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
||||
return( 0 );
|
||||
|
@ -71,7 +71,7 @@ static inline void debug_send_line( const mbedtls_ssl_context *ssl, int level,
|
||||
*/
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
char idstr[20 + DEBUG_BUF_SIZE]; /* 0x + 16 nibbles + ': ' */
|
||||
mbedtls_snprintf( idstr, sizeof( idstr ), "%p: %s", (void*)ssl, str );
|
||||
mbedtls_snprintf( idstr, sizeof( idstr ), "%p: %s", (void *)ssl, str );
|
||||
ssl->conf->f_dbg( ssl->conf->p_dbg, level, file, line, idstr );
|
||||
#else
|
||||
ssl->conf->f_dbg( ssl->conf->p_dbg, level, file, line, str );
|
||||
|
@ -72,8 +72,8 @@
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#define read(fd,buf,len) recv( fd, (char*)( buf ), (int)( len ), 0 )
|
||||
#define write(fd,buf,len) send( fd, (char*)( buf ), (int)( len ), 0 )
|
||||
#define read(fd,buf,len) recv( fd, (char *)( buf ), (int)( len ), 0 )
|
||||
#define write(fd,buf,len) send( fd, (char *)( buf ), (int)( len ), 0 )
|
||||
#define close(fd) closesocket(fd)
|
||||
|
||||
static int wsa_init_done = 0;
|
||||
|
@ -849,7 +849,7 @@ static int x509_get_ext_key_usage( unsigned char **p,
|
||||
0xFF, MBEDTLS_ASN1_OID,
|
||||
0, 0,
|
||||
asn1_build_sequence_cb,
|
||||
(void*) &ext_key_usage ) );
|
||||
(void *) &ext_key_usage ) );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -888,7 +888,7 @@ static int x509_get_subject_alt_name( unsigned char *p,
|
||||
MBEDTLS_ASN1_TAG_VALUE_MASK,
|
||||
2 /* SubjectAlt DNS */,
|
||||
asn1_build_sequence_cb,
|
||||
(void*) &subject_alt_name ) );
|
||||
(void *) &subject_alt_name ) );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3367,13 +3367,13 @@ static int x509_crt_verify_name( const mbedtls_x509_crt *crt,
|
||||
MBEDTLS_ASN1_TAG_VALUE_MASK,
|
||||
2 /* SubjectAlt DNS */,
|
||||
x509_crt_subject_alt_check_name,
|
||||
(void*) cn );
|
||||
(void *) cn );
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = mbedtls_x509_name_cmp_raw( &frame->subject_raw,
|
||||
&frame->subject_raw,
|
||||
x509_crt_check_name, (void*) cn );
|
||||
x509_crt_check_name, (void *) cn );
|
||||
}
|
||||
|
||||
mbedtls_x509_crt_frame_release( crt );
|
||||
|
Loading…
Reference in New Issue
Block a user