projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b47f116
)
modes/ctr128.c: fix false carry in counter increment procedure.
author
Andy Polyakov
<appro@openssl.org>
Sun, 20 Nov 2016 22:38:12 +0000
(23:38 +0100)
committer
Andy Polyakov
<appro@openssl.org>
Fri, 25 Nov 2016 16:22:21 +0000
(17:22 +0100)
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>
crypto/modes/ctr128.c
patch
|
blob
|
history
diff --git
a/crypto/modes/ctr128.c
b/crypto/modes/ctr128.c
index b7ffb73ab7312f0ea30df30a986475a43ffc3fca..03920b447333eaef3ce68dced46d0bccc5aa3568 100644
(file)
--- 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