Lines Matching refs:it

10  * apply to all code found in this distribution, be it the RC4, RSA,
65 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
67 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
69 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
71 ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
74 if (ASN1_item_ex_new(&ret, it) > 0)
81 int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
83 return asn1_item_ex_combine_new(pval, it, 0);
86 static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
92 const ASN1_AUX *aux = it->funcs;
104 if (it->sname)
105 CRYPTO_push_info(it->sname);
108 switch(it->itype)
112 ef = it->funcs;
115 if (!ef->asn1_ex_new(pval, it))
121 cf = it->funcs;
130 if (it->templates)
132 if (!ASN1_template_new(pval, it->templates))
135 else if (!ASN1_primitive_new(pval, it))
140 if (!ASN1_primitive_new(pval, it))
147 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
153 if (it->sname)
161 *pval = OPENSSL_malloc(it->size);
164 memset(*pval, 0, it->size);
166 asn1_set_choice_selector(pval, -1, it);
167 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
175 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
181 if (it->sname)
189 *pval = OPENSSL_malloc(it->size);
192 memset(*pval, 0, it->size);
193 asn1_do_lock(pval, 0, it);
194 asn1_enc_init(pval, it);
196 for (i = 0, tt = it->templates; i < it->tcount; tt++, i++)
202 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
207 if (it->sname) CRYPTO_pop_info();
214 if (it->sname) CRYPTO_pop_info();
220 ASN1_item_ex_free(pval, it);
222 if (it->sname) CRYPTO_pop_info();
228 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
232 switch(it->itype)
236 ef = it->funcs;
238 ef->asn1_ex_clear(pval, it);
244 if (it->templates)
245 asn1_template_clear(pval, it->templates);
247 asn1_primitive_clear(pval, it);
251 asn1_primitive_clear(pval, it);
266 const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
299 /* Otherwise pass it back to the item routine */
300 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE);
303 if (it->sname)
323 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
329 if (it && it->funcs)
331 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
333 return pf->prim_new(pval, it);
336 if (!it || (it->itype == ASN1_ITYPE_MSTRING))
339 utype = it->utype;
347 *(ASN1_BOOLEAN *)pval = it->size;
365 if (it->itype == ASN1_ITYPE_MSTRING && str)
375 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
378 if (it && it->funcs)
380 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
382 pf->prim_clear(pval, it);
387 if (!it || (it->itype == ASN1_ITYPE_MSTRING))
390 utype = it->utype;
392 *(ASN1_BOOLEAN *)pval = it->size;