]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[asn1] Define ASN1_SHORT() for constructing short tagged values
authorMichael Brown <mcb30@ipxe.org>
Tue, 8 Dec 2020 12:31:52 +0000 (12:31 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 8 Dec 2020 12:38:45 +0000 (12:38 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/asn1.h

index 5b1af02d47ce4bc9b11f176c554cebee0e3231ba..fdf06f10973c1b560d020790a12d5408269ad31a 100644 (file)
@@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <stddef.h>
 #include <stdint.h>
+#include <stdarg.h>
 #include <assert.h>
 #include <time.h>
 #include <ipxe/tables.h>
@@ -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) )