commit c2189bc67e1cc3ebb53a5dc071e2612b7be11d03
parent 0b4509d8d2cb1ea75651892e7cae8a07760ee4dd
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Fri, 11 Jan 2019 09:16:05 -0800
sae: fix one-off error in sae_is_quadradic_residue
This fixes the valgrind warning:
==14804== Conditional jump or move depends on uninitialised value(s)
==14804== at 0x402E56: sae_is_quadradic_residue (sae.c:218)
==14804== by 0x402E56: sae_compute_pwe (sae.c:272)
==14804== by 0x402E56: sae_build_commit (sae.c:333)
==14804== by 0x402E56: sae_send_commit (sae.c:591)
==14804== by 0x401CC3: test_confirm_after_accept (test-sae.c:454)
==14804== by 0x408A28: l_test_run (test.c:83)
==14804== by 0x401427: main (test-sae.c:566)
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sae.c b/src/sae.c
@@ -215,7 +215,7 @@ static bool sae_is_quadradic_residue(const struct l_ecc_curve *curve,
return false;
}
- if (rbuf[bytes / 8] & 1) {
+ if (rbuf[bytes / 8 - 1] & 1) {
l_ecc_scalar_multiply(num, num, qr);
if (l_ecc_scalar_legendre(num) == -1) {