Lines Matching refs:pval
18 static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
21 static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
23 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
24 static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
26 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
27 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
49 int ossl_asn1_item_ex_new_intern(ASN1_VALUE **pval, const ASN1_ITEM *it,
52 return asn1_item_embed_new(pval, it, 0, libctx, propq);
55 int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
57 return asn1_item_embed_new(pval, it, 0, NULL, NULL);
60 int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed,
80 if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
83 if (!ef->asn1_ex_new(pval, it))
91 if (!asn1_template_new(pval, it->templates, libctx, propq))
93 } else if (!asn1_primitive_new(pval, it, embed))
98 if (!asn1_primitive_new(pval, it, embed))
104 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
112 memset(*pval, 0, it->size);
114 *pval = OPENSSL_zalloc(it->size);
115 if (*pval == NULL)
118 ossl_asn1_set_choice_selector(pval, -1, it);
119 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
126 i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
134 memset(*pval, 0, it->size);
136 *pval = OPENSSL_zalloc(it->size);
137 if (*pval == NULL)
141 if (ossl_asn1_do_lock(pval, 0, it) < 0) {
143 OPENSSL_free(*pval);
144 *pval = NULL;
148 ossl_asn1_enc_init(pval, it);
150 pseqval = ossl_asn1_get_field_ptr(pval, tt);
154 if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
161 ossl_asn1_item_embed_free(pval, it, embed);
167 ossl_asn1_item_embed_free(pval, it, embed);
174 static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
183 ef->asn1_ex_clear(pval, it);
185 *pval = NULL;
190 asn1_template_clear(pval, it->templates);
192 asn1_primitive_clear(pval, it);
196 asn1_primitive_clear(pval, it);
202 *pval = NULL;
207 static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
215 tval = (ASN1_VALUE *)pval;
216 pval = &tval;
219 asn1_template_clear(pval, tt);
225 *pval = NULL;
237 *pval = (ASN1_VALUE *)skval;
242 ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
247 static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
251 *pval = NULL;
253 asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
261 static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
275 pf->prim_clear(pval, it);
279 return pf->prim_new(pval, it);
289 *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
293 *(ASN1_BOOLEAN *)pval = it->size;
297 *pval = (ASN1_VALUE *)1;
307 *pval = (ASN1_VALUE *)typ;
312 str = *(ASN1_STRING **)pval;
318 *pval = (ASN1_VALUE *)str;
324 if (*pval)
329 static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
335 pf->prim_clear(pval, it);
337 *pval = NULL;
345 *(ASN1_BOOLEAN *)pval = it->size;
347 *pval = NULL;