Changed every memcmp to SCA equivalent mbedtls_platform_memcmp
This makes physical attacks more difficult.
Selftest memcmp functions were not changed.
diff --git a/library/x509.c b/library/x509.c
index d570f71..1e61db8 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -500,7 +500,7 @@
{
if( a->tag == b->tag &&
a->len == b->len &&
- memcmp( a->p, b->p, b->len ) == 0 )
+ mbedtls_platform_memcmp( a->p, b->p, b->len ) == 0 )
{
return( 0 );
}
@@ -589,7 +589,7 @@
goto exit;
if( oid[0].len != oid[1].len ||
- memcmp( oid[0].p, oid[1].p, oid[1].len ) != 0 )
+ mbedtls_platform_memcmp( oid[0].p, oid[1].p, oid[1].len ) != 0 )
{
return( 1 );
}