Lines Matching refs:attr
120 X509_ATTRIBUTE *attr) in STACK_OF()
139 if ((new_attr=X509_ATTRIBUTE_dup(attr)) == NULL) in STACK_OF()
158 X509_ATTRIBUTE *attr; in STACK_OF() local
160 attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len); in STACK_OF()
161 if(!attr) return 0; in STACK_OF()
162 ret = X509at_add1_attr(x, attr); in STACK_OF()
163 X509_ATTRIBUTE_free(attr); in STACK_OF()
171 X509_ATTRIBUTE *attr; in STACK_OF() local
173 attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len); in STACK_OF()
174 if(!attr) return 0; in STACK_OF()
175 ret = X509at_add1_attr(x, attr); in STACK_OF()
176 X509_ATTRIBUTE_free(attr); in STACK_OF()
184 X509_ATTRIBUTE *attr; in STACK_OF() local
186 attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len); in STACK_OF()
187 if(!attr) return 0; in STACK_OF()
188 ret = X509at_add1_attr(x, attr); in STACK_OF()
189 X509_ATTRIBUTE_free(attr); in STACK_OF()
209 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, in X509_ATTRIBUTE_create_by_NID() argument
220 return X509_ATTRIBUTE_create_by_OBJ(attr,obj,atrtype,data,len); in X509_ATTRIBUTE_create_by_NID()
223 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, in X509_ATTRIBUTE_create_by_OBJ() argument
228 if ((attr == NULL) || (*attr == NULL)) in X509_ATTRIBUTE_create_by_OBJ()
237 ret= *attr; in X509_ATTRIBUTE_create_by_OBJ()
244 if ((attr != NULL) && (*attr == NULL)) *attr=ret; in X509_ATTRIBUTE_create_by_OBJ()
247 if ((attr == NULL) || (ret != *attr)) in X509_ATTRIBUTE_create_by_OBJ()
252 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, in X509_ATTRIBUTE_create_by_txt() argument
265 nattr = X509_ATTRIBUTE_create_by_OBJ(attr,obj,type,bytes,len); in X509_ATTRIBUTE_create_by_txt()
270 int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) in X509_ATTRIBUTE_set1_object() argument
272 if ((attr == NULL) || (obj == NULL)) in X509_ATTRIBUTE_set1_object()
274 ASN1_OBJECT_free(attr->object); in X509_ATTRIBUTE_set1_object()
275 attr->object=OBJ_dup(obj); in X509_ATTRIBUTE_set1_object()
276 return attr->object != NULL; in X509_ATTRIBUTE_set1_object()
279 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len) in X509_ATTRIBUTE_set1_data() argument
284 if (!attr) return 0; in X509_ATTRIBUTE_set1_data()
287 OBJ_obj2nid(attr->object)); in X509_ATTRIBUTE_set1_data()
298 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; in X509_ATTRIBUTE_set1_data()
299 attr->single = 0; in X509_ATTRIBUTE_set1_data()
314 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err; in X509_ATTRIBUTE_set1_data()
321 int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) in X509_ATTRIBUTE_count() argument
323 if(!attr->single) return sk_ASN1_TYPE_num(attr->value.set); in X509_ATTRIBUTE_count()
324 if(attr->value.single) return 1; in X509_ATTRIBUTE_count()
328 ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) in X509_ATTRIBUTE_get0_object() argument
330 if (attr == NULL) return(NULL); in X509_ATTRIBUTE_get0_object()
331 return(attr->object); in X509_ATTRIBUTE_get0_object()
334 void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, in X509_ATTRIBUTE_get0_data() argument
338 ttmp = X509_ATTRIBUTE_get0_type(attr, idx); in X509_ATTRIBUTE_get0_data()
347 ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) in X509_ATTRIBUTE_get0_type() argument
349 if (attr == NULL) return(NULL); in X509_ATTRIBUTE_get0_type()
350 if(idx >= X509_ATTRIBUTE_count(attr)) return NULL; in X509_ATTRIBUTE_get0_type()
351 if(!attr->single) return sk_ASN1_TYPE_value(attr->value.set, idx); in X509_ATTRIBUTE_get0_type()
352 else return attr->value.single; in X509_ATTRIBUTE_get0_type()