Generalized the x509write_csr_set_key_usage() function and key_usage

storage
This commit is contained in:
Paul Bakker 2013-08-26 12:05:14 +02:00
parent 6db915b5a9
commit e5eae76bf0
5 changed files with 149 additions and 37 deletions

View file

@ -343,4 +343,32 @@ int asn1_get_alg_null( unsigned char **p,
return( 0 );
}
void asn1_free_named_data( asn1_named_data *cur )
{
if( cur == NULL )
return;
polarssl_free( cur->oid.p );
polarssl_free( cur->val.p );
memset( cur, 0, sizeof( asn1_named_data ) );
}
asn1_named_data *asn1_find_named_data( asn1_named_data *list,
const char *oid, size_t len )
{
while( list != NULL )
{
if( list->oid.len == len &&
memcmp( list->oid.p, oid, len ) == 0 )
{
break;
}
list = list->next;
}
return( list );
}
#endif