Lines Matching defs:bio
19 #include "internal/bio.h"
50 static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio);
57 static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **ret);
76 BIO *bio, *tbio;
77 bio = BIO_new_NDEF(out, val, it);
78 if (!bio) {
82 if (!SMIME_crlf_copy(in, bio, flags)) {
86 (void)BIO_flush(bio);
89 tbio = BIO_pop(bio);
90 BIO_free(bio);
91 bio = tbio;
92 } while (bio != out);
138 static ASN1_VALUE *b64_read_asn1(BIO *bio, const ASN1_ITEM *it, ASN1_VALUE **x,
148 bio = BIO_push(b64, bio);
149 val = ASN1_item_d2i_bio_ex(it, bio, x, libctx, propq);
152 (void)BIO_flush(bio);
153 BIO_pop(bio);
238 int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
271 BIO_printf(bio, "MIME-Version: 1.0%s", mime_eol);
272 BIO_printf(bio, "Content-Type: multipart/signed;");
273 BIO_printf(bio, " protocol=\"%ssignature\";", mime_prefix);
274 BIO_puts(bio, " micalg=\"");
275 asn1_write_micalg(bio, mdalgs);
276 BIO_printf(bio, "\"; boundary=\"----%s\"%s%s",
278 BIO_printf(bio, "This is an S/MIME signed message%s%s",
281 BIO_printf(bio, "------%s%s", bound, mime_eol);
282 if (!asn1_output_data(bio, data, val, flags, it))
284 BIO_printf(bio, "%s------%s%s", mime_eol, bound, mime_eol);
288 BIO_printf(bio, "Content-Type: %ssignature;", mime_prefix);
289 BIO_printf(bio, " name=\"smime.p7s\"%s", mime_eol);
290 BIO_printf(bio, "Content-Transfer-Encoding: base64%s", mime_eol);
291 BIO_printf(bio, "Content-Disposition: attachment;");
292 BIO_printf(bio, " filename=\"smime.p7s\"%s%s", mime_eol, mime_eol);
293 B64_write_ASN1(bio, val, NULL, 0, it);
294 BIO_printf(bio, "%s------%s--%s%s", mime_eol, bound,
315 BIO_printf(bio, "MIME-Version: 1.0%s", mime_eol);
316 BIO_printf(bio, "Content-Disposition: attachment;");
317 BIO_printf(bio, " filename=\"%s\"%s", cname, mime_eol);
318 BIO_printf(bio, "Content-Type: %smime;", mime_prefix);
320 BIO_printf(bio, " smime-type=%s;", msg_type);
321 BIO_printf(bio, " name=\"%s\"%s", cname, mime_eol);
322 BIO_printf(bio, "Content-Transfer-Encoding: base64%s%s",
324 if (!B64_write_ASN1(bio, val, data, flags, it))
326 BIO_printf(bio, "%s", mime_eol);
330 int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
334 return SMIME_write_ASN1_ex(bio, val, data, flags, ctype_nid, econt_nid,
397 ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont,
412 if ((headers = mime_parse_hdr(bio)) == NULL) {
434 ret = multi_split(bio, flags, prm->param_value, &parts);
499 if ((val = b64_read_asn1(bio, it, x, libctx, propq)) == NULL) {
506 ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
508 return SMIME_read_ASN1_ex(bio, 0, bcont, it, NULL, NULL, NULL);
602 static int multi_split(BIO *bio, int flags, const char *bound, STACK_OF(BIO) **ret)
619 while ((len = BIO_get_line(bio, linebuf, MAX_SMLEN)) > 0) {
675 static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio)
687 while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {