summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms/cms_lib.c
diff options
context:
space:
mode:
authorjsing <>2019-08-11 10:15:30 +0000
committerjsing <>2019-08-11 10:15:30 +0000
commitaa695fbdbecb8a63a9f0f512222e04a0be2b9734 (patch)
treea038b26f2da29ed31383201d4852270882e9961e /src/lib/libcrypto/cms/cms_lib.c
parentfa447988cd063cd304b8a827bbc5ad99dea4a159 (diff)
downloadopenbsd-aa695fbdbecb8a63a9f0f512222e04a0be2b9734.tar.gz
openbsd-aa695fbdbecb8a63a9f0f512222e04a0be2b9734.tar.bz2
openbsd-aa695fbdbecb8a63a9f0f512222e04a0be2b9734.zip
Expand ASN.1 macros.
Diffstat (limited to 'src/lib/libcrypto/cms/cms_lib.c')
-rw-r--r--src/lib/libcrypto/cms/cms_lib.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/lib/libcrypto/cms/cms_lib.c b/src/lib/libcrypto/cms/cms_lib.c
index 71c6796dbb..7f02d6daae 100644
--- a/src/lib/libcrypto/cms/cms_lib.c
+++ b/src/lib/libcrypto/cms/cms_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_lib.c,v 1.10 2019/08/10 18:15:52 jsing Exp $ */ 1/* $OpenBSD: cms_lib.c,v 1.11 2019/08/11 10:15:30 jsing Exp $ */
2/* 2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4 * project. 4 * project.
@@ -61,8 +61,38 @@
61#include <openssl/cms.h> 61#include <openssl/cms.h>
62#include "cms_lcl.h" 62#include "cms_lcl.h"
63 63
64IMPLEMENT_ASN1_FUNCTIONS(CMS_ContentInfo) 64
65IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo) 65CMS_ContentInfo *
66d2i_CMS_ContentInfo(CMS_ContentInfo **a, const unsigned char **in, long len)
67{
68 return (CMS_ContentInfo *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
69 &CMS_ContentInfo_it);
70}
71
72int
73i2d_CMS_ContentInfo(CMS_ContentInfo *a, unsigned char **out)
74{
75 return ASN1_item_i2d((ASN1_VALUE *)a, out, &CMS_ContentInfo_it);
76}
77
78CMS_ContentInfo *
79CMS_ContentInfo_new(void)
80{
81 return (CMS_ContentInfo *)ASN1_item_new(&CMS_ContentInfo_it);
82}
83
84void
85CMS_ContentInfo_free(CMS_ContentInfo *a)
86{
87 ASN1_item_free((ASN1_VALUE *)a, &CMS_ContentInfo_it);
88}
89
90int
91CMS_ContentInfo_print_ctx(BIO *out, CMS_ContentInfo *x, int indent, const ASN1_PCTX *pctx)
92{
93 return ASN1_item_print(out, (ASN1_VALUE *)x, indent,
94 &CMS_ContentInfo_it, pctx);
95}
66 96
67const ASN1_OBJECT * 97const ASN1_OBJECT *
68CMS_get0_type(const CMS_ContentInfo *cms) 98CMS_get0_type(const CMS_ContentInfo *cms)