[crypto] Avoid false positive warnings about mutating static state

iPXE is single-threaded by design, but automated tools still tend to
erroneously report the mutation of static state as being unsafe,
especially when that mutation happens within cryptographic code.

At the cost of six bytes in the 32-bit BIOS binary, allocate the
reference algorithm ASN.1 cursor on the stack to eliminate this class
of false positive warning.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-08-03 16:11:34 +01:00
parent 75fe3d50ce
commit 0471d6d131
+1 -1
View File
@@ -481,7 +481,7 @@ static int ocsp_parse_responder_id ( struct ocsp_check *ocsp,
*/
static int ocsp_parse_cert_id ( struct ocsp_check *ocsp,
const struct asn1_cursor *raw ) {
static struct asn1_cursor algorithm = {
struct asn1_cursor algorithm = {
.data = ocsp_algorithm_id,
.len = sizeof ( ocsp_algorithm_id ),
};