Corrupt the newhope secret key directly.

Rather than use an internal function in a test (which would need an
OPENSSL_EXPORT to work in a shared-library build), this change corrupts
the secret key directly.

Change-Id: Iee501910b23a0affaa0639dcc773d6ea2d0c5a82
Reviewed-on: https://boringssl-review.googlesource.com/7780
Reviewed-by: Matt Braithwaite <mab@google.com>
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Adam Langley 2016-04-26 16:10:53 -07:00
parent 945cf9a131
commit bc57d55c9f

View File

@ -77,8 +77,8 @@ static int test_invalid_sk_a() {
return 0; return 0;
} }
/* Overwrite the secret key */ /* Corrupt the secret key */
newhope_poly_getnoise(sk); NEWHOPE_keygen(servermsg /* not used below */, sk);
/* Alice uses Bob's response to get her secret key */ /* Alice uses Bob's response to get her secret key */
if (!NEWHOPE_server_compute_key(server_key, sk, clientmsg, if (!NEWHOPE_server_compute_key(server_key, sk, clientmsg,