Change #include filenames from <foo.h> to <openssl.h>.
[openssl.git] / crypto / asn1 / x_req.c
index ff0be13..f6b1a95 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "asn1_mac.h"
-#include "x509.h"
+#include <openssl/asn1_mac.h>
+#include <openssl/x509.h>
 
 /*
- * ASN1err(ASN1_F_D2I_X509_REQ,ASN1_R_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_D2I_X509_REQ_INFO,ASN1_R_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_X509_REQ_NEW,ASN1_R_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_X509_REQ_INFO_NEW,ASN1_R_LENGTH_MISMATCH);
+ * ASN1err(ASN1_F_D2I_X509_REQ,ERR_R_ASN1_LENGTH_MISMATCH);
+ * ASN1err(ASN1_F_D2I_X509_REQ_INFO,ERR_R_ASN1_LENGTH_MISMATCH);
+ * ASN1err(ASN1_F_X509_REQ_NEW,ERR_R_ASN1_LENGTH_MISMATCH);
+ * ASN1err(ASN1_F_X509_REQ_INFO_NEW,ERR_R_ASN1_LENGTH_MISMATCH);
  */
 
-int i2d_X509_REQ_INFO(a,pp)
-X509_REQ_INFO *a;
-unsigned char **pp;
+int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
        {
        M_ASN1_I2D_vars(a);
 
@@ -87,11 +85,11 @@ unsigned char **pp;
         */
        if (a->req_kludge) 
                {
-               M_ASN1_I2D_len_IMP_set_opt(a->attributes,i2d_X509_ATTRIBUTE,0);
+               M_ASN1_I2D_len_IMP_SET_opt(a->attributes,i2d_X509_ATTRIBUTE,0);
                }
        else
                {
-               M_ASN1_I2D_len_IMP_set(a->attributes,   i2d_X509_ATTRIBUTE,0);
+               M_ASN1_I2D_len_IMP_SET(a->attributes,   i2d_X509_ATTRIBUTE,0);
                }
        
        M_ASN1_I2D_seq_total();
@@ -107,20 +105,18 @@ unsigned char **pp;
         */
        if (a->req_kludge)
                {
-               M_ASN1_I2D_put_IMP_set_opt(a->attributes,i2d_X509_ATTRIBUTE,0);
+               M_ASN1_I2D_put_IMP_SET_opt(a->attributes,i2d_X509_ATTRIBUTE,0);
                }
        else
                {
-               M_ASN1_I2D_put_IMP_set(a->attributes,i2d_X509_ATTRIBUTE,0);
+               M_ASN1_I2D_put_IMP_SET(a->attributes,i2d_X509_ATTRIBUTE,0);
                }
 
        M_ASN1_I2D_finish();
        }
 
-X509_REQ_INFO *d2i_X509_REQ_INFO(a,pp,length)
-X509_REQ_INFO **a;
-unsigned char **pp;
-long length;
+X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, unsigned char **pp,
+            long length)
        {
        M_ASN1_D2I_vars(a,X509_REQ_INFO *,X509_REQ_INFO_new);
 
@@ -141,15 +137,17 @@ long length;
                ret->req_kludge=1;
        else
                {
-               M_ASN1_D2I_get_IMP_set(ret->attributes,d2i_X509_ATTRIBUTE,0);
+               M_ASN1_D2I_get_IMP_set(ret->attributes,d2i_X509_ATTRIBUTE,
+                       X509_ATTRIBUTE_free,0);
                }
 
        M_ASN1_D2I_Finish(a,X509_REQ_INFO_free,ASN1_F_D2I_X509_REQ_INFO);
        }
 
-X509_REQ_INFO *X509_REQ_INFO_new()
+X509_REQ_INFO *X509_REQ_INFO_new(void)
        {
        X509_REQ_INFO *ret=NULL;
+       ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,X509_REQ_INFO);
        M_ASN1_New(ret->version,ASN1_INTEGER_new);
@@ -161,8 +159,7 @@ X509_REQ_INFO *X509_REQ_INFO_new()
        M_ASN1_New_Error(ASN1_F_X509_REQ_INFO_NEW);
        }
        
-void X509_REQ_INFO_free(a)
-X509_REQ_INFO *a;
+void X509_REQ_INFO_free(X509_REQ_INFO *a)
        {
        if (a == NULL) return;
        ASN1_INTEGER_free(a->version);
@@ -172,9 +169,7 @@ X509_REQ_INFO *a;
        Free((char *)a);
        }
 
-int i2d_X509_REQ(a,pp)
-X509_REQ *a;
-unsigned char **pp;
+int i2d_X509_REQ(X509_REQ *a, unsigned char **pp)
        {
        M_ASN1_I2D_vars(a);
        M_ASN1_I2D_len(a->req_info,     i2d_X509_REQ_INFO);
@@ -190,10 +185,7 @@ unsigned char **pp;
        M_ASN1_I2D_finish();
        }
 
-X509_REQ *d2i_X509_REQ(a,pp,length)
-X509_REQ **a;
-unsigned char **pp;
-long length;
+X509_REQ *d2i_X509_REQ(X509_REQ **a, unsigned char **pp, long length)
        {
        M_ASN1_D2I_vars(a,X509_REQ *,X509_REQ_new);
 
@@ -205,9 +197,10 @@ long length;
        M_ASN1_D2I_Finish(a,X509_REQ_free,ASN1_F_D2I_X509_REQ);
        }
 
-X509_REQ *X509_REQ_new()
+X509_REQ *X509_REQ_new(void)
        {
        X509_REQ *ret=NULL;
+       ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,X509_REQ);
        ret->references=1;
@@ -218,8 +211,7 @@ X509_REQ *X509_REQ_new()
        M_ASN1_New_Error(ASN1_F_X509_REQ_NEW);
        }
 
-void X509_REQ_free(a)
-X509_REQ *a;
+void X509_REQ_free(X509_REQ *a)
        {
        int i;