diff options
author | Howard Yang <hcyang@google.com> | 2021-12-29 15:33:27 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-29 16:10:42 +0000 |
commit | 74c466bee3adb64232f5aa3b613a54891558e40c (patch) | |
tree | cf65b9e23cbb94d9750c7775bc38357a17c3d3ea | |
parent | afa982f68705d35522e19133650d3985677a2d36 (diff) | |
download | chrome-ec-74c466bee3adb64232f5aa3b613a54891558e40c.tar.gz |
cr50: Fix x509_gen_u2f_cert_name
Logical error introduced in crrev.com/c/3179708 that causes x509 gen u2f
cert failed. Fix the incorrect interpretation of the `result` variable in
an `if` statement.
BUG=b:211820657
TEST=make buildall -j
TEST=manual test, u2fd get g2f certificate doesn't fail anymore
Change-Id: I37aaa5946c43896458c93a67352b5f2d92a1965a
Signed-off-by: Howard Yang <hcyang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360325
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r-- | board/cr50/dcrypto/x509.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/cr50/dcrypto/x509.c b/board/cr50/dcrypto/x509.c index 2094f8dad4..4417f1701b 100644 --- a/board/cr50/dcrypto/x509.c +++ b/board/cr50/dcrypto/x509.c @@ -521,7 +521,7 @@ int DCRYPTO_x509_gen_u2f_cert_name(const p256_int *d, const p256_int *pk_x, hmac_drbg_init_rfc6979(&drbg, d, &h); result = dcrypto_p256_ecdsa_sign(&drbg, d, &h, &r, &s) - DCRYPTO_OK; drbg_exit(&drbg); - if (!result) + if (result) return 0; /* Append X509 signature */ |