aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-27 14:16:25 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-27 14:16:25 +0100
commit42d7573ff5087142f1c4aaf3fc52508da2512176 (patch)
tree185257eae1d2809475676eda2b85a1d6e7d65663
parentfetcher: use sha512 from bcrypt (diff)
downloadwireguard-windows-42d7573ff5087142f1c4aaf3fc52508da2512176.tar.xz
wireguard-windows-42d7573ff5087142f1c4aaf3fc52508da2512176.zip
fetcher: make malleability checks work on big endian
Doesn't matter for us, but still probably a good idea. This has also been reported upstream. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--installer/fetcher/crypto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/installer/fetcher/crypto.c b/installer/fetcher/crypto.c
index 397120d7..154eac37 100644
--- a/installer/fetcher/crypto.c
+++ b/installer/fetcher/crypto.c
@@ -2101,9 +2101,10 @@ bool ed25519_verify(const uint8_t signature[64], const uint8_t public_key[32],
UINT64_C(0x1000000000000000),
};
for (size_t i = 3;; --i) {
- if (scopy.u64[i] > kOrder[i]) {
+ uint64_t le = swap_le64(scopy.u64[i]);
+ if (le > kOrder[i]) {
return false;
- } else if (scopy.u64[i] < kOrder[i]) {
+ } else if (le < kOrder[i]) {
break;
} else if (i == 0) {
return false;