Lines Matching refs:it

67 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
69 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
71 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
73 ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it) in ASN1_item_new() argument
76 if (ASN1_item_ex_new(&ret, it) > 0) in ASN1_item_new()
83 int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) in ASN1_item_ex_new() argument
85 return asn1_item_ex_combine_new(pval, it, 0); in ASN1_item_ex_new()
88 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, in asn1_item_ex_combine_new() argument
94 const ASN1_AUX *aux = it->funcs; in asn1_item_ex_combine_new()
104 if (it->sname) in asn1_item_ex_combine_new()
105 CRYPTO_push_info(it->sname); in asn1_item_ex_combine_new()
108 switch(it->itype) in asn1_item_ex_combine_new()
112 ef = it->funcs; in asn1_item_ex_combine_new()
115 if (!ef->asn1_ex_new(pval, it)) in asn1_item_ex_combine_new()
121 cf = it->funcs; in asn1_item_ex_combine_new()
130 if (it->templates) in asn1_item_ex_combine_new()
132 if (!ASN1_template_new(pval, it->templates)) in asn1_item_ex_combine_new()
135 else if (!ASN1_primitive_new(pval, it)) in asn1_item_ex_combine_new()
140 if (!ASN1_primitive_new(pval, it)) in asn1_item_ex_combine_new()
147 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); in asn1_item_ex_combine_new()
153 if (it->sname) in asn1_item_ex_combine_new()
161 *pval = OPENSSL_malloc(it->size); in asn1_item_ex_combine_new()
164 memset(*pval, 0, it->size); in asn1_item_ex_combine_new()
166 asn1_set_choice_selector(pval, -1, it); in asn1_item_ex_combine_new()
167 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) in asn1_item_ex_combine_new()
175 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL); in asn1_item_ex_combine_new()
181 if (it->sname) in asn1_item_ex_combine_new()
189 *pval = OPENSSL_malloc(it->size); in asn1_item_ex_combine_new()
192 memset(*pval, 0, it->size); in asn1_item_ex_combine_new()
193 asn1_refcount_set_one(pval, it); in asn1_item_ex_combine_new()
194 asn1_enc_init(pval, it); in asn1_item_ex_combine_new()
196 for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) in asn1_item_ex_combine_new()
202 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) in asn1_item_ex_combine_new()
207 if (it->sname) CRYPTO_pop_info(); in asn1_item_ex_combine_new()
213 ASN1_item_ex_free(pval, it); in asn1_item_ex_combine_new()
215 if (it->sname) CRYPTO_pop_info(); in asn1_item_ex_combine_new()
221 ASN1_item_ex_free(pval, it); in asn1_item_ex_combine_new()
223 if (it->sname) CRYPTO_pop_info(); in asn1_item_ex_combine_new()
229 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_item_clear() argument
233 switch(it->itype) in asn1_item_clear()
237 ef = it->funcs; in asn1_item_clear()
239 ef->asn1_ex_clear(pval, it); in asn1_item_clear()
245 if (it->templates) in asn1_item_clear()
246 asn1_template_clear(pval, it->templates); in asn1_item_clear()
248 asn1_primitive_clear(pval, it); in asn1_item_clear()
252 asn1_primitive_clear(pval, it); in asn1_item_clear()
267 const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); in ASN1_template_new() local
301 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE); in ASN1_template_new()
304 if (it->sname) in ASN1_template_new()
324 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) in ASN1_primitive_new() argument
330 if (!it) in ASN1_primitive_new()
333 if (it->funcs) in ASN1_primitive_new()
335 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; in ASN1_primitive_new()
337 return pf->prim_new(pval, it); in ASN1_primitive_new()
340 if (it->itype == ASN1_ITYPE_MSTRING) in ASN1_primitive_new()
343 utype = it->utype; in ASN1_primitive_new()
351 *(ASN1_BOOLEAN *)pval = it->size; in ASN1_primitive_new()
369 if (it->itype == ASN1_ITYPE_MSTRING && str) in ASN1_primitive_new()
379 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_primitive_clear() argument
382 if (it && it->funcs) in asn1_primitive_clear()
384 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; in asn1_primitive_clear()
386 pf->prim_clear(pval, it); in asn1_primitive_clear()
391 if (!it || (it->itype == ASN1_ITYPE_MSTRING)) in asn1_primitive_clear()
394 utype = it->utype; in asn1_primitive_clear()
396 *(ASN1_BOOLEAN *)pval = it->size; in asn1_primitive_clear()