From 1abe1d717c6b28778ccc40a207d50c2cd6cd9de3 Mon Sep 17 00:00:00 2001 From: Pol Henarejos <55573252+polhenarejos@users.noreply.github.com> Date: Thu, 20 Aug 2026 18:17:50 +0200 Subject: [PATCH] Simplify comment for output buffer reset Updated comment for clarity and removed unnecessary details. --- src/hsm/cmd_initialize.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/hsm/cmd_initialize.c b/src/hsm/cmd_initialize.c index 0eaeb56..d33f363 100644 --- a/src/hsm/cmd_initialize.c +++ b/src/hsm/cmd_initialize.c @@ -239,14 +239,7 @@ int cmd_initialize(void) { return SW_EXEC_ERROR(); } - /* Reset the output buffer before building the device certificate. asn1_cvc_* - * APPEND (output->len += out_len), so without this EF_TERMCA is written with - * the CUMULATIVE length and ends up holding the EE authenticated request - * (tag 0x67) followed by the certificate (tag 7F21) — 940 bytes instead of - * 443. OpenSC then decodes the request as the device certificate. The EE - * request has already been copied into the flash page cache by file_put_data - * above, so reusing the buffer here is safe. */ - certificates.len = 0; + certificates.len = 0; // Reset output buffer if (asn1_cvc_cert(&subject_pk, &certificates, CONST_BYTE_ARRAY(NULL, 0), true) == 0) { mbedtls_ecdsa_free(&ecdsa); return SW_EXEC_ERROR();