diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-02-26 12:33:23 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-02-26 12:33:23 +0200 |
commit | 7fbfdf2af731f500e3df3ca8207e6822f87f1bc9 (patch) | |
tree | 7dd1beac6cc0854d7b4930ec111ec0cb261cb588 /src/feature/hs | |
parent | 626e6d2c394673ca46a44616a76b33699d0cf763 (diff) | |
parent | f632335feb27b45a3ee5eb64690826bda52467bd (diff) | |
download | tor-7fbfdf2af731f500e3df3ca8207e6822f87f1bc9.tar.gz tor-7fbfdf2af731f500e3df3ca8207e6822f87f1bc9.zip |
Merge branch 'tor-github/pr/611'
Diffstat (limited to 'src/feature/hs')
-rw-r--r-- | src/feature/hs/hs_client.c | 5 | ||||
-rw-r--r-- | src/feature/hs/hs_common.c | 3 | ||||
-rw-r--r-- | src/feature/hs/hs_service.c | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c index e1d0e8613a..075f1d5c41 100644 --- a/src/feature/hs/hs_client.c +++ b/src/feature/hs/hs_client.c @@ -1561,7 +1561,10 @@ parse_auth_file_content(const char *client_key_str) auth = tor_malloc_zero(sizeof(hs_client_service_authorization_t)); if (base32_decode((char *) auth->enc_seckey.secret_key, sizeof(auth->enc_seckey.secret_key), - seckey_b32, strlen(seckey_b32)) < 0) { + seckey_b32, strlen(seckey_b32)) != + sizeof(auth->enc_seckey.secret_key)) { + log_warn(LD_REND, "Client authorization encoded base32 private key " + "can't be decoded: %s", seckey_b32); goto err; } strncpy(auth->onion_address, onion_address, HS_SERVICE_ADDR_LEN_BASE32); diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c index ebe49f09a5..14655c53a5 100644 --- a/src/feature/hs/hs_common.c +++ b/src/feature/hs/hs_common.c @@ -926,7 +926,8 @@ hs_parse_address(const char *address, ed25519_public_key_t *key_out, } /* Decode address so we can extract needed fields. */ - if (base32_decode(decoded, sizeof(decoded), address, strlen(address)) < 0) { + if (base32_decode(decoded, sizeof(decoded), address, strlen(address)) + != sizeof(decoded)) { log_warn(LD_REND, "Service address %s can't be decoded.", escaped_safe_str(address)); goto invalid; diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c index b94dd9a481..8d286f2bad 100644 --- a/src/feature/hs/hs_service.c +++ b/src/feature/hs/hs_service.c @@ -1179,7 +1179,8 @@ parse_authorized_client(const char *client_key_str) client = tor_malloc_zero(sizeof(hs_service_authorized_client_t)); if (base32_decode((char *) client->client_pk.public_key, sizeof(client->client_pk.public_key), - pubkey_b32, strlen(pubkey_b32)) < 0) { + pubkey_b32, strlen(pubkey_b32)) != + sizeof(client->client_pk.public_key)) { log_warn(LD_REND, "Client authorization public key cannot be decoded: %s", pubkey_b32); goto err; |