commit | 3053b739bac6ca1f3ec66736f485fa296b3b1526 | [log] [tgz] |
---|---|---|
author | Adam Langley <alangley@gmail.com> | Thu Feb 24 15:41:10 2022 -0800 |
committer | Adam Langley <agl@google.com> | Fri Feb 25 18:01:46 2022 +0000 |
tree | 5c2ac3ad7992a4f365679fd88a074ef537f0cbcd | |
parent | c76da9d46ab56e3fd8457d0493ec7f645b3d4eab [diff] [blame] |
Make ECC self tests lazy. Change-Id: I1b7e4bd5403031232fc1e1ffb3c6e40decac23b9 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/51565 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/fipsmodule/ecdh/ecdh.c b/crypto/fipsmodule/ecdh/ecdh.c index 4e6d0bf..36fbadc 100644 --- a/crypto/fipsmodule/ecdh/ecdh.c +++ b/crypto/fipsmodule/ecdh/ecdh.c
@@ -75,10 +75,13 @@ #include <openssl/sha.h> #include "../ec/internal.h" +#include "../../internal.h" int ECDH_compute_key_fips(uint8_t *out, size_t out_len, const EC_POINT *pub_key, const EC_KEY *priv_key) { + boringssl_ensure_ecc_self_test(); + if (priv_key->priv_key == NULL) { OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); return 0;