1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

ASN.1: Introduce helper function to free ASN.1 sequence

This commit is contained in:
Hanno Becker
2019-09-11 14:20:09 +01:00
parent 63e38fe914
commit 12ae27dd0e
3 changed files with 37 additions and 9 deletions

View File

@ -269,7 +269,16 @@ int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end
return( 0 );
}
void mbedtls_asn1_sequence_free( mbedtls_asn1_sequence *seq )
{
while( seq != NULL )
{
mbedtls_asn1_sequence *next = seq->next;
mbedtls_platform_zeroize( seq, sizeof( *seq ) );
mbedtls_free( seq );
seq = next;
}
}
/*
* Parses and splits an ASN.1 "SEQUENCE OF <tag>"