From 5c6b282e57f866a1341eb705cb21507fcbfcc543 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 6 Feb 2023 12:25:55 +0000 Subject: Call the key in desc-auth-ephemeral-key, KP_hs_desc_ephem Proposed by @nickm in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/999/diffs#50f9790ab3f0a65f7ac3e4f413c84f51fae1f855_0_26 (I think the spec is not 100% clear that hs_y and hs_Y are *this* key, rather than some other possible ephemeral keypair the HS might have, so please would the reviewer check that this is actually true.) --- rend-spec-v3.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'rend-spec-v3.txt') diff --git a/rend-spec-v3.txt b/rend-spec-v3.txt index a8ac264..afc2a46 100644 --- a/rend-spec-v3.txt +++ b/rend-spec-v3.txt @@ -1208,7 +1208,7 @@ Table of contents: If client authorization is disabled, the value here should be "x25519". - "desc-auth-ephemeral-key" SP key NL + "desc-auth-ephemeral-key" SP KP_hs_desc_ephem NL [Exactly once] @@ -1239,13 +1239,11 @@ Table of contents: client_x = private x25519 key of authorized client client_X = public x25519 key of authorized client - hs_y = private key of ephemeral x25519 keypair of hidden service - hs_Y = public key of ephemeral x25519 keypair of hidden service descriptor_cookie = descriptor cookie used to encrypt the descriptor And here is what the hidden service computes: - SECRET_SEED = x25519(hs_y, client_X) + SECRET_SEED = x25519(KS_hs_desc_ephem, client_X) KEYS = KDF(N_hs_subcred | SECRET_SEED, 40) CLIENT-ID = fist 8 bytes of KEYS COOKIE-KEY = last 32 bytes of KEYS -- cgit v1.2.3-54-g00ecf From 7b3d7a40a0ac8f59b9f6d79205dfc53de4168f0c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 6 Feb 2023 12:51:41 +0000 Subject: Use proper names for KP_hsc_desc_enc --- rend-spec-v3.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'rend-spec-v3.txt') diff --git a/rend-spec-v3.txt b/rend-spec-v3.txt index afc2a46..805e0d9 100644 --- a/rend-spec-v3.txt +++ b/rend-spec-v3.txt @@ -1231,19 +1231,17 @@ Table of contents: When client authorization is enabled, each "auth-client" line contains the descriptor cookie encrypted to each individual client. We assume that - each authorized client possesses a pre-shared x25519 keypair which is - used to decrypt the descriptor cookie. + each authorized client possesses a pre-shared x25519 keypair + KS/KP_hsc_desc_enc which is used to decrypt the descriptor cookie. We now describe the descriptor cookie encryption scheme. Here are the relevant keys: - client_x = private x25519 key of authorized client - client_X = public x25519 key of authorized client descriptor_cookie = descriptor cookie used to encrypt the descriptor And here is what the hidden service computes: - SECRET_SEED = x25519(KS_hs_desc_ephem, client_X) + SECRET_SEED = x25519(KS_hs_desc_ephem, KP_hsc_desc_enc) KEYS = KDF(N_hs_subcred | SECRET_SEED, 40) CLIENT-ID = fist 8 bytes of KEYS COOKIE-KEY = last 32 bytes of KEYS -- cgit v1.2.3-54-g00ecf From 431f6152cf24f337a737d0c215137e25f29436d9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 6 Feb 2023 14:51:45 +0000 Subject: Fix terminology for handshake type The phrase "format number" is not defined anywhere. I think it means an HTYPE value. --- rend-spec-v3.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rend-spec-v3.txt') diff --git a/rend-spec-v3.txt b/rend-spec-v3.txt index a8ac264..12c1c43 100644 --- a/rend-spec-v3.txt +++ b/rend-spec-v3.txt @@ -1348,10 +1348,10 @@ Table of contents: [Exactly once] - A space-separated list of integers denoting CREATE2 cell format numbers - that the server recognizes. Must include at least ntor as described in - tor-spec.txt. See tor-spec section 5.1 for a list of recognized - handshake types. + A space-separated list of integers denoting CREATE2 cell HTYPEs + (handshake types) that the server recognizes. Must include at least + ntor as described in tor-spec.txt. See tor-spec section 5.1 for a list + of recognized handshake types. "intro-auth-required" SP types NL -- cgit v1.2.3-54-g00ecf From 71d7e7184dc11e599afb881c7e15674532338512 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 8 Feb 2023 14:49:30 +0000 Subject: Rename hs_index and hsdir_index to hs_{service,relay}_index These new names are the ones used in arti's hsdir_ring.rs and make a lot more sense than calling one of them the "directory" index and the other just the "index". In C Tor these are calculated by functions called hs_build_hs_index hs_build_hsdir_index That might be a reason *not* to accept this change. Or it might be a reason to change the C Tor code. If we don't change the names in the spec the Arti function names should change. --- rend-spec-v3.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rend-spec-v3.txt') diff --git a/rend-spec-v3.txt b/rend-spec-v3.txt index 51267ec..672248e 100644 --- a/rend-spec-v3.txt +++ b/rend-spec-v3.txt @@ -811,7 +811,7 @@ Table of contents: derived, the uploading or downloading party calculates: for replicanum in 1...hsdir_n_replicas: - hs_index(replicanum) = H("store-at-idx" | + hs_service_index(replicanum) = H("store-at-idx" | blinded_public_key | INT_8(replicanum) | INT_8(period_length) | @@ -825,7 +825,7 @@ Table of contents: Then, for each node listed in the current consensus with the HSDir flag, we compute a directory index for that node as: - hsdir_index(node) = H("node-idx" | node_identity | + hs_relay_index(node) = H("node-idx" | node_identity | shared_random_value | INT_8(period_num) | INT_8(period_length) ) @@ -836,7 +836,7 @@ Table of contents: Finally, for replicanum in 1...hsdir_n_replicas, the hidden service host uploads descriptors to the first hsdir_spread_store nodes whose - indices immediately follow hs_index(replicanum). If any of those + indices immediately follow hs_service_index(replicanum). If any of those nodes have already been selected for a lower-numbered replica of the service, any nodes already chosen are disregarded (i.e. skipped over) when choosing a replica's hsdir_spread_store nodes. -- cgit v1.2.3-54-g00ecf