summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-11-20 23:38:12 +0100
committerAndy Polyakov <appro@openssl.org>2016-11-25 17:22:21 +0100
commit76f572ed0469a277d92378848250b7a9705d3071 (patch)
tree7564570e254a3d95261af07a98acb0801a1c8857 /crypto
parentb47f116b1e02d20b1f8a7488be5a04f7cf5bc712 (diff)
modes/ctr128.c: fix false carry in counter increment procedure.
GH issue #1916 affects only big-endian platforms. TLS is not affected, because TLS fragment is never big enough. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/modes/ctr128.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/modes/ctr128.c b/crypto/modes/ctr128.c
index b7ffb73ab7..03920b4473 100644
--- a/crypto/modes/ctr128.c
+++ b/crypto/modes/ctr128.c
@@ -52,7 +52,7 @@ static void ctr128_inc_aligned(unsigned char *counter)
--n;
d = data[n] += c;
/* did addition carry? */
- c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1);
+ c = ((d - c) & ~d) >> (sizeof(size_t) * 8 - 1);
} while (n);
}
#endif