diff options
author | David Goulet <dgoulet@torproject.org> | 2017-12-05 14:24:00 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-05 19:39:46 -0500 |
commit | 8c02fc15ae8391d800926c0c6df7fb258139ce79 (patch) | |
tree | bcf83756cc3734775d9ca77f7a0609225baea5c7 /src/or/control.h | |
parent | 9c6560fe29c9e2ee33549ca890f94c03cbdd94a8 (diff) | |
download | tor-8c02fc15ae8391d800926c0c6df7fb258139ce79.tar.gz tor-8c02fc15ae8391d800926c0c6df7fb258139ce79.zip |
control: Don't use void pointer for ADD_ONION secret key
Make this a bit more safe with at least type checking of the pointers
depending on the version.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/control.h')
-rw-r--r-- | src/or/control.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/or/control.h b/src/or/control.h index 23f6eed8e5..28ffeaed86 100644 --- a/src/or/control.h +++ b/src/or/control.h @@ -263,9 +263,20 @@ void format_cell_stats(char **event_string, circuit_t *circ, cell_stats_t *cell_stats); STATIC char *get_bw_samples(void); +/* ADD_ONION secret key to create an ephemeral service. The command supports + * multiple versions so this union stores the key and passes it to the HS + * subsystem depending on the requested version. */ +typedef union add_onion_secret_key_t { + /* Hidden service v2 secret key. */ + crypto_pk_t *v2; + /* Hidden service v3 secret key. */ + ed25519_secret_key_t *v3; +} add_onion_secret_key_t; + STATIC int add_onion_helper_keyarg(const char *arg, int discard_pk, const char **key_new_alg_out, - char **key_new_blob_out, void **decoded_key, + char **key_new_blob_out, + add_onion_secret_key_t *decoded_key, int *hs_version, char **err_msg_out); STATIC rend_authorized_client_t * |