From 52bf54ecd4aa48a95f16c2e678ede7d24ef4d322 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 28 May 2019 12:35:04 -0400 Subject: hs-v3: Add a series of decoding error code This commit introduces the hs_desc_decode_status_t enum which aims at having more fine grained error code when decoding a descriptor. This will be useful in later commits when we support keeping a descriptor that can't be decrypted due to missing or bad client authorization creds. No behavior change. Part of #30382. Signed-off-by: David Goulet --- src/feature/hs/hs_descriptor.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/feature/hs/hs_descriptor.h') diff --git a/src/feature/hs/hs_descriptor.h b/src/feature/hs/hs_descriptor.h index 731e0c5ce9..8d9dac1747 100644 --- a/src/feature/hs/hs_descriptor.h +++ b/src/feature/hs/hs_descriptor.h @@ -69,6 +69,15 @@ typedef enum { HS_DESC_AUTH_ED25519 = 1 } hs_desc_auth_type_t; +/** Error code when decoding a descriptor. */ +typedef enum { + HS_DESC_DECODE_ENCRYPTED_ERROR = -4, + HS_DESC_DECODE_SUPERENC_ERROR = -3, + HS_DESC_DECODE_PLAINTEXT_ERROR = -2, + HS_DESC_DECODE_GENERIC_ERROR = -1, + HS_DESC_DECODE_OK = 0, +} hs_desc_decode_status_t; + /** Introduction point information located in a descriptor. */ typedef struct hs_desc_intro_point_t { /** Link specifier(s) which details how to extend to the relay. This list -- cgit v1.2.3-54-g00ecf