diff --git a/openssl-1.1.0-bio-fd-preserve-nl.patch b/openssl-1.1.0-bio-fd-preserve-nl.patch new file mode 100644 index 0000000..0050115 --- /dev/null +++ b/openssl-1.1.0-bio-fd-preserve-nl.patch @@ -0,0 +1,29 @@ +diff -up openssl-1.1.0c/crypto/bio/bss_fd.c.preserve-nl openssl-1.1.0c/crypto/bio/bss_fd.c +--- openssl-1.1.0c/crypto/bio/bss_fd.c.preserve-nl 2016-11-10 15:03:44.000000000 +0100 ++++ openssl-1.1.0c/crypto/bio/bss_fd.c 2016-12-22 14:36:16.730740423 +0100 +@@ -202,8 +202,10 @@ static int fd_gets(BIO *bp, char *buf, i + char *ptr = buf; + char *end = buf + size - 1; + +- while ((ptr < end) && (fd_read(bp, ptr, 1) > 0) && (ptr[0] != '\n')) +- ptr++; ++ while (ptr < end && fd_read(bp, ptr, 1) > 0) { ++ if (*ptr++ == '\n') ++ break; ++ } + + ptr[0] = '\0'; + +diff -up openssl-1.1.0c/doc/crypto/BIO_read.pod.preserve-nl openssl-1.1.0c/doc/crypto/BIO_read.pod +--- openssl-1.1.0c/doc/crypto/BIO_read.pod.preserve-nl 2016-11-10 15:03:45.000000000 +0100 ++++ openssl-1.1.0c/doc/crypto/BIO_read.pod 2016-12-22 14:37:22.731245197 +0100 +@@ -23,7 +23,8 @@ in B. Usually this operation will a + from the BIO of maximum length B. There are exceptions to this, + however; for example, BIO_gets() on a digest BIO will calculate and + return the digest and other BIOs may not support BIO_gets() at all. +-The returned string is always NUL-terminated. ++The returned string is always NUL-terminated and the '\n' is preserved ++if present in the input data. + + BIO_write() attempts to write B bytes from B to BIO B. + diff --git a/openssl.spec b/openssl.spec index ec410fc..2e053d7 100644 --- a/openssl.spec +++ b/openssl.spec @@ -22,7 +22,7 @@ Summary: Utilities from the general purpose cryptography library with TLS implementation Name: openssl Version: 1.1.0c -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 # We have to remove certain patented algorithms from the openssl source # tarball with the hobble-openssl script which is included below. @@ -59,6 +59,7 @@ Patch40: openssl-1.1.0-disable-ssl3.patch Patch41: openssl-1.1.0-system-cipherlist.patch Patch42: openssl-1.1.0-fips.patch Patch43: openssl-1.1.0-afalg-eventfd2.patch +Patch44: openssl-1.1.0-bio-fd-preserve-nl.patch # Backported fixes including security fixes Patch60: openssl-1.1.0-sslread-revert.patch Patch61: openssl-1.1.0-cert-req.patch @@ -160,6 +161,7 @@ cp %{SOURCE13} test/ %patch41 -p1 -b .system-cipherlist %patch42 -p1 -b .fips %patch43 -p1 -b .eventfd2 +%patch44 -p1 -b .preserve-nl %patch60 -p1 -b .sslread-revert %patch61 -p1 -b .cert-req @@ -430,6 +432,9 @@ export LD_LIBRARY_PATH %postun libs -p /sbin/ldconfig %changelog +* Thu Dec 22 2016 Tomáš Mráz 1.1.0c-5 +- preserve new line in fd BIO BIO_gets() as other BIOs do + * Fri Dec 2 2016 Tomáš Mráz 1.1.0c-4 - FIPS mode fixes for TLS