Minor changes to asn1write.c

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2022-10-25 10:16:45 +01:00
parent 3f44e5b11a
commit 059848ff23

View file

@ -78,11 +78,11 @@ int mbedtls_asn1_write_len( unsigned char **p, const unsigned char *start, size_
return( 4 );
}
int len_valid = 1;
int len_is_valid = 1;
#if SIZE_MAX > 0xFFFFFFFF
len_valid = ( len <= 0xFFFFFFFF );
len_is_valid = ( len <= 0xFFFFFFFF );
#endif
if( len_valid )
if( len_is_valid )
{
if( *p - start < 5 )
return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL );
@ -94,10 +94,8 @@ int mbedtls_asn1_write_len( unsigned char **p, const unsigned char *start, size_
*--(*p) = 0x84;
return( 5 );
}
else
{
return( MBEDTLS_ERR_ASN1_INVALID_LENGTH );
}
return( MBEDTLS_ERR_ASN1_INVALID_LENGTH );
}
int mbedtls_asn1_write_tag( unsigned char **p, const unsigned char *start, unsigned char tag )