aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-28 12:36:42 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-01-28 12:36:42 -0500
commita3f2bc8f13eaa0868192b80186710c0765f26c59 (patch)
tree3287f2cf4e1782f6a66a5ea2552ee0476ecbfe5e
parent2c4a2a93d34087afa833b25562341ba02276009c (diff)
parentf3da5f88d73f20ba1d28dde973c41e4ec45a02b6 (diff)
downloadtor-a3f2bc8f13eaa0868192b80186710c0765f26c59.tar.gz
tor-a3f2bc8f13eaa0868192b80186710c0765f26c59.zip
Merge branch 'maint-0.4.3' into maint-0.4.4
-rw-r--r--changes/bug402105
-rw-r--r--src/ext/keccak-tiny/keccak-tiny.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/changes/bug40210 b/changes/bug40210
new file mode 100644
index 0000000000..f492262a11
--- /dev/null
+++ b/changes/bug40210
@@ -0,0 +1,5 @@
+ o Minor features (crypto):
+ - Fix undefined behavior on our Keccak library. The bug only appears on
+ platforms with 32-byte CPU cache lines (e.g. armv5tel) and would result
+ in wrong digests. Fixes bug 40210; bugfix on 0.2.8.1-alpha. Thanks to
+ Bernhard Übelacker, Arnd Bergmann and weasel for diagnosing this.
diff --git a/src/ext/keccak-tiny/keccak-tiny.h b/src/ext/keccak-tiny/keccak-tiny.h
index a9c8ed6420..dd26386a9a 100644
--- a/src/ext/keccak-tiny/keccak-tiny.h
+++ b/src/ext/keccak-tiny/keccak-tiny.h
@@ -21,7 +21,7 @@ typedef struct keccak_state {
size_t offset;
uint8_t finalized : 1;
-} keccak_state;
+} __attribute__((aligned(8))) keccak_state;
/* Initialize a Keccak instance suitable for SHA-3 hash functions. */
int keccak_digest_init(keccak_state *s, size_t bits);