Lines Matching refs:attr
123 X509_ATTRIBUTE *attr)
139 if ((new_attr = X509_ATTRIBUTE_dup(attr)) == NULL)
162 X509_ATTRIBUTE *attr;
164 attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len);
165 if (!attr)
167 ret = X509at_add1_attr(x, attr);
168 X509_ATTRIBUTE_free(attr);
177 X509_ATTRIBUTE *attr;
179 attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len);
180 if (!attr)
182 ret = X509at_add1_attr(x, attr);
183 X509_ATTRIBUTE_free(attr);
193 X509_ATTRIBUTE *attr;
195 attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len);
196 if (!attr)
198 ret = X509at_add1_attr(x, attr);
199 X509_ATTRIBUTE_free(attr);
219 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
231 ret = X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len);
237 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
244 if ((attr == NULL) || (*attr == NULL)) {
251 ret = *attr;
258 if ((attr != NULL) && (*attr == NULL))
259 *attr = ret;
262 if ((attr == NULL) || (ret != *attr))
267 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
282 nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len);
287 int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
289 if ((attr == NULL) || (obj == NULL))
291 ASN1_OBJECT_free(attr->object);
292 attr->object = OBJ_dup(obj);
296 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
302 if (!attr)
306 OBJ_obj2nid(attr->object));
319 if (!(attr->value.set = sk_ASN1_TYPE_new_null()))
321 attr->single = 0;
336 if (!sk_ASN1_TYPE_push(attr->value.set, ttmp))
344 int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
346 if (!attr->single)
347 return sk_ASN1_TYPE_num(attr->value.set);
348 if (attr->value.single)
353 ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)
355 if (attr == NULL)
357 return (attr->object);
360 void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
364 ttmp = X509_ATTRIBUTE_get0_type(attr, idx);
374 ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)
376 if (attr == NULL)
378 if (idx >= X509_ATTRIBUTE_count(attr))
380 if (!attr->single)
381 return sk_ASN1_TYPE_value(attr->value.set, idx);
383 return attr->value.single;