aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-12-08 12:31:52 +0000
committerMichael Brown <mcb30@ipxe.org>2020-12-08 12:38:45 +0000
commit1b112e9d18bb9c874b87ce5feabb7906f62351b3 (patch)
tree6dcfc518dd201191384e9cadf8e91202a927eda4
parente4b6328c84cf3dcbb4af9ba42b2e3cbbb2cfbfee (diff)
downloadipxe-1b112e9d18bb9c874b87ce5feabb7906f62351b3.zip
ipxe-1b112e9d18bb9c874b87ce5feabb7906f62351b3.tar.gz
ipxe-1b112e9d18bb9c874b87ce5feabb7906f62351b3.tar.bz2
[asn1] Define ASN1_SHORT() for constructing short tagged values
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/include/ipxe/asn1.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/ipxe/asn1.h b/src/include/ipxe/asn1.h
index 5b1af02..fdf06f1 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 <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) )