> From: openssl-users [mailto:openssl-users-bounces@xxxxxxxxxxx] On Behalf > Of etc@xxxxxxxxxxxxxx > Sent: Wednesday, March 14, 2018 02:33 > To: openssl-users@xxxxxxxxxxx > Subject: Re: MIME-canonicalization > > I think I found the reason for the problem. > > SMIME_read_CMS does convert any single LF to a CRLF. Have you verified that the file actually contains bare LFs, and not CRLFs? If you're running on Windows, beware the CRLF conversions done by the C library. For example, if you write a file using a file BIO that was created using a FILE* from a text-mode fopen, that file will have LFs converted to CRLF on output. You need to open the file in binary mode, or call _setmode on the FILE* before writing to it. SMIME_read_CMS just calls SMIME_read_ASN1, which ultimately does a bunch of BIO_gets, which calls the gets method on the BIO object. A file BIO's gets method just calls fgets. So if there's translation happening, it would appear to be in the C runtime. -- Michael Wojcik Distinguished Engineer, Micro Focus -- openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users