diff options
author | Leandro Pereira <[email protected]> | 2017-08-18 15:49:05 -0700 |
---|---|---|
committer | Leandro Pereira <[email protected]> | 2017-08-18 15:49:05 -0700 |
commit | d096247c1ab5603d12c777326bb256df81340023 (patch) | |
tree | 9eff1f57764c1aa0965d32be956ee78ea0b67b0a /tests | |
parent | 489bc65eb4af2cf115ff678e80908fb3c1e3b78d (diff) |
tests: ecc_dh: Do not use unitialized variable
The `z` vector was not initialized in the call to
uECC_vli_nativeToBytes(), resulting in undefined behavior. Use the
properly initialized `exp_z` array instead.
Signed-off-by: Leandro Pereira <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ecc_dh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_ecc_dh.c b/tests/test_ecc_dh.c index d806a3d..5cfd737 100644 --- a/tests/test_ecc_dh.c +++ b/tests/test_ecc_dh.c @@ -94,7 +94,7 @@ int ecdh_vectors(char **qx_vec, char **qy_vec, char **d_vec, char **z_vec, uint8_t private_bytes[NUM_ECC_BYTES]; uECC_vli_nativeToBytes(private_bytes, NUM_ECC_BYTES, prv); uint8_t z_bytes[NUM_ECC_BYTES]; - uECC_vli_nativeToBytes(z_bytes, NUM_ECC_BYTES, z); + uECC_vli_nativeToBytes(z_bytes, NUM_ECC_BYTES, exp_z); rc = uECC_shared_secret(pub_bytes, private_bytes, z_bytes, curve); |