mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-26 02:37:08 +00:00
Improving readability of x509_crt and x509write_crt for PR
Signed-off-by: pespacek <peter.spacek@silabs.com>
This commit is contained in:
parent
d924e55944
commit
b9ca22dead
@ -172,8 +172,7 @@ int mbedtls_x509write_crt_set_basic_constraints( mbedtls_x509write_cert *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_SHA1_C)
|
#if defined(MBEDTLS_SHA1_C)
|
||||||
static int mbedtls_x509write_crt_set_key_identifier( mbedtls_x509write_cert
|
static int mbedtls_x509write_crt_set_key_identifier( mbedtls_x509write_cert *ctx,
|
||||||
*ctx,
|
|
||||||
int is_ca,
|
int is_ca,
|
||||||
unsigned char tag )
|
unsigned char tag )
|
||||||
{
|
{
|
||||||
@ -230,15 +229,15 @@ static int mbedtls_x509write_crt_set_key_identifier( mbedtls_x509write_cert
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( is_ca )
|
if( is_ca )
|
||||||
return mbedtls_x509write_crt_set_extension( ctx,
|
return( mbedtls_x509write_crt_set_extension( ctx,
|
||||||
MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER,
|
MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER,
|
||||||
MBEDTLS_OID_SIZE( MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER ),
|
MBEDTLS_OID_SIZE( MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER ),
|
||||||
0, buf + sizeof(buf) - len, len );
|
0, buf + sizeof(buf) - len, len ) );
|
||||||
|
else
|
||||||
return mbedtls_x509write_crt_set_extension( ctx,
|
return( mbedtls_x509write_crt_set_extension( ctx,
|
||||||
MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER,
|
MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER,
|
||||||
MBEDTLS_OID_SIZE( MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER ),
|
MBEDTLS_OID_SIZE( MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER ),
|
||||||
0, buf + sizeof(buf) - len, len );
|
0, buf + sizeof(buf) - len, len ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert *ctx )
|
int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert *ctx )
|
||||||
|
@ -225,7 +225,7 @@ static int x509write_csr_der_internal( mbedtls_x509write_csr *ctx,
|
|||||||
sizeof( hash ),
|
sizeof( hash ),
|
||||||
&hash_len ) != PSA_SUCCESS )
|
&hash_len ) != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
return ( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
|
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
|
||||||
}
|
}
|
||||||
#else /* MBEDTLS_USE_PSA_CRYPTO */
|
#else /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
ret = mbedtls_md( mbedtls_md_info_from_type( ctx->md_alg ), c, len, hash );
|
ret = mbedtls_md( mbedtls_md_info_from_type( ctx->md_alg ), c, len, hash );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user