BIO *p7bio = NULL;
int i;
X509 *x509;
- char inbuf[4096];
static char txthdr[] = "Content-type: text/plain\r\n\r\n";
if(!(p7 = PKCS7_new())) {
PKCS7err(PKCS7_F_PKCS7_ENCRYPT,ERR_R_MALLOC_FAILURE);
}
}
- for (;;) {
- i = BIO_read(in, inbuf, sizeof(inbuf));
- if (i <= 0) break;
- BIO_write(p7bio, inbuf, i);
- }
+ SMIME_crlf_copy(in, p7bio, flags);
+
BIO_flush(p7bio);
if (!PKCS7_dataFinal(p7,p7bio)) {