Commit 4e0755c
crypto: have fixed NodeBIOs return EOF
Prior to this change, the NodeBIO objects used to wrap fixed data had
`num` equal to -1. This caused them to return -1 and set the retry flags
when they ran out of data. Since the data is fixed, that's incorrect.
Instead they should return zero to signal EOF.
This change adds a new, static function, NodeBIO::NewFixed to create a
BIO that wraps fixed data and which returns zero when exhausted.
The practical impact of this is limited since most (all?) the parsing
functions that these BIOs get passed to consider any return value less
than one to be EOF and ignore the retry flags anyway.
PR-URL: #5105
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>1 parent bc2536d commit 4e0755c
3 files changed
+26
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | 410 | | |
415 | 411 | | |
416 | | - | |
417 | | - | |
418 | 412 | | |
419 | 413 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 414 | + | |
425 | 415 | | |
426 | 416 | | |
427 | | - | |
428 | | - | |
429 | | - | |
| 417 | + | |
| 418 | + | |
430 | 419 | | |
431 | 420 | | |
432 | | - | |
| 421 | + | |
433 | 422 | | |
434 | 423 | | |
435 | 424 | | |
| |||
769 | 758 | | |
770 | 759 | | |
771 | 760 | | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
| 761 | + | |
| 762 | + | |
776 | 763 | | |
777 | 764 | | |
778 | 765 | | |
779 | 766 | | |
780 | | - | |
781 | 767 | | |
782 | 768 | | |
783 | 769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
30 | 46 | | |
31 | 47 | | |
32 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
0 commit comments