Add missing const attribute to asn1 api

Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
Mateusz Starzyk 2021-01-26 13:57:43 +01:00
parent a120146afe
commit 59961cfc73
3 changed files with 4 additions and 4 deletions

View file

@ -578,7 +578,7 @@ int mbedtls_asn1_get_alg_null( unsigned char **p,
*
* \return NULL if not found, or a pointer to the existing entry.
*/
mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list,
const mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( const mbedtls_asn1_named_data *list,
const char *oid, size_t len );
/**

View file

@ -461,7 +461,7 @@ void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head )
}
}
mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list,
const mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( const mbedtls_asn1_named_data *list,
const char *oid, size_t len )
{
while( list != NULL )

View file

@ -718,7 +718,7 @@ void find_named_data( data_t *oid0, data_t *oid1, data_t *oid2, data_t *oid3,
};
mbedtls_asn1_named_data *pointers[ARRAY_LENGTH( nd ) + 1];
size_t i;
mbedtls_asn1_named_data *found;
const mbedtls_asn1_named_data *found;
for( i = 0; i < ARRAY_LENGTH( nd ); i++ )
pointers[i] = &nd[i];
@ -726,7 +726,7 @@ void find_named_data( data_t *oid0, data_t *oid1, data_t *oid2, data_t *oid3,
for( i = 0; i < ARRAY_LENGTH( nd ); i++ )
nd[i].next = pointers[i+1];
found = mbedtls_asn1_find_named_data( pointers[from],
found = mbedtls_asn1_find_named_data( (const mbedtls_asn1_named_data*) pointers[from],
(const char *) needle->x,
needle->len );
TEST_ASSERT( found == pointers[position] );