Commit e8d93ef
authored
crypto/noise: Fix connection negotiation logic on partial writes (#519)
This PR replaces the `io.write` with `io.write_all` calls to ensure the
negotiation messages are fully propagated.
- There was a bug in the `fn handshake` implementation, which might
propagate only a part of the provided negotiation message (ie on partial
writes the `write` call would return immediately)
- This would then be rejected by the other side, causing unnecessary
negotiation errors while opening the connection
- The downstream effect of this is that higher level protocols (like
notification protocols) would backoff the peer for ~5s.
Signed-off-by: Alexandru Vasile <[email protected]>1 parent 9dc8b34 commit e8d93ef
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
| 800 | + | |
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
| 815 | + | |
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
| 826 | + | |
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
| |||
0 commit comments