Rename boolean functions to be clearer
diff --git a/library/aes.c b/library/aes.c
index 3983ae3..5dbe910 100644
--- a/library/aes.c
+++ b/library/aes.c
@@ -507,7 +507,7 @@
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16)
if( aes_padlock_ace == -1 )
- aes_padlock_ace = mbedtls_padlock_supports( MBEDTLS_PADLOCK_ACE );
+ aes_padlock_ace = mbedtls_padlock_has_support( MBEDTLS_PADLOCK_ACE );
if( aes_padlock_ace )
ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf );
@@ -516,7 +516,7 @@
ctx->rk = RK = ctx->buf;
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
- if( mbedtls_aesni_supports( MBEDTLS_AESNI_AES ) )
+ if( mbedtls_aesni_has_support( MBEDTLS_AESNI_AES ) )
return( mbedtls_aesni_setkey_enc( (unsigned char *) ctx->rk, key, keysize ) );
#endif
@@ -608,7 +608,7 @@
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16)
if( aes_padlock_ace == -1 )
- aes_padlock_ace = mbedtls_padlock_supports( MBEDTLS_PADLOCK_ACE );
+ aes_padlock_ace = mbedtls_padlock_has_support( MBEDTLS_PADLOCK_ACE );
if( aes_padlock_ace )
ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf );
@@ -623,7 +623,7 @@
ctx->nr = cty.nr;
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
- if( mbedtls_aesni_supports( MBEDTLS_AESNI_AES ) )
+ if( mbedtls_aesni_has_support( MBEDTLS_AESNI_AES ) )
{
mbedtls_aesni_inverse_key( (unsigned char *) ctx->rk,
(const unsigned char *) cty.rk, ctx->nr );
@@ -830,7 +830,7 @@
unsigned char output[16] )
{
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
- if( mbedtls_aesni_supports( MBEDTLS_AESNI_AES ) )
+ if( mbedtls_aesni_has_support( MBEDTLS_AESNI_AES ) )
return( mbedtls_aesni_crypt_ecb( ctx, mode, input, output ) );
#endif
diff --git a/library/aesni.c b/library/aesni.c
index 9982b3b..2165de7 100644
--- a/library/aesni.c
+++ b/library/aesni.c
@@ -46,7 +46,7 @@
/*
* AES-NI support detection routine
*/
-int mbedtls_aesni_supports( unsigned int what )
+int mbedtls_aesni_has_support( unsigned int what )
{
static int done = 0;
static unsigned int c = 0;
diff --git a/library/gcm.c b/library/gcm.c
index a347c06..f84511a 100644
--- a/library/gcm.c
+++ b/library/gcm.c
@@ -126,7 +126,7 @@
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
/* With CLMUL support, we need only h, not the rest of the table */
- if( mbedtls_aesni_supports( MBEDTLS_AESNI_CLMUL ) )
+ if( mbedtls_aesni_has_support( MBEDTLS_AESNI_CLMUL ) )
return( 0 );
#endif
@@ -216,7 +216,7 @@
uint64_t zh, zl;
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
- if( mbedtls_aesni_supports( MBEDTLS_AESNI_CLMUL ) ) {
+ if( mbedtls_aesni_has_support( MBEDTLS_AESNI_CLMUL ) ) {
unsigned char h[16];
PUT_UINT32_BE( ctx->HH[8] >> 32, h, 0 );
diff --git a/library/padlock.c b/library/padlock.c
index e980d24..32654f9 100644
--- a/library/padlock.c
+++ b/library/padlock.c
@@ -47,7 +47,7 @@
/*
* PadLock detection routine
*/
-int mbedtls_padlock_supports( int feature )
+int mbedtls_padlock_has_support( int feature )
{
static int flags = -1;
int ebx = 0, edx = 0;
diff --git a/library/x509.c b/library/x509.c
index 68cc022..bd0d69a 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -962,7 +962,7 @@
return( 0 );
}
-int mbedtls_x509_time_expired( const mbedtls_x509_time *to )
+int mbedtls_x509_time_is_past( const mbedtls_x509_time *to )
{
mbedtls_x509_time now;
@@ -972,7 +972,7 @@
return( x509_check_time( &now, to ) );
}
-int mbedtls_x509_time_future( const mbedtls_x509_time *from )
+int mbedtls_x509_time_is_future( const mbedtls_x509_time *from )
{
mbedtls_x509_time now;
@@ -984,13 +984,13 @@
#else /* MBEDTLS_HAVE_TIME */
-int mbedtls_x509_time_expired( const mbedtls_x509_time *to )
+int mbedtls_x509_time_is_past( const mbedtls_x509_time *to )
{
((void) to);
return( 0 );
}
-int mbedtls_x509_time_future( const mbedtls_x509_time *from )
+int mbedtls_x509_time_is_future( const mbedtls_x509_time *from )
{
((void) from);
return( 0 );
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 3ecda04..a26715a 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1479,7 +1479,7 @@
/*
* Return 1 if the certificate is revoked, or 0 otherwise.
*/
-int mbedtls_x509_crt_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl )
+int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl )
{
const mbedtls_x509_crl_entry *cur = &crl->entry;
@@ -1488,7 +1488,7 @@
if( crt->serial.len == cur->serial.len &&
memcmp( crt->serial.p, cur->serial.p, crt->serial.len ) == 0 )
{
- if( mbedtls_x509_time_expired( &cur->revocation_date ) )
+ if( mbedtls_x509_time_is_past( &cur->revocation_date ) )
return( 1 );
}
@@ -1565,16 +1565,16 @@
/*
* Check for validity of CRL (Do not drop out)
*/
- if( mbedtls_x509_time_expired( &crl_list->next_update ) )
+ if( mbedtls_x509_time_is_past( &crl_list->next_update ) )
flags |= MBEDTLS_X509_BADCRL_EXPIRED;
- if( mbedtls_x509_time_future( &crl_list->this_update ) )
+ if( mbedtls_x509_time_is_future( &crl_list->this_update ) )
flags |= MBEDTLS_X509_BADCRL_FUTURE;
/*
* Check if certificate is revoked
*/
- if( mbedtls_x509_crt_revoked( crt, crl_list ) )
+ if( mbedtls_x509_crt_is_revoked( crt, crl_list ) )
{
flags |= MBEDTLS_X509_BADCERT_REVOKED;
break;
@@ -1774,10 +1774,10 @@
unsigned char hash[MBEDTLS_MD_MAX_SIZE];
const mbedtls_md_info_t *md_info;
- if( mbedtls_x509_time_expired( &child->valid_to ) )
+ if( mbedtls_x509_time_is_past( &child->valid_to ) )
*flags |= MBEDTLS_X509_BADCERT_EXPIRED;
- if( mbedtls_x509_time_future( &child->valid_from ) )
+ if( mbedtls_x509_time_is_future( &child->valid_from ) )
*flags |= MBEDTLS_X509_BADCERT_FUTURE;
/*
@@ -1851,10 +1851,10 @@
((void) ca_crl);
#endif
- if( mbedtls_x509_time_expired( &trust_ca->valid_to ) )
+ if( mbedtls_x509_time_is_past( &trust_ca->valid_to ) )
ca_flags |= MBEDTLS_X509_BADCERT_EXPIRED;
- if( mbedtls_x509_time_future( &trust_ca->valid_from ) )
+ if( mbedtls_x509_time_is_future( &trust_ca->valid_from ) )
ca_flags |= MBEDTLS_X509_BADCERT_FUTURE;
if( NULL != f_vrfy )
@@ -1898,10 +1898,10 @@
return( MBEDTLS_ERR_X509_CERT_VERIFY_FAILED );
}
- if( mbedtls_x509_time_expired( &child->valid_to ) )
+ if( mbedtls_x509_time_is_past( &child->valid_to ) )
*flags |= MBEDTLS_X509_BADCERT_EXPIRED;
- if( mbedtls_x509_time_future( &child->valid_from ) )
+ if( mbedtls_x509_time_is_future( &child->valid_from ) )
*flags |= MBEDTLS_X509_BADCERT_FUTURE;
md_info = mbedtls_md_info_from_type( child->sig_md );