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) 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
115 if (!ef->asn1_ex_new(pval, it)) in asn1_item_ex_combine_new()
123 *pval = cf->asn1_new(); in asn1_item_ex_combine_new()
124 if (!*pval) 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()
161 *pval = OPENSSL_malloc(it->size); in asn1_item_ex_combine_new()
162 if (!*pval) 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()
189 *pval = OPENSSL_malloc(it->size); in asn1_item_ex_combine_new()
190 if (!*pval) 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()
198 pseqval = asn1_get_field_ptr(pval, tt); 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()
213 ASN1_item_ex_free(pval, it); in asn1_item_ex_combine_new()
221 ASN1_item_ex_free(pval, it); in asn1_item_ex_combine_new()
229 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_item_clear() argument
239 ef->asn1_ex_clear(pval, it); in asn1_item_clear()
240 else *pval = NULL; 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()
259 *pval = NULL; in asn1_item_clear()
265 int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) in ASN1_template_new() argument
271 asn1_template_clear(pval, tt); in ASN1_template_new()
278 *pval = NULL; in ASN1_template_new()
296 *pval = (ASN1_VALUE *)skval; in ASN1_template_new()
301 ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE); in ASN1_template_new()
310 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) in asn1_template_clear() argument
314 *pval = NULL; in asn1_template_clear()
316 asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item)); in asn1_template_clear()
324 int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) in ASN1_primitive_new() argument
337 return pf->prim_new(pval, it); in ASN1_primitive_new()
347 *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef); in ASN1_primitive_new()
351 *(ASN1_BOOLEAN *)pval = it->size; in ASN1_primitive_new()
355 *pval = (ASN1_VALUE *)1; in ASN1_primitive_new()
364 *pval = (ASN1_VALUE *)typ; in ASN1_primitive_new()
371 *pval = (ASN1_VALUE *)str; in ASN1_primitive_new()
374 if (*pval) in ASN1_primitive_new()
379 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) in asn1_primitive_clear() argument
386 pf->prim_clear(pval, it); in asn1_primitive_clear()
388 *pval = NULL; in asn1_primitive_clear()
396 *(ASN1_BOOLEAN *)pval = it->size; in asn1_primitive_clear()
397 else *pval = NULL; in asn1_primitive_clear()