mbed TLS upgraded to 2.6.0

Fork of mbedtls by Mark Radbourne

Revision:
2:bbdeda018a3c
Parent:
0:cdf462088d13
diff -r 9ebc941037d5 -r bbdeda018a3c library/gcm.c
--- a/library/gcm.c	Fri Sep 29 18:41:59 2017 +0100
+++ b/library/gcm.c	Fri Sep 29 19:50:30 2017 +0100
@@ -277,8 +277,10 @@
     size_t use_len, olen = 0;
 
     /* IV and AD are limited to 2^64 bits, so 2^61 bytes */
-    if( ( (uint64_t) iv_len  ) >> 61 != 0 ||
-        ( (uint64_t) add_len ) >> 61 != 0 )
+    /* IV is not allowed to be zero length */
+    if( iv_len == 0 ||
+      ( (uint64_t) iv_len  ) >> 61 != 0 ||
+      ( (uint64_t) add_len ) >> 61 != 0 )
     {
         return( MBEDTLS_ERR_GCM_BAD_INPUT );
     }