mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-03 00:10:58 +00:00
Fix double-check for bad signature
In the previous version, it was enough for the attacker to glitch the top-level 'if' to skip the entire block. We want two independent blocks here, so that an attacker can only succeed with two successive glitches.
This commit is contained in:
parent
4c9b556e38
commit
18761926a8
|
@ -3547,13 +3547,11 @@ find_parent:
|
|||
/* signature was checked while searching parent */
|
||||
signature_is_good_fi = signature_is_good;
|
||||
if( signature_is_good_fi != X509_SIGNATURE_IS_GOOD )
|
||||
{
|
||||
*flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED | X509_BADCERT_FI_EXTRA;
|
||||
|
||||
mbedtls_platform_enforce_volatile_reads();
|
||||
if( signature_is_good_fi != X509_SIGNATURE_IS_GOOD )
|
||||
*flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED | X509_BADCERT_FI_EXTRA;
|
||||
}
|
||||
mbedtls_platform_enforce_volatile_reads();
|
||||
if( signature_is_good_fi != X509_SIGNATURE_IS_GOOD )
|
||||
*flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED | X509_BADCERT_FI_EXTRA;
|
||||
|
||||
{
|
||||
mbedtls_pk_context *parent_pk;
|
||||
|
|
Loading…
Reference in a new issue