Move length check into mbedtls_x509_memcasecmp()

At every occasion where we're using `mbedtls_x509_memcasecmp()` we're
checking that the two buffer lengths coincide before making the call.

This commit saves a few bytes of code by moving this length check
to `mbedtls_x509_memcasecmp()`.
This commit is contained in:
Hanno Becker 2019-02-22 11:46:06 +00:00
parent f1b39bf18c
commit b3def1d341
3 changed files with 13 additions and 11 deletions

View file

@ -318,7 +318,8 @@ int mbedtls_x509_name_cmp_raw( mbedtls_x509_buf_raw const *a,
mbedtls_x509_buf *oid,
mbedtls_x509_buf *val ),
void *check_ctx );
int mbedtls_x509_memcasecmp( const void *s1, const void *s2, size_t len );
int mbedtls_x509_memcasecmp( const void *s1, const void *s2,
size_t len1, size_t lend2 );
int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end,
mbedtls_x509_buf *ext, int tag );