summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-05-06 16:47:03 -0400
committerNick Mathewson <nickm@torproject.org>2020-05-06 16:47:03 -0400
commitd04b708b4bd47ee8df6796f19b25f558b2b18e91 (patch)
tree3eb744174d8e923fed56b4714244b94ed70c94b9 /src
parentbbfc498e21c9854b16b0543bf3f3f4ac304711f7 (diff)
parent28f453c4764962394bf0cd3a314b2b60af7ee1b4 (diff)
downloadtor-d04b708b4bd47ee8df6796f19b25f558b2b18e91.tar.gz
tor-d04b708b4bd47ee8df6796f19b25f558b2b18e91.zip
Merge branch 'maint-0.4.1' into maint-0.4.2
Diffstat (limited to 'src')
-rw-r--r--src/core/proto/proto_socks.c5
-rw-r--r--src/ext/ed25519/donna/ed25519_tor.c4
-rw-r--r--src/feature/dirauth/keypin.c2
-rw-r--r--src/feature/relay/dns.c2
-rw-r--r--src/lib/cc/compat_compiler.h6
-rw-r--r--src/lib/crypt_ops/crypto_digest_nss.c3
-rw-r--r--src/lib/net/address.c1
7 files changed, 17 insertions, 6 deletions
diff --git a/src/core/proto/proto_socks.c b/src/core/proto/proto_socks.c
index b657a7b758..f9f8c8afc0 100644
--- a/src/core/proto/proto_socks.c
+++ b/src/core/proto/proto_socks.c
@@ -1067,7 +1067,10 @@ parse_socks_client(const uint8_t *data, size_t datalen,
log_info(LD_NET, "SOCKS 5 client: need authentication.");
*drain_out = -1;
return 2;
- /* fall through */
+ default:
+ /* This wasn't supposed to be exhaustive; there are other
+ * authentication methods too. */
+ ;
}
*reason = tor_strdup("server doesn't support any of our available "
diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c
index 7f5ab398d8..a5bb6f4e21 100644
--- a/src/ext/ed25519/donna/ed25519_tor.c
+++ b/src/ext/ed25519/donna/ed25519_tor.c
@@ -35,6 +35,9 @@
#define ED25519_FN(fn) ED25519_FN2(fn,ED25519_SUFFIX)
#include "orconfig.h"
+
+#include "lib/cc/compat_compiler.h"
+
#include "ed25519-donna.h"
#include "ed25519_donna_tor.h"
#include "ed25519-randombytes.h"
@@ -366,4 +369,3 @@ ed25519_donna_scalarmult_with_group_order(unsigned char *out,
}
#include "test-internals.c"
-
diff --git a/src/feature/dirauth/keypin.c b/src/feature/dirauth/keypin.c
index 3ca2c3ef91..316b7d6c2f 100644
--- a/src/feature/dirauth/keypin.c
+++ b/src/feature/dirauth/keypin.c
@@ -267,7 +267,7 @@ keypin_add_or_replace_entry_in_map(keypin_ent_t *ent)
}
tor_free(ent2);
r = -1;
- /* Fall through */
+ /* Note lack of return here: we fall through to the next line. */
}
keypin_add_entry_to_map(ent);
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c
index 05b97e0ae2..d9662962d2 100644
--- a/src/feature/relay/dns.c
+++ b/src/feature/relay/dns.c
@@ -546,7 +546,7 @@ send_resolved_cell,(edge_connection_t *conn, uint8_t answer_type,
break;
} else {
answer_type = RESOLVED_TYPE_ERROR;
- /* fall through. */
+ /* We let this fall through and treat it as an error. */
}
/* Falls through. */
case RESOLVED_TYPE_ERROR_TRANSIENT:
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index 3ef866ecce..d9ccabb2b3 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -50,6 +50,12 @@
#define CHECK_SCANF(formatIdx, firstArg)
#endif /* defined(__GNUC__) */
+#if defined(HAVE_ATTR_FALLTHROUGH)
+#define FALLTHROUGH __attribute__((fallthrough))
+#else
+#define FALLTHROUGH
+#endif
+
/* What GCC do we have? */
#ifdef __GNUC__
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
diff --git a/src/lib/crypt_ops/crypto_digest_nss.c b/src/lib/crypt_ops/crypto_digest_nss.c
index b73f0736fd..bc7a0fab16 100644
--- a/src/lib/crypt_ops/crypto_digest_nss.c
+++ b/src/lib/crypt_ops/crypto_digest_nss.c
@@ -87,7 +87,7 @@ library_supports_digest(digest_algorithm_t alg)
switch (alg) {
case DIGEST_SHA1: /* Fall through */
case DIGEST_SHA256: /* Fall through */
- case DIGEST_SHA512: /* Fall through */
+ case DIGEST_SHA512:
return true;
case DIGEST_SHA3_256: /* Fall through */
case DIGEST_SHA3_512: /* Fall through */
@@ -557,4 +557,3 @@ crypto_hmac_sha256(char *hmac_out,
tor_assert(ok);
}
-
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 0a2c84caf2..41017935e1 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -929,6 +929,7 @@ tor_addr_copy_tight(tor_addr_t *dest, const tor_addr_t *src)
break;
case AF_INET6:
memcpy(dest->addr.in6_addr.s6_addr, src->addr.in6_addr.s6_addr, 16);
+ break;
case AF_UNSPEC:
break;
// LCOV_EXCL_START