boringssl/crypto/bio
David Benjamin 750fea158a Fix d2i_*_bio on partial reads.
If BIO_read returns partial reads, d2i_*_bio currently fails. This is a
partial (hah) regression from 419144adce.
The old a_d2i_fp.c code did *not* tolerate partial reads in the ASN.1
header, but it *did* tolerate them in the ASN.1 body. Since partial
reads are more likely to land in the body than the header, I think we
can say d2i_*_bio was "supposed to" tolerate this but had a bug in the
first few bytes.

Fix it for both cases. Add a regression test for this and the partial
write case (which works fine).

See also https://github.com/google/conscrypt/pull/587.

Change-Id: I886f6388f0b80621960e196cf2a56f5c02a14a04
Reviewed-on: https://boringssl-review.googlesource.com/c/33484
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2018-12-05 22:05:28 +00:00
..
bio_mem.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
bio_test.cc Add missing errno.h include to bio_test.cc 2017-12-04 01:32:37 +00:00
bio.c Fix d2i_*_bio on partial reads. 2018-12-05 22:05:28 +00:00
connect.c Remove files from Trusty which can't link because of Trusty libc. 2018-04-19 19:06:58 +00:00
fd.c Remove files from Trusty which can't link because of Trusty libc. 2018-04-19 19:06:58 +00:00
file.c Replace BIO_new + BIO_set_fp with BIO_new_fp. 2018-09-26 17:21:08 +00:00
hexdump.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
internal.h Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
pair.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
printf.c Remove now unnecessary _POSIX_C_SOURCE bits to work around macOS bug. 2017-10-02 20:02:22 +00:00
socket_helper.c Remove files from Trusty which can't link because of Trusty libc. 2018-04-19 19:06:58 +00:00
socket.c Remove files from Trusty which can't link because of Trusty libc. 2018-04-19 19:06:58 +00:00