Wrap the inclusion of openssl/engine.h with a protective check for
[oweals/openssl.git] / crypto / x509 / x509_att.c
index f074d2ab18adfb79aa6c0c1cb3345eb9be9b87c9..bd1fdec2075c4c34cd06a5229a0a3229b91cfe58 100644 (file)
@@ -141,7 +141,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
                *x=sk;
        return(sk);
 err:
-       X509err(X509_F_X509_ADD_ATTR,ERR_R_MALLOC_FAILURE);
+       X509err(X509_F_X509AT_ADD1_ATTR,ERR_R_MALLOC_FAILURE);
 err2:
        if (new_attr != NULL) X509_ATTRIBUTE_free(new_attr);
        if (sk != NULL) sk_X509_ATTRIBUTE_free(sk);
@@ -149,8 +149,8 @@ err2:
 }
 
 STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
-                       ASN1_OBJECT *obj, int type,
-                       unsigned char *bytes, int len)
+                       const ASN1_OBJECT *obj, int type,
+                       const unsigned char *bytes, int len)
 {
        X509_ATTRIBUTE *attr;
        STACK_OF(X509_ATTRIBUTE) *ret;
@@ -163,7 +163,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
 
 STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
                        int nid, int type,
-                       unsigned char *bytes, int len)
+                       const unsigned char *bytes, int len)
 {
        X509_ATTRIBUTE *attr;
        STACK_OF(X509_ATTRIBUTE) *ret;
@@ -175,8 +175,8 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
 }
 
 STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
-                       char *attrname, int type,
-                       unsigned char *bytes, int len)
+                       const char *attrname, int type,
+                       const unsigned char *bytes, int len)
 {
        X509_ATTRIBUTE *attr;
        STACK_OF(X509_ATTRIBUTE) *ret;
@@ -188,7 +188,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
 }
 
 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
-            int atrtype, void *data, int len)
+            int atrtype, const void *data, int len)
 {
        ASN1_OBJECT *obj;
        X509_ATTRIBUTE *ret;
@@ -205,7 +205,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
 }
 
 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
-            ASN1_OBJECT *obj, int atrtype, void *data, int len)
+            const ASN1_OBJECT *obj, int atrtype, const void *data, int len)
 {
        X509_ATTRIBUTE *ret;
 
@@ -234,7 +234,7 @@ err:
 }
 
 X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
-               char *atrname, int type, unsigned char *bytes, int len)
+               const char *atrname, int type, const unsigned char *bytes, int len)
        {
        ASN1_OBJECT *obj;
        X509_ATTRIBUTE *nattr;
@@ -252,7 +252,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
        return nattr;
        }
 
-int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj)
+int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
 {
        if ((attr == NULL) || (obj == NULL))
                return(0);
@@ -261,7 +261,7 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj)
        return(1);
 }
 
-int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len)
+int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len)
 {
        ASN1_TYPE *ttmp;
        ASN1_STRING *stmp;