Change #include filenames from <foo.h> to <openssl.h>.
[openssl.git] / crypto / asn1 / t_req.c
index 7df749a48fdf5e3e6d970940ebcff61de306f261..6e04b0861cdfc671af3379b65fe9822545edc379 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "buffer.h"
-#include "bn.h"
-#include "objects.h"
-#include "x509.h"
+#include <openssl/buffer.h>
+#include <openssl/bn.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
 
 #ifndef NO_FP_API
-int X509_REQ_print_fp(fp,x)
-FILE *fp;
-X509_REQ *x;
+int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
         {
         BIO *b;
         int ret;
@@ -83,13 +81,12 @@ X509_REQ *x;
         }
 #endif
 
-int X509_REQ_print(bp,x)
-BIO *bp;
-X509_REQ *x;
+int X509_REQ_print(BIO *bp, X509_REQ *x)
        {
        unsigned long l;
        int i,n;
-       char *s,*neg;
+       char *s;
+       const char *neg;
        X509_REQ_INFO *ri;
        EVP_PKEY *pkey;
        STACK *sk;
@@ -138,6 +135,8 @@ X509_REQ *x;
 #endif
                BIO_printf(bp,"%12sUnknown Public Key:\n","");
 
+       EVP_PKEY_free(pkey);
+
        /* may not be */
        sprintf(str,"%8sAttributes:\n","");
        if (BIO_puts(bp,str) <= 0) goto err;
@@ -165,7 +164,7 @@ X509_REQ *x;
                        sprintf(str,"%12s","");
                        if (BIO_puts(bp,str) <= 0) goto err;
                        if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0)
-
+                       {
                        if (a->set)
                                {
                                ii=0;
@@ -181,6 +180,7 @@ get_next:
                                type=t->type;
                                bs=t->value.bit_string;
                                }
+                       }
                        for (j=25-j; j>0; j--)
                                if (BIO_write(bp," ",1) != 1) goto err;
                        if (BIO_puts(bp,":") <= 0) goto err;