summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-03-29 17:51:43 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-04-03 16:58:44 +0100
commit4fb6b0def17df98d6d16418b4b23dfde54a980ae (patch)
tree0f3be598f7786349c9ef552c55320b8933ebd674 /include
parent22ebaae08c6c10de1e6b0225531c94e5866070d7 (diff)
Add macro to implement static encode functions.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'include')
-rw-r--r--include/openssl/asn1t.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h
index 7a2611ef68..dfd9dac161 100644
--- a/include/openssl/asn1t.h
+++ b/include/openssl/asn1t.h
@@ -825,6 +825,19 @@ typedef struct ASN1_STREAM_ARG_st {
return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
}
+# define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \
+ static stname *d2i_##stname(stname **a, \
+ const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
+ ASN1_ITEM_rptr(stname)); \
+ } \
+ static int i2d_##stname(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, \
+ ASN1_ITEM_rptr(stname)); \
+ }
+
/*
* This includes evil casts to remove const: they will go away when full ASN1
* constification is done.