diff options
Diffstat (limited to 'board/cr50/dcrypto/x509.c')
-rw-r--r-- | board/cr50/dcrypto/x509.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/board/cr50/dcrypto/x509.c b/board/cr50/dcrypto/x509.c index 3850100443..9005325a3e 100644 --- a/board/cr50/dcrypto/x509.c +++ b/board/cr50/dcrypto/x509.c @@ -428,6 +428,7 @@ int DCRYPTO_x509_gen_u2f_cert_name(const p256_int *d, const p256_int *pk_x, struct sha256_ctx sha; p256_int h, r, s; struct drbg_ctx drbg; + int result; SEQ_START(ctx, V_SEQ, SEQ_LARGE) { /* outer seq */ /* @@ -517,7 +518,9 @@ int DCRYPTO_x509_gen_u2f_cert_name(const p256_int *d, const p256_int *pk_x, SHA256_update(&sha, body, (ctx.p + ctx.n) - body); p256_from_bin(SHA256_final(&sha)->b8, &h); hmac_drbg_init_rfc6979(&drbg, d, &h); - if (!dcrypto_p256_ecdsa_sign(&drbg, d, &h, &r, &s)) + result = dcrypto_p256_ecdsa_sign(&drbg, d, &h, &r, &s); + drbg_exit(&drbg); + if (!result) return 0; /* Append X509 signature */ |