Add countermeasure against cache-based lucky 13

This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-29 01:35:48 +02:00
parent 9ce1bdc151
commit 47fede0d6d
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,8 @@ Security
* With authmode set to SSL_VERIFY_OPTIONAL, verification of keyUsage and * With authmode set to SSL_VERIFY_OPTIONAL, verification of keyUsage and
extendedKeyUsage on the leaf certificate was lost (results not accessible extendedKeyUsage on the leaf certificate was lost (results not accessible
via ssl_get_verify_results()). via ssl_get_verify_results()).
* Add countermeasure against "Lucky 13 strikes back" cache-based attack,
https://dl.acm.org/citation.cfm?id=2714625
Features Features
* Add x509_crt_verify_info() to display certificate verification results. * Add x509_crt_verify_info() to display certificate verification results.

View File

@ -1825,7 +1825,8 @@ static int ssl_decrypt_buf( ssl_context *ssl )
ssl->in_msglen ); ssl->in_msglen );
md_hmac_finish( &ssl->transform_in->md_ctx_dec, md_hmac_finish( &ssl->transform_in->md_ctx_dec,
ssl->in_msg + ssl->in_msglen ); ssl->in_msg + ssl->in_msglen );
for( j = 0; j < extra_run; j++ ) /* Call md_process at least once due to cache attacks */
for( j = 0; j < extra_run + 1; j++ )
md_process( &ssl->transform_in->md_ctx_dec, ssl->in_msg ); md_process( &ssl->transform_in->md_ctx_dec, ssl->in_msg );
md_hmac_reset( &ssl->transform_in->md_ctx_dec ); md_hmac_reset( &ssl->transform_in->md_ctx_dec );