Lines Matching refs:it
18 static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
21 static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
23 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
27 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
29 ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it) in ASN1_item_new() argument
32 if (ASN1_item_ex_new(&ret, it) > 0) in ASN1_item_new()
37 ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx, in ASN1_item_new_ex() argument
41 if (asn1_item_embed_new(&ret, it, 0, libctx, propq) > 0) in ASN1_item_new_ex()
49 int ossl_asn1_item_ex_new_intern(ASN1_VALUE **pval, const ASN1_ITEM *it, in ossl_asn1_item_ex_new_intern() argument
52 return asn1_item_embed_new(pval, it, 0, libctx, propq); in ossl_asn1_item_ex_new_intern()
55 int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) in ASN1_item_ex_new() argument
57 return asn1_item_embed_new(pval, it, 0, NULL, NULL); in ASN1_item_ex_new()
60 int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed, in asn1_item_embed_new() argument
65 const ASN1_AUX *aux = it->funcs; in asn1_item_embed_new()
74 switch (it->itype) { in asn1_item_embed_new()
77 ef = it->funcs; in asn1_item_embed_new()
80 if (!ef->asn1_ex_new_ex(pval, it, libctx, propq)) in asn1_item_embed_new()
83 if (!ef->asn1_ex_new(pval, it)) in asn1_item_embed_new()
90 if (it->templates) { in asn1_item_embed_new()
91 if (!asn1_template_new(pval, it->templates, libctx, propq)) in asn1_item_embed_new()
93 } else if (!asn1_primitive_new(pval, it, embed)) in asn1_item_embed_new()
98 if (!asn1_primitive_new(pval, it, embed)) in asn1_item_embed_new()
104 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); in asn1_item_embed_new()
112 memset(*pval, 0, it->size); in asn1_item_embed_new()
114 *pval = OPENSSL_zalloc(it->size); in asn1_item_embed_new()
118 ossl_asn1_set_choice_selector(pval, -1, it); in asn1_item_embed_new()
119 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) in asn1_item_embed_new()
126 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); in asn1_item_embed_new()
134 memset(*pval, 0, it->size); in asn1_item_embed_new()
136 *pval = OPENSSL_zalloc(it->size); in asn1_item_embed_new()
141 if (ossl_asn1_do_lock(pval, 0, it) < 0) { in asn1_item_embed_new()
148 ossl_asn1_enc_init(pval, it); in asn1_item_embed_new()
149 for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { in asn1_item_embed_new()
154 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) in asn1_item_embed_new()
161 ossl_asn1_item_embed_free(pval, it, embed); in asn1_item_embed_new()
167 ossl_asn1_item_embed_free(pval, it, embed); in asn1_item_embed_new()
174 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_item_clear() argument
178 switch (it->itype) { in asn1_item_clear()
181 ef = it->funcs; in asn1_item_clear()
183 ef->asn1_ex_clear(pval, it); in asn1_item_clear()
189 if (it->templates) in asn1_item_clear()
190 asn1_template_clear(pval, it->templates); in asn1_item_clear()
192 asn1_primitive_clear(pval, it); in asn1_item_clear()
196 asn1_primitive_clear(pval, it); in asn1_item_clear()
210 const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); in asn1_template_new() local
242 ret = asn1_item_embed_new(pval, it, embed, libctx, propq); in asn1_template_new()
261 static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it, in asn1_primitive_new() argument
268 if (!it) in asn1_primitive_new()
271 if (it->funcs) { in asn1_primitive_new()
272 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; in asn1_primitive_new()
275 pf->prim_clear(pval, it); in asn1_primitive_new()
279 return pf->prim_new(pval, it); in asn1_primitive_new()
283 if (it->itype == ASN1_ITYPE_MSTRING) in asn1_primitive_new()
286 utype = it->utype; in asn1_primitive_new()
293 *(ASN1_BOOLEAN *)pval = it->size; in asn1_primitive_new()
318 if (it->itype == ASN1_ITYPE_MSTRING && str) in asn1_primitive_new()
327 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_primitive_clear() argument
330 if (it && it->funcs) { in asn1_primitive_clear()
331 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; in asn1_primitive_clear()
333 pf->prim_clear(pval, it); in asn1_primitive_clear()
338 if (!it || (it->itype == ASN1_ITYPE_MSTRING)) in asn1_primitive_clear()
341 utype = it->utype; in asn1_primitive_clear()
343 *(ASN1_BOOLEAN *)pval = it->size; in asn1_primitive_clear()