diff options
author | David Goulet <dgoulet@torproject.org> | 2019-09-11 08:46:31 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-10-03 15:43:03 -0400 |
commit | 52b7ae71b31671c758a2798e8c98abb720ac22f5 (patch) | |
tree | ef6ea172c3f6e5d93b7cf54da1ae26cb1804a61a /src/feature/control/control_cmd.c | |
parent | c8df2c720501fc8a3f96c34fcef0bced4498deb0 (diff) | |
download | tor-52b7ae71b31671c758a2798e8c98abb720ac22f5.tar.gz tor-52b7ae71b31671c758a2798e8c98abb720ac22f5.zip |
hs: ADD_ONION NEW:BEST now defaults to ED25519-V3
From RSA1024 (v2) to v3 now.
Closes #29669
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/control/control_cmd.c')
-rw-r--r-- | src/feature/control/control_cmd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c index f804ceafbc..de1bef7e59 100644 --- a/src/feature/control/control_cmd.c +++ b/src/feature/control/control_cmd.c @@ -1982,8 +1982,7 @@ add_onion_helper_keyarg(const char *arg, int discard_pk, *hs_version = HS_VERSION_THREE; } else if (!strcasecmp(key_type_new, key_type)) { /* "NEW:<Algorithm>" - Generating a new key, blob as algorithm. */ - if (!strcasecmp(key_type_rsa1024, key_blob) || - !strcasecmp(key_type_best, key_blob)) { + if (!strcasecmp(key_type_rsa1024, key_blob)) { /* "RSA1024", RSA 1024 bit, also currently "BEST" by default. */ pk = crypto_pk_new(); if (crypto_pk_generate_key(pk)) { @@ -2002,7 +2001,9 @@ add_onion_helper_keyarg(const char *arg, int discard_pk, } decoded_key->v2 = pk; *hs_version = HS_VERSION_TWO; - } else if (!strcasecmp(key_type_ed25519_v3, key_blob)) { + } else if (!strcasecmp(key_type_ed25519_v3, key_blob) || + !strcasecmp(key_type_best, key_blob)) { + /* "ED25519-V3", ed25519 key, also currently "BEST" by default. */ ed25519_secret_key_t *sk = tor_malloc_zero(sizeof(*sk)); if (ed25519_secret_key_generate(sk, 1) < 0) { tor_free(sk); |