Home | History | Annotate | Download | only in x509

Lines Matching full:attr

122 					 X509_ATTRIBUTE *attr)
141 if ((new_attr=X509_ATTRIBUTE_dup(attr)) == NULL)
160 X509_ATTRIBUTE *attr;
162 attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len);
163 if(!attr) return 0;
164 ret = X509at_add1_attr(x, attr);
165 X509_ATTRIBUTE_free(attr);
173 X509_ATTRIBUTE *attr;
175 attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len);
176 if(!attr) return 0;
177 ret = X509at_add1_attr(x, attr);
178 X509_ATTRIBUTE_free(attr);
186 X509_ATTRIBUTE *attr;
188 attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len);
189 if(!attr) return 0;
190 ret = X509at_add1_attr(x, attr);
191 X509_ATTRIBUTE_free(attr);
211 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
223 ret=X509_ATTRIBUTE_create_by_OBJ(attr,obj,atrtype,data,len);
228 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
233 if ((attr == NULL) || (*attr == NULL))
242 ret= *attr;
249 if ((attr != NULL) && (*attr == NULL)) *attr=ret;
252 if ((attr == NULL) || (ret != *attr))
257 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
271 nattr = X509_ATTRIBUTE_create_by_OBJ(attr,obj,type,bytes,len);
276 int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
278 if ((attr == NULL) || (obj == NULL))
280 ASN1_OBJECT_free(attr->object);
281 attr->object=OBJ_dup(obj);
285 int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len)
290 if (!attr) return 0;
293 OBJ_obj2nid(attr->object));
304 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err;
305 attr->single = 0;
320 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err;
327 int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
329 if(!attr->single) return sk_ASN1_TYPE_num(attr->value.set);
330 if(attr->value.single) return 1;
334 ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)
336 if (attr == NULL) return(NULL);
337 return(attr->object);
340 void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
344 ttmp = X509_ATTRIBUTE_get0_type(attr, idx);
353 ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)
355 if (attr == NULL) return(NULL);
356 if(idx >= X509_ATTRIBUTE_count(attr)) return NULL;
357 if(!attr->single) return sk_ASN1_TYPE_value(attr->value.set, idx);
358 else return attr->value.single;