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 419144adce049b5341bd94d355c52d099eac56e3.
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
..
2018-09-26 19:02:42 +00:00
2018-05-11 21:59:34 +00:00
2017-10-25 04:17:18 +00:00
2018-12-05 22:05:28 +00:00
2018-04-12 21:02:12 +00:00
2017-10-25 04:17:18 +00:00
2018-04-12 21:02:12 +00:00
2018-05-03 17:40:43 +00:00
2017-11-22 22:52:38 +00:00