]> git.ipfire.org Git - thirdparty/grub.git/commit
appended signatures: Parse ASN1 node
authorSudhakar Kuppusamy <sudhakar@linux.ibm.com>
Mon, 6 Oct 2025 07:24:51 +0000 (12:54 +0530)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sat, 11 Oct 2025 13:36:34 +0000 (15:36 +0200)
commit3e4ff6ffb377608de2daa0ee4ff5ac896c0d021f
treee3b0b00ba0fc333d4964f56bc3453c363a099638
parent7d28bdb0b212465bab9aea5f0147fdb3484396c6
appended signatures: Parse ASN1 node

This code allows us to parse ASN1 node and allocating memory to store it.
It will work for anything where the size libtasn1 returns is right:
 - Integers
 - Octet strings
 - DER encoding of other structures

It will _not_ work for things where libtasn1 size requires adjustment:
 - Strings that require an extra NULL byte at the end
 - Bit strings because libtasn1 returns the length in bits, not bytes.

If the function returns a non-NULL value, the caller must free it.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Avnish Chouhan <avnish@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/appendedsig/appendedsig.h [new file with mode: 0644]
grub-core/commands/appendedsig/asn1util.c [new file with mode: 0644]