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)
76 if (ASN1_item_ex_new(&ret, it) > 0)
83 int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
85 return asn1_item_ex_combine_new(pval, it, 0);
88 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
94 const ASN1_AUX *aux = it->funcs;
106 if (it->sname)
107 CRYPTO_push_info(it->sname);
110 switch(it->itype)
114 ef = it->funcs;
117 if (!ef->asn1_ex_new(pval, it))
123 cf = it->funcs;
132 if (it->templates)
134 if (!ASN1_template_new(pval, it->templates))
137 else if (!ASN1_primitive_new(pval, it))
142 if (!ASN1_primitive_new(pval, it))
149 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
155 if (it->sname)
163 *pval = OPENSSL_malloc(it->size);
166 memset(*pval, 0, it->size);
168 asn1_set_choice_selector(pval, -1, it);
169 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
177 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
183 if (it->sname)
191 *pval = OPENSSL_malloc(it->size);
194 memset(*pval, 0, it->size);
195 asn1_do_lock(pval, 0, it);
196 asn1_enc_init(pval, it);
198 for (i = 0, tt = it->templates; i < it->tcount; tt++, i++)
204 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
209 if (it->sname) CRYPTO_pop_info();
216 if (it->sname) CRYPTO_pop_info();
222 ASN1_item_ex_free(pval, it);
224 if (it->sname) CRYPTO_pop_info();
230 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
234 switch(it->itype)
238 ef = it->funcs;
240 ef->asn1_ex_clear(pval, it);
246 if (it->templates)
247 asn1_template_clear(pval, it->templates);
249 asn1_primitive_clear(pval, it);
253 asn1_primitive_clear(pval, it);
268 const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
301 /* Otherwise pass it back to the item routine */
302 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE);
305 if (it->sname)
325 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
331 if (it && it->funcs)
333 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
335 return pf->prim_new(pval, it);
338 if (!it || (it->itype == ASN1_ITYPE_MSTRING))
341 utype = it->utype;
349 *(ASN1_BOOLEAN *)pval = it->size;
367 if (it->itype == ASN1_ITYPE_MSTRING && str)
377 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
380 if (it && it->funcs)
382 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
384 pf->prim_clear(pval, it);
389 if (!it || (it->itype == ASN1_ITYPE_MSTRING))
392 utype = it->utype;
394 *(ASN1_BOOLEAN *)pval = it->size;