mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 07:31:33 +01:00
Merge branch 'bug23106_032'
This commit is contained in:
commit
b5c5086aba
2 changed files with 6 additions and 1 deletions
5
changes/bug23106
Normal file
5
changes/bug23106
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
o Minor bugfixes (code correctness):
|
||||||
|
- Call htons() in extend_cell_format() for encoding a 16-bit
|
||||||
|
value. Previously we used ntohs(), which happens to behave the
|
||||||
|
same on all the platforms we support, but which isn't really
|
||||||
|
correct. Fixes bug 23106; bugfix on 0.2.4.8-alpha.
|
|
@ -1219,7 +1219,7 @@ extend_cell_format(uint8_t *command_out, uint16_t *len_out,
|
||||||
*command_out = RELAY_COMMAND_EXTEND;
|
*command_out = RELAY_COMMAND_EXTEND;
|
||||||
*len_out = 6 + TAP_ONIONSKIN_CHALLENGE_LEN + DIGEST_LEN;
|
*len_out = 6 + TAP_ONIONSKIN_CHALLENGE_LEN + DIGEST_LEN;
|
||||||
set_uint32(p, tor_addr_to_ipv4n(&cell_in->orport_ipv4.addr));
|
set_uint32(p, tor_addr_to_ipv4n(&cell_in->orport_ipv4.addr));
|
||||||
set_uint16(p+4, ntohs(cell_in->orport_ipv4.port));
|
set_uint16(p+4, htons(cell_in->orport_ipv4.port));
|
||||||
if (cell_in->create_cell.handshake_type == ONION_HANDSHAKE_TYPE_NTOR) {
|
if (cell_in->create_cell.handshake_type == ONION_HANDSHAKE_TYPE_NTOR) {
|
||||||
memcpy(p+6, NTOR_CREATE_MAGIC, 16);
|
memcpy(p+6, NTOR_CREATE_MAGIC, 16);
|
||||||
memcpy(p+22, cell_in->create_cell.onionskin, NTOR_ONIONSKIN_LEN);
|
memcpy(p+22, cell_in->create_cell.onionskin, NTOR_ONIONSKIN_LEN);
|
||||||
|
|
Loading…
Add table
Reference in a new issue