aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2023-07-24 09:44:06 -0400
committerDavid Goulet <dgoulet@torproject.org>2023-07-24 09:44:42 -0400
commitd6fd7d10352aae85ab5364efce6136b8b31108ca (patch)
treeab0268e9fc8921a7e94360e8b96bcea8ca2c6620 /src/feature
parent3335829347e780a44751315402e878e6e5281242 (diff)
downloadtor-d6fd7d10352aae85ab5364efce6136b8b31108ca.tar.gz
tor-d6fd7d10352aae85ab5364efce6136b8b31108ca.zip
Fix all -Werror=enum-int-mismatch warnings
Close #40824 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_descriptor.c11
-rw-r--r--src/feature/hs/hs_descriptor.h15
2 files changed, 14 insertions, 12 deletions
diff --git a/src/feature/hs/hs_descriptor.c b/src/feature/hs/hs_descriptor.c
index 15ad9d8efb..d61ce237fa 100644
--- a/src/feature/hs/hs_descriptor.c
+++ b/src/feature/hs/hs_descriptor.c
@@ -2162,7 +2162,7 @@ desc_decode_superencrypted_v3(const hs_descriptor_t *desc,
hs_desc_superencrypted_data_t *
desc_superencrypted_out)
{
- int ret = HS_DESC_DECODE_SUPERENC_ERROR;
+ hs_desc_decode_status_t ret = HS_DESC_DECODE_SUPERENC_ERROR;
char *message = NULL;
size_t message_len;
memarea_t *area = NULL;
@@ -2276,7 +2276,7 @@ desc_decode_encrypted_v3(const hs_descriptor_t *desc,
const curve25519_secret_key_t *client_auth_sk,
hs_desc_encrypted_data_t *desc_encrypted_out)
{
- int ret = HS_DESC_DECODE_ENCRYPTED_ERROR;
+ hs_desc_decode_status_t ret = HS_DESC_DECODE_ENCRYPTED_ERROR;
char *message = NULL;
size_t message_len;
memarea_t *area = NULL;
@@ -2423,7 +2423,7 @@ hs_desc_decode_encrypted(const hs_descriptor_t *desc,
const curve25519_secret_key_t *client_auth_sk,
hs_desc_encrypted_data_t *desc_encrypted)
{
- int ret = HS_DESC_DECODE_ENCRYPTED_ERROR;
+ hs_desc_decode_status_t ret = HS_DESC_DECODE_ENCRYPTED_ERROR;
uint32_t version;
tor_assert(desc);
@@ -2473,7 +2473,7 @@ hs_desc_decode_superencrypted(const hs_descriptor_t *desc,
hs_desc_superencrypted_data_t *
desc_superencrypted)
{
- int ret = HS_DESC_DECODE_SUPERENC_ERROR;
+ hs_desc_decode_status_t ret = HS_DESC_DECODE_SUPERENC_ERROR;
uint32_t version;
tor_assert(desc);
@@ -2523,7 +2523,8 @@ hs_desc_decode_status_t
hs_desc_decode_plaintext(const char *encoded,
hs_desc_plaintext_data_t *plaintext)
{
- int ok = 0, ret = HS_DESC_DECODE_PLAINTEXT_ERROR;
+ int ok = 0;
+ hs_desc_decode_status_t ret = HS_DESC_DECODE_PLAINTEXT_ERROR;
memarea_t *area = NULL;
smartlist_t *tokens = NULL;
size_t encoded_len;
diff --git a/src/feature/hs/hs_descriptor.h b/src/feature/hs/hs_descriptor.h
index 8f42b2138b..8ae16825d2 100644
--- a/src/feature/hs/hs_descriptor.h
+++ b/src/feature/hs/hs_descriptor.h
@@ -281,17 +281,18 @@ MOCK_DECL(int,
const uint8_t *descriptor_cookie,
char **encoded_out));
-int hs_desc_decode_descriptor(const char *encoded,
+hs_desc_decode_status_t hs_desc_decode_descriptor(const char *encoded,
const hs_subcredential_t *subcredential,
const curve25519_secret_key_t *client_auth_sk,
hs_descriptor_t **desc_out);
-int hs_desc_decode_plaintext(const char *encoded,
+hs_desc_decode_status_t hs_desc_decode_plaintext(const char *encoded,
hs_desc_plaintext_data_t *plaintext);
-int hs_desc_decode_superencrypted(const hs_descriptor_t *desc,
- hs_desc_superencrypted_data_t *desc_out);
-int hs_desc_decode_encrypted(const hs_descriptor_t *desc,
- const curve25519_secret_key_t *client_auth_sk,
- hs_desc_encrypted_data_t *desc_out);
+hs_desc_decode_status_t hs_desc_decode_superencrypted(
+ const hs_descriptor_t *desc,
+ hs_desc_superencrypted_data_t *desc_out);
+hs_desc_decode_status_t hs_desc_decode_encrypted(const hs_descriptor_t *desc,
+ const curve25519_secret_key_t *client_auth_sk,
+ hs_desc_encrypted_data_t *desc_out);
size_t hs_desc_obj_size(const hs_descriptor_t *data);
size_t hs_desc_plaintext_obj_size(const hs_desc_plaintext_data_t *data);