mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
fix some bool logic
svn:r2075
This commit is contained in:
parent
e547ab293b
commit
84b8f8e04a
@ -245,7 +245,7 @@ int connection_tls_continue_handshake(connection_t *conn) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int digest_is_nonzero(const char *id) {
|
static int digest_is_zero(const char *id) {
|
||||||
char ZERO_DIGEST[DIGEST_LEN];
|
char ZERO_DIGEST[DIGEST_LEN];
|
||||||
memset(ZERO_DIGEST, 0, DIGEST_LEN);
|
memset(ZERO_DIGEST, 0, DIGEST_LEN);
|
||||||
return !memcmp(ZERO_DIGEST, id, DIGEST_LEN);
|
return !memcmp(ZERO_DIGEST, id, DIGEST_LEN);
|
||||||
@ -315,7 +315,7 @@ connection_tls_finish_handshake(connection_t *conn) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (digest_is_nonzero(conn->identity_digest)) {
|
if (!digest_is_zero(conn->identity_digest)) {
|
||||||
/* I initiated this connection. */
|
/* I initiated this connection. */
|
||||||
if (strcasecmp(conn->nickname, nickname)) {
|
if (strcasecmp(conn->nickname, nickname)) {
|
||||||
log_fn(options.DirPort ? LOG_WARN : LOG_INFO,
|
log_fn(options.DirPort ? LOG_WARN : LOG_INFO,
|
||||||
|
Loading…
Reference in New Issue
Block a user