From 1b112e9d18bb9c874b87ce5feabb7906f62351b3 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 8 Dec 2020 12:31:52 +0000 Subject: [asn1] Define ASN1_SHORT() for constructing short tagged values Signed-off-by: Michael Brown --- src/include/ipxe/asn1.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/ipxe/asn1.h b/src/include/ipxe/asn1.h index 5b1af02d4..fdf06f109 100644 --- a/src/include/ipxe/asn1.h +++ b/src/include/ipxe/asn1.h @@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include +#include #include #include #include @@ -99,6 +100,10 @@ struct asn1_builder_header { /** ASN.1 "any tag" magic value */ #define ASN1_ANY -1U +/** Construct a short ASN.1 value */ +#define ASN1_SHORT( tag, ... ) \ + (tag), VA_ARG_COUNT ( __VA_ARGS__ ), __VA_ARGS__ + /** Initial OID byte */ #define ASN1_OID_INITIAL( first, second ) ( ( (first) * 40 ) + (second) ) -- cgit