disable stdin buffering in load_cert
[openssl.git] / crypto / pkcs7 / pk7_mime.c
index 7c6649cc1475b72a9a54aa5fd5c9d0b8548fe613..086d3942701263e232d1bb31d36dd704aac81e97 100644 (file)
@@ -75,37 +75,6 @@ char *param_value;                   /* Param value e.g. "sha1" */
 } MIME_PARAM;
 
 DECLARE_STACK_OF(MIME_PARAM)
-/* This block of defines is updated by a perl script, please do not touch! */
-#ifndef DEBUG_SAFESTACK
-       #define sk_MIME_PARAM_new(a) sk_new((int (*) \
-               (const char * const *, const char * const *))(a))
-       #define sk_MIME_PARAM_new_null() sk_new_null()
-       #define sk_MIME_PARAM_free(a) sk_free(a)
-       #define sk_MIME_PARAM_num(a) sk_num(a)
-       #define sk_MIME_PARAM_value(a,b) ((MIME_PARAM *) \
-               sk_value((a),(b)))
-       #define sk_MIME_PARAM_set(a,b,c) ((MIME_PARAM *) \
-               sk_set((a),(b),(char *)(c)))
-       #define sk_MIME_PARAM_zero(a) sk_zero(a)
-       #define sk_MIME_PARAM_push(a,b) sk_push((a),(char *)(b))
-       #define sk_MIME_PARAM_unshift(a,b) sk_unshift((a),(b))
-       #define sk_MIME_PARAM_find(a,b) sk_find((a), (char *)(b))
-       #define sk_MIME_PARAM_delete(a,b) ((MIME_PARAM *) \
-               sk_delete((a),(b)))
-       #define sk_MIME_PARAM_delete_ptr(a,b) ((MIME_PARAM *) \
-               sk_delete_ptr((a),(char *)(b)))
-       #define sk_MIME_PARAM_insert(a,b,c) sk_insert((a),(char *)(b),(c))
-       #define sk_MIME_PARAM_set_cmp_func(a,b) ((int (*) \
-               (const MIME_PARAM * const *,const MIME_PARAM * const *)) \
-               sk_set_cmp_func((a),(int (*) \
-               (const char * const *, const char * const *))(b)))
-       #define sk_MIME_PARAM_dup(a) sk_dup(a)
-       #define sk_MIME_PARAM_pop_free(a,b) sk_pop_free((a),(void (*)(void *))(b))
-       #define sk_MIME_PARAM_shift(a) ((MIME_PARAM *)sk_shift(a))
-       #define sk_MIME_PARAM_pop(a) ((MIME_PARAM *)sk_pop(a))
-       #define sk_MIME_PARAM_sort(a) sk_sort(a)
-#endif /* !DEBUG_SAFESTACK */
-/* End of perl script block, you may now edit :-) */
 IMPLEMENT_STACK_OF(MIME_PARAM)
 
 typedef struct {
@@ -115,37 +84,6 @@ STACK_OF(MIME_PARAM) *params;               /* Zero or more parameters */
 } MIME_HEADER;
 
 DECLARE_STACK_OF(MIME_HEADER)
-/* This block of defines is updated by a perl script, please do not touch! */
-#ifndef DEBUG_SAFESTACK
-       #define sk_MIME_HEADER_new(a) sk_new((int (*) \
-               (const char * const *, const char * const *))(a))
-       #define sk_MIME_HEADER_new_null() sk_new_null()
-       #define sk_MIME_HEADER_free(a) sk_free(a)
-       #define sk_MIME_HEADER_num(a) sk_num(a)
-       #define sk_MIME_HEADER_value(a,b) ((MIME_HEADER *) \
-               sk_value((a),(b)))
-       #define sk_MIME_HEADER_set(a,b,c) ((MIME_HEADER *) \
-               sk_set((a),(b),(char *)(c)))
-       #define sk_MIME_HEADER_zero(a) sk_zero(a)
-       #define sk_MIME_HEADER_push(a,b) sk_push((a),(char *)(b))
-       #define sk_MIME_HEADER_unshift(a,b) sk_unshift((a),(b))
-       #define sk_MIME_HEADER_find(a,b) sk_find((a), (char *)(b))
-       #define sk_MIME_HEADER_delete(a,b) ((MIME_HEADER *) \
-               sk_delete((a),(b)))
-       #define sk_MIME_HEADER_delete_ptr(a,b) ((MIME_HEADER *) \
-               sk_delete_ptr((a),(char *)(b)))
-       #define sk_MIME_HEADER_insert(a,b,c) sk_insert((a),(char *)(b),(c))
-       #define sk_MIME_HEADER_set_cmp_func(a,b) ((int (*) \
-               (const MIME_HEADER * const *,const MIME_HEADER * const *)) \
-               sk_set_cmp_func((a),(int (*) \
-               (const char * const *, const char * const *))(b)))
-       #define sk_MIME_HEADER_dup(a) sk_dup(a)
-       #define sk_MIME_HEADER_pop_free(a,b) sk_pop_free((a),(void (*)(void *))(b))
-       #define sk_MIME_HEADER_shift(a) ((MIME_HEADER *)sk_shift(a))
-       #define sk_MIME_HEADER_pop(a) ((MIME_HEADER *)sk_pop(a))
-       #define sk_MIME_HEADER_sort(a) sk_sort(a)
-#endif /* !DEBUG_SAFESTACK */
-/* End of perl script block, you may now edit :-) */
 IMPLEMENT_STACK_OF(MIME_HEADER)
 
 static int B64_write_PKCS7(BIO *bio, PKCS7 *p7);
@@ -227,12 +165,12 @@ int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags)
                }
                bound[32] = 0;
                BIO_printf(bio, "MIME-Version: 1.0\n");
-               BIO_printf(bio, "Content-Type: multipart/signed ; ");
-               BIO_printf(bio, "protocol=\"application/x-pkcs7-signature\" ; ");
-               BIO_printf(bio, "micalg=sha1 ; boundary=\"----%s\"\n\n", bound);
+               BIO_printf(bio, "Content-Type: multipart/signed;");
+               BIO_printf(bio, " protocol=\"application/x-pkcs7-signature\";");
+               BIO_printf(bio, " micalg=sha1; boundary=\"----%s\"\n\n", bound);
                BIO_printf(bio, "This is an S/MIME signed message\n\n");
                /* Now write out the first part */
-               BIO_printf(bio, "------%s\r\n", bound);
+               BIO_printf(bio, "------%s\n", bound);
                if(flags & PKCS7_TEXT) BIO_printf(bio, "Content-Type: text/plain\n\n");
                while((i = BIO_read(data, linebuf, MAX_SMLEN)) > 0) 
                                                BIO_write(bio, linebuf, i);
@@ -434,7 +372,7 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret)
        part = 0;
        state = 0;
        first = 1;
-       parts = sk_BIO_new(NULL);
+       parts = sk_BIO_new_null();
        *ret = parts;
        while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
                state = mime_bound_check(linebuf, len, bound, blen);