Lines Matching refs:pval
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);
70 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
71 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
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,
103 if (!combine) *pval = NULL;
117 if (!ef->asn1_ex_new(pval, it))
125 *pval = cf->asn1_new();
126 if (!*pval)
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);
163 *pval = OPENSSL_malloc(it->size);
164 if (!*pval)
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);
191 *pval = OPENSSL_malloc(it->size);
192 if (!*pval)
194 memset(*pval, 0, it->size);
195 asn1_do_lock(pval, 0, it);
196 asn1_enc_init(pval, it);
200 pseqval = asn1_get_field_ptr(pval, tt);
204 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
222 ASN1_item_ex_free(pval, it);
230 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
240 ef->asn1_ex_clear(pval, it);
241 else *pval = NULL;
247 asn1_template_clear(pval, it->templates);
249 asn1_primitive_clear(pval, it);
253 asn1_primitive_clear(pval, it);
260 *pval = NULL;
266 int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
272 asn1_template_clear(pval, tt);
279 *pval = NULL;
297 *pval = (ASN1_VALUE *)skval;
302 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE);
311 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
315 *pval = NULL;
317 asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
325 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
335 return pf->prim_new(pval, it);
345 *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
349 *(ASN1_BOOLEAN *)pval = it->size;
353 *pval = (ASN1_VALUE *)1;
362 *pval = (ASN1_VALUE *)typ;
369 *pval = (ASN1_VALUE *)str;
372 if (*pval)
377 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
384 pf->prim_clear(pval, it);
386 *pval = NULL;
394 *(ASN1_BOOLEAN *)pval = it->size;
395 else *pval = NULL;