Add getters for X509_STORE and X509_OBJECT members
[openssl.git] / crypto / asn1 / asn_mime.c
index 12f6fd67af8f24f6764219d8251cbbbbe8490c94..7c10b5850f2d51ef767a68d1d73288c2e5246e15 100644 (file)
@@ -1,4 +1,3 @@
-/* asn_mime.c */
 /*
  * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project.
@@ -60,6 +59,8 @@
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
+#include "internal/evp_int.h"
+#include "internal/bio.h"
 #include "asn1_locl.h"
 
 /*
  * from parameter values. Quotes are stripped off
  */
 
-typedef struct {
+struct mime_param_st {
     char *param_name;           /* Param name e.g. "micalg" */
     char *param_value;          /* Param value e.g. "sha1" */
-} MIME_PARAM;
+};
 
-DECLARE_STACK_OF(MIME_PARAM)
-
-typedef struct {
+struct mime_header_st {
     char *name;                 /* Name of line e.g. "content-type" */
     char *value;                /* Value of line e.g. "text/plain" */
     STACK_OF(MIME_PARAM) *params; /* Zero or more parameters */
-} MIME_HEADER;
-
-DECLARE_STACK_OF(MIME_HEADER)
+};
 
 static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
                             const ASN1_ITEM *it);
@@ -190,7 +187,7 @@ static ASN1_VALUE *b64_read_asn1(BIO *bio, const ASN1_ITEM *it)
     if (!val)
         ASN1err(ASN1_F_B64_READ_ASN1, ASN1_R_DECODE_ERROR);
     (void)BIO_flush(bio);
-    bio = BIO_pop(bio);
+    BIO_pop(bio);
     BIO_free(b64);
     return val;
 }
@@ -368,7 +365,7 @@ static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
     int rv = 1;
 
     /*
-     * If data is not deteched or resigning then the output BIO is already
+     * If data is not detached or resigning then the output BIO is already
      * set up to finalise when it is written through.
      */
     if (!(flags & SMIME_DETACHED) || (flags & PKCS7_REUSE_DIGEST)) {
@@ -828,7 +825,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
     int c;
 
     if (name) {
-        if ((tmpname = BUF_strdup(name)) == NULL)
+        if ((tmpname = OPENSSL_strdup(name)) == NULL)
             return NULL;
         for (p = tmpname; *p; p++) {
             c = (unsigned char)*p;
@@ -839,7 +836,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
         }
     }
     if (value) {
-        if ((tmpval = BUF_strdup(value)) == NULL)
+        if ((tmpval = OPENSSL_strdup(value)) == NULL)
             goto err;
         for (p = tmpval; *p; p++) {
             c = (unsigned char)*p;
@@ -871,7 +868,7 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
     int c;
     MIME_PARAM *mparam = NULL;
     if (name) {
-        tmpname = BUF_strdup(name);
+        tmpname = OPENSSL_strdup(name);
         if (!tmpname)
             goto err;
         for (p = tmpname; *p; p++) {
@@ -883,7 +880,7 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
         }
     }
     if (value) {
-        tmpval = BUF_strdup(value);
+        tmpval = OPENSSL_strdup(value);
         if (!tmpval)
             goto err;
     }