Remove a trivially true OPENSSL_assert
authorMatt Caswell <matt@openssl.org>
Fri, 30 Oct 2015 16:39:29 +0000 (16:39 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 2 Nov 2015 14:29:37 +0000 (14:29 +0000)
This OPENSSL_assert in (d)tls1_hearbeat is trivially always going to be
true because it is testing the sum of values that have been set as
constants just a few lines above and nothing has changed them. Therefore
remove this.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/d1_lib.c
ssl/t1_lib.c

index 733973b332fa4311e2188c3675397e9a4b95fd4c..b865ad42b27c0f08796ebda712eaecc4c65b742c 100644 (file)
@@ -1023,12 +1023,6 @@ int dtls1_heartbeat(SSL *s)
         return -1;
     }
 
-    /*
-     * Check if padding is too long, payload and padding must not exceed 2^14
-     * - 3 = 16381 bytes in total.
-     */
-    OPENSSL_assert(payload + padding <= 16381);
-
     /*-
      * Create HeartBeat message, we just use a sequence number
      * as payload to distuingish different messages and add
index f42fb64700433fe3de5b6aa322997c7b1b50d8c8..2db0d74ab16fa3e6fab1064ea4408fc9e2b964c3 100644 (file)
@@ -3685,12 +3685,6 @@ int tls1_heartbeat(SSL *s)
         return -1;
     }
 
-    /*
-     * Check if padding is too long, payload and padding must not exceed 2^14
-     * - 3 = 16381 bytes in total.
-     */
-    OPENSSL_assert(payload + padding <= 16381);
-
     /*-
      * Create HeartBeat message, we just use a sequence number
      * as payload to distuingish different messages and add