Support assembler for Mingw32.
[oweals/openssl.git] / crypto / x509 / x509_req.c
index b20305c6eeef6a8295b003e105e8c1f867d17221..baef8790eb94de82d194b53095c1f0b8f580a0a3 100644 (file)
@@ -132,7 +132,7 @@ int X509_REQ_extension_nid(int req_nid)
        }
 }
 
-int *X509_REQ_get_extesion_nids(void)
+int *X509_REQ_get_extension_nids(void)
 {
        return ext_nids;
 }
@@ -214,3 +214,65 @@ int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts)
 {
        return X509_REQ_add_extensions_nid(req, exts, NID_ext_req);
 }
+
+/* Request attribute functions */
+
+int X509_REQ_get_attr_count(const X509_REQ *req)
+{
+       return X509at_get_attr_count(req->req_info->attributes);
+}
+
+int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid,
+                         int lastpos)
+{
+       return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos);
+}
+
+int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
+                         int lastpos)
+{
+       return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos);
+}
+
+X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc)
+{
+       return X509at_get_attr(req->req_info->attributes, loc);
+}
+
+X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc)
+{
+       return X509at_delete_attr(req->req_info->attributes, loc);
+}
+
+int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr)
+{
+       if(X509at_add1_attr(&req->req_info->attributes, attr)) return 1;
+       return 0;
+}
+
+int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
+                       ASN1_OBJECT *obj, int type,
+                       unsigned char *bytes, int len)
+{
+       if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj,
+                               type, bytes, len)) return 1;
+       return 0;
+}
+
+int X509_REQ_add1_attr_by_NID(X509_REQ *req,
+                       int nid, int type,
+                       unsigned char *bytes, int len)
+{
+       if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid,
+                               type, bytes, len)) return 1;
+       return 0;
+}
+
+int X509_REQ_add1_attr_by_txt(X509_REQ *req,
+                       char *attrname, int type,
+                       unsigned char *bytes, int len)
+{
+       if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname,
+                               type, bytes, len)) return 1;
+       return 0;
+}