Lines Matching defs:it

10  * apply to all code found in this distribution, be it the RC4, RSA,
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;
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_refcount_set_one(pval, 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();
213 ASN1_item_ex_free(pval, it);
215 if (it->sname) CRYPTO_pop_info();
221 ASN1_item_ex_free(pval, it);
223 if (it->sname) CRYPTO_pop_info();
229 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
233 switch(it->itype)
237 ef = it->funcs;
239 ef->asn1_ex_clear(pval, it);
245 if (it->templates)
246 asn1_template_clear(pval, it->templates);
248 asn1_primitive_clear(pval, it);
252 asn1_primitive_clear(pval, it);
267 const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
300 /* Otherwise pass it back to the item routine */
301 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE);
304 if (it->sname)
324 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
330 if (!it)
333 if (it->funcs)
335 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
337 return pf->prim_new(pval, it);
340 if (it->itype == ASN1_ITYPE_MSTRING)
343 utype = it->utype;
351 *(ASN1_BOOLEAN *)pval = it->size;
369 if (it->itype == ASN1_ITYPE_MSTRING && str)
379 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
382 if (it && it->funcs)
384 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
386 pf->prim_clear(pval, it);
391 if (!it || (it->itype == ASN1_ITYPE_MSTRING))
394 utype = it->utype;
396 *(ASN1_BOOLEAN *)pval = it->size;