diff --git a/ChangeLog b/ChangeLog index 8a736f971..4526254da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ mbed TLS ChangeLog (Sorted per branch, date) += mbed TLS 2.2.1 released 2015-12-xx + +Bugfix + * Fix over-restricive length limit in GCM. Found by Andreas-N. #362 + = mbed TLS 2.2.0 released 2015-11-04 Security diff --git a/library/gcm.c b/library/gcm.c index 4298254d2..aaacf97d6 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -362,7 +362,7 @@ int mbedtls_gcm_update( mbedtls_gcm_context *ctx, /* Total length is restricted to 2^39 - 256 bits, ie 2^36 - 2^5 bytes * Also check for possible overflow */ if( ctx->len + length < ctx->len || - (uint64_t) ctx->len + length > 0x03FFFFE0ull ) + (uint64_t) ctx->len + length > 0xFFFFFFFE0ull ) { return( MBEDTLS_ERR_GCM_BAD_INPUT ); }