Fixup: Minor style corrections around use of TinyCrypt

This commit is contained in:
Hanno Becker 2019-08-20 13:04:30 +01:00
parent e8f1448306
commit ad353f289b
2 changed files with 10 additions and 5 deletions

View File

@ -552,10 +552,13 @@ static int uecc_eckey_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
((void) md_alg);
p = (unsigned char*) sig;
if( (ret = extract_ecdsa_sig( &p, sig + sig_len, signature, NUM_ECC_BYTES ) ) != 0 )
ret = extract_ecdsa_sig( &p, sig + sig_len, signature, NUM_ECC_BYTES );
if( ret != 0 )
return( ret );
if( (ret = uECC_verify( (uint8_t *) ctx, hash, (unsigned) hash_len, signature, uecc_curve ) ) != 0 )
ret = uECC_verify( (uint8_t *) ctx, hash,
(unsigned) hash_len, signature, uecc_curve );
if( ret != 0 )
return( MBEDTLS_ERR_PK_SIG_LEN_MISMATCH );
return( ret );

View File

@ -554,7 +554,7 @@ static int uecc_public_key_read_binary( uint8_t *pt,
if( ilen < 1 )
return( MBEDTLS_ERR_PK_INVALID_PUBKEY );
//We are not handling the infinity point right now
/* We are not handling the point at infinity. */
if( buf[0] != 0x04 )
return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
@ -962,7 +962,9 @@ static int pk_parse_key_sec1_der( mbedtls_uecc_keypair *keypair,
if( ( ret = uecc_public_key_read_binary( keypair->public_key,
(const unsigned char *) p, end2 - p ) ) == 0 )
{
pubkey_done = 1;
}
else
{
/*