mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 07:28:08 +00:00
Use X509 CRT version macros for version checks in x509write_crt_der
This commit is contained in:
parent
7f3652ddf1
commit
a20e33ad59
1 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@ int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf,
|
|||
*/
|
||||
|
||||
/* Only for v3 */
|
||||
if( ctx->version == 2 )
|
||||
if( ctx->version == MBEDTLS_X509_CRT_VERSION_3 )
|
||||
{
|
||||
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_extensions( &c, tmp_buf, ctx->extensions ) );
|
||||
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) );
|
||||
|
@ -397,7 +397,7 @@ int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf,
|
|||
*/
|
||||
|
||||
/* Can be omitted for v1 */
|
||||
if( ctx->version > 0 )
|
||||
if( ctx->version != MBEDTLS_X509_CRT_VERSION_1 )
|
||||
{
|
||||
sub_len = 0;
|
||||
MBEDTLS_ASN1_CHK_ADD( sub_len, mbedtls_asn1_write_int( &c, tmp_buf, ctx->version ) );
|
||||
|
|
Loading…
Reference in a new issue