[tor-commits] [tor/master] hs: Remove redundant define of ed25519 auth key type

nickm at torproject.org nickm at torproject.org
Thu Apr 13 20:43:17 UTC 2017


commit c71670262506cfe75bb439928ce2da2b1ebd30c4
Author: David Goulet <dgoulet at torproject.org>
Date:   Thu Dec 22 16:59:18 2016 -0500

    hs: Remove redundant define of ed25519 auth key type
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 src/or/hs_common.h     | 3 ---
 src/or/hs_intropoint.c | 4 ++--
 src/or/hs_service.c    | 4 +++-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/or/hs_common.h b/src/or/hs_common.h
index 890797c..400345c 100644
--- a/src/or/hs_common.h
+++ b/src/or/hs_common.h
@@ -17,9 +17,6 @@
 /* Version 3 of the protocol (prop224). */
 #define HS_VERSION_THREE 3
 
-/* Denotes ed25519 authentication key on ESTABLISH_INTRO cell. */
-#define AUTH_KEY_ED25519 0x02
-
 /* String prefix for the signature of ESTABLISH_INTRO */
 #define ESTABLISH_INTRO_SIG_PREFIX "Tor establish-intro cell v1"
 
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c
index a7282ab..168a89b 100644
--- a/src/or/hs_intropoint.c
+++ b/src/or/hs_intropoint.c
@@ -73,9 +73,9 @@ verify_establish_intro_cell(const hs_cell_establish_intro_t *cell,
                             size_t circuit_key_material_len)
 {
   /* We only reach this function if the first byte of the cell is 0x02 which
-   * means that auth_key_type is AUTH_KEY_ED25519, hence this check should
+   * means that auth_key_type is of ed25519 type, hence this check should
    * always pass. See hs_intro_received_establish_intro().  */
-  if (BUG(cell->auth_key_type != AUTH_KEY_ED25519)) {
+  if (BUG(cell->auth_key_type != HS_INTRO_AUTH_KEY_TYPE_ED25519)) {
     return -1;
   }
 
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 52de2bf..5d69a1d 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -12,6 +12,7 @@
 #include "circuitlist.h"
 #include "circpathbias.h"
 
+#include "hs_intropoint.h"
 #include "hs_service.h"
 #include "hs_common.h"
 
@@ -75,7 +76,8 @@ generate_establish_intro_cell(const uint8_t *circuit_key_material,
   cell = hs_cell_establish_intro_new();
 
   /* Set AUTH_KEY_TYPE: 2 means ed25519 */
-  hs_cell_establish_intro_set_auth_key_type(cell, AUTH_KEY_ED25519);
+  hs_cell_establish_intro_set_auth_key_type(cell,
+                                            HS_INTRO_AUTH_KEY_TYPE_ED25519);
 
   /* Set AUTH_KEY_LEN field */
   /* Must also set byte-length of AUTH_KEY to match */





More information about the tor-commits mailing list