This is an automated email from the git hooks/post-receive script.
dgoulet pushed a change to branch main in repository torspec.
from 0da1241 Merge branch 'tor-gitlab/mr/104' new 16d536e prop339: Remove the nul term requirement for hostname new e787831 prop339: Unify the address format into one object new 63cb0fc prop339: trunnel changes from review new ad9a003 Merge branch 'tor-gitlab/mr/74'
The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: proposals/339-udp-over-tor.md | 72 +++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 27 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 16d536e9ff281115603f09a258d7c89765a941a3 Author: David Goulet dgoulet@torproject.org AuthorDate: Mon Jun 6 13:24:22 2022 -0400
prop339: Remove the nul term requirement for hostname
Signed-off-by: David Goulet dgoulet@torproject.org --- proposals/339-udp-over-tor.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/proposals/339-udp-over-tor.md b/proposals/339-udp-over-tor.md index 3c1a1d4..2a822aa 100644 --- a/proposals/339-udp-over-tor.md +++ b/proposals/339-udp-over-tor.md @@ -169,7 +169,7 @@ struct connect_udp_body { union address[addr_type] with length addr_len { T_IPV4: u32 ipv4; T_IPV6: u8 ipv6[16]; - T_HOSTNAME: nulterm name + T_HOSTNAME: hostname; }; u16 port; // The rest is ignored. @@ -191,6 +191,10 @@ const FLAG_IPV4_NOT_OKAY = 0x02; const FLAG_IPV6_PREFERRED = 0x04; ```
+A "hostname" is a DNS hostname that can only contain ascii characters. It is +NOT following the large and broad DNS syntax. These behaves exacly like BEGIN +cell behave with regards to the hostname given. + ### CONNECTED_UDP
A CONNECTED_UDP cell sent in response to a CONNECT_UDP cell has the following
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit e7878316891312f3ad81202ba115bd631f7ddd9a Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jun 7 09:47:07 2022 -0400
prop339: Unify the address format into one object
Signed-off-by: David Goulet dgoulet@torproject.org --- proposals/339-udp-over-tor.md | 65 +++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 27 deletions(-)
diff --git a/proposals/339-udp-over-tor.md b/proposals/339-udp-over-tor.md index 2a822aa..7bebba0 100644 --- a/proposals/339-udp-over-tor.md +++ b/proposals/339-udp-over-tor.md @@ -149,6 +149,39 @@ along with extensions to some older relay message types. We note in passing how we could extend these messages to support unconnected UDP sockets in the future.
+### Common Format + +We define here a common format for an "address" that is used both in a +CONNECT_UDP and CONNECTED_UDP cell. + +#### Address + +Defines an IP or Hostname address along with its port. This can be seen as the +`ADDRPORT` of a `BEGIN` cell defined in tor-spec.txt but with a different +format. + +``` +/* Address types */ +const T_HOSTNAME = 0x01; +const T_IPV4 = 0x04; +const T_IPV6 = 0x06; + +struct address { + u8 type IN [T_IPV4, T_IPV6, T_HOSTNAME]; + u8 len IN [0, 255]; + union addr[type] with length len { + T_IPV4: u32 ipv4; + T_IPV6: u8 ipv6[16]; + T_HOSTNAME: u8 hostname[]; + }; + u16 port IN [1, 65535]; +} +``` + +The `hostname` follows the RFC1035 for its accepted length that is 63 +characters or less that is a `len` between 0 and 255 (bytes). It should +contain a sequence of nonzero octets as in any nul byte results in a malformed +cell.
### CONNECT_UDP
@@ -161,26 +194,13 @@ sockets in the future. struct connect_udp_body { /* As in BEGIN cells. */ u32 flags; - /* Tag for union below. */ - u8 addr_type IN [T_HOSTNAME, T_IPV4, T_IPV6]; - /* Length of the following union */ - u8 addr_len; - /* The address to connect to. */ - union address[addr_type] with length addr_len { - T_IPV4: u32 ipv4; - T_IPV6: u8 ipv6[16]; - T_HOSTNAME: hostname; - }; - u16 port; + /* Address to connect to. */ + struct address addr; // The rest is ignored.
// TODO: Is "the rest is ignored" still a good idea? Look at Rochet's // research. } -/* Address types */ -const T_HOSTNAME = 0x01; -const T_IPV4 = 0x04; -const T_IPV6 = 0x06;
/* As in BEGIN cells: these control how hostnames are interpreted. Clients MUST NOT send unrecognized flags; relays MUST ignore them. @@ -212,20 +232,11 @@ struct udp_connected_body { // TODO: Is "the rest is ignored" still a good idea? Look at Rochet's // research. } - -/* Note that this is a subset of the allowable address parts of a CONNECT_UDP - * message */ -struct address { - u8 tag IN [T_IPV4, T_IPV6]; - u8 len; - union addr[tag] with length len { - T_IPV4: u32 ipv4; - T_IPV6: u8 ipv6[16]; - }; - u16 port; -} ```
+Both `our_address` and `their_address` MUST NOT be of type `T_HOSTNAME` else +the cell is considered malformed. + ### DATAGRAM
```
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 63cb0fc1ef97ee9848b508a1e95316f02f2472a2 Author: Nick Mathewson nickm@torproject.org AuthorDate: Fri Jan 27 12:10:02 2023 -0500
prop339: trunnel changes from review
* The syntax `IN [a,b]` means that a and b are the only valid options, which isn't what we want to say here. * I'm changing the hostname tag to 0, which is the same as we have for RESOLVED cells. --- proposals/339-udp-over-tor.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/proposals/339-udp-over-tor.md b/proposals/339-udp-over-tor.md index 7bebba0..5993bdc 100644 --- a/proposals/339-udp-over-tor.md +++ b/proposals/339-udp-over-tor.md @@ -161,20 +161,23 @@ Defines an IP or Hostname address along with its port. This can be seen as the format.
``` -/* Address types */ -const T_HOSTNAME = 0x01; +/* Address types. + + Note that these are the same as in RESOLVED cells. +*/ +const T_HOSTNAME = 0x00; const T_IPV4 = 0x04; const T_IPV6 = 0x06;
struct address { u8 type IN [T_IPV4, T_IPV6, T_HOSTNAME]; - u8 len IN [0, 255]; + u8 len; union addr[type] with length len { T_IPV4: u32 ipv4; T_IPV6: u8 ipv6[16]; T_HOSTNAME: u8 hostname[]; }; - u16 port IN [1, 65535]; + u16 port; } ```
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit ad9a0036736ad1d2e803f0e66eeda28c330e8db1 Merge: 0da1241 63cb0fc Author: David Goulet dgoulet@torproject.org AuthorDate: Fri Jan 27 15:55:27 2023 -0500
Merge branch 'tor-gitlab/mr/74'
proposals/339-udp-over-tor.md | 72 +++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 27 deletions(-)
tor-commits@lists.torproject.org