Merge branch 'ticket31552_041' into maint-0.4.1

This commit is contained in:
Nick Mathewson 2019-09-17 18:54:05 -04:00
commit ab74c3560a
4 changed files with 127 additions and 12 deletions

5
changes/bug31552 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (compilation):
- Add more stub functions to fix compilation on Android with LTO, when
--disable-module-dirauth is used. Previously, these compilation
settings would make the compiler look for functions that didn't exist.
Fixes bug 31552; bugfix on 0.4.1.1-alpha.

View File

@ -11,10 +11,25 @@ int keypin_check_and_add(const uint8_t *rsa_id_digest,
const int replace_existing_entry); const int replace_existing_entry);
int keypin_check(const uint8_t *rsa_id_digest, int keypin_check(const uint8_t *rsa_id_digest,
const uint8_t *ed25519_id_key); const uint8_t *ed25519_id_key);
int keypin_open_journal(const char *fname);
int keypin_close_journal(void); int keypin_close_journal(void);
#ifdef HAVE_MODULE_DIRAUTH
int keypin_open_journal(const char *fname);
int keypin_load_journal(const char *fname); int keypin_load_journal(const char *fname);
#else
static inline int
keypin_open_journal(const char *fname)
{
(void)fname;
return 0;
}
static inline int
keypin_load_journal(const char *fname)
{
(void)fname;
return 0;
}
#endif
void keypin_clear(void); void keypin_clear(void);
int keypin_check_lone_rsa(const uint8_t *rsa_id_digest); int keypin_check_lone_rsa(const uint8_t *rsa_id_digest);
@ -44,4 +59,3 @@ MOCK_DECL(STATIC void, keypin_add_entry_to_map, (keypin_ent_t *ent));
#endif /* defined(KEYPIN_PRIVATE) */ #endif /* defined(KEYPIN_PRIVATE) */
#endif /* !defined(TOR_KEYPIN_H) */ #endif /* !defined(TOR_KEYPIN_H) */

View File

@ -12,10 +12,13 @@
#ifndef TOR_RECV_UPLOADS_H #ifndef TOR_RECV_UPLOADS_H
#define TOR_RECV_UPLOADS_H #define TOR_RECV_UPLOADS_H
int dirserv_load_fingerprint_file(void); // for was_router_added_t.
void dirserv_free_fingerprint_list(void); #include "feature/nodelist/routerlist.h"
int dirserv_add_own_fingerprint(crypto_pk_t *pk);
void dirserv_free_fingerprint_list(void);
#ifdef HAVE_MODULE_DIRAUTH
int dirserv_load_fingerprint_file(void);
enum was_router_added_t dirserv_add_multiple_descriptors( enum was_router_added_t dirserv_add_multiple_descriptors(
const char *desc, size_t desclen, const char *desc, size_t desclen,
uint8_t purpose, uint8_t purpose,
@ -25,15 +28,85 @@ enum was_router_added_t dirserv_add_descriptor(routerinfo_t *ri,
const char **msg, const char **msg,
const char *source); const char *source);
int dirserv_would_reject_router(const routerstatus_t *rs);
int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg, int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
int complain, int complain,
int *valid_out); int *valid_out);
int dirserv_add_own_fingerprint(crypto_pk_t *pk);
uint32_t dirserv_router_get_status(const routerinfo_t *router, uint32_t dirserv_router_get_status(const routerinfo_t *router,
const char **msg, const char **msg,
int severity); int severity);
void dirserv_set_node_flags_from_authoritative_status(node_t *node, void dirserv_set_node_flags_from_authoritative_status(node_t *node,
uint32_t authstatus); uint32_t authstatus);
#else
int dirserv_would_reject_router(const routerstatus_t *rs); static inline int
dirserv_load_fingerprint_file(void)
{
return 0;
}
static inline enum was_router_added_t
dirserv_add_multiple_descriptors(const char *desc, size_t desclen,
uint8_t purpose,
const char *source,
const char **msg)
{
(void)desc;
(void)desclen;
(void)purpose;
(void)source;
(void)msg;
return (enum was_router_added_t)0;
}
static inline enum was_router_added_t
dirserv_add_descriptor(routerinfo_t *ri,
const char **msg,
const char *source)
{
(void)ri;
(void)msg;
(void)source;
return (enum was_router_added_t)0;
}
static inline int
dirserv_would_reject_router(const routerstatus_t *rs)
{
(void)rs;
return 0;
}
static inline int
authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
int complain,
int *valid_out)
{
(void)ri;
(void)msg;
(void)complain;
(void)valid_out;
return 0;
}
static inline int
dirserv_add_own_fingerprint(crypto_pk_t *pk)
{
(void)pk;
return 0;
}
static inline uint32_t
dirserv_router_get_status(const routerinfo_t *router,
const char **msg,
int severity)
{
(void)router;
(void)msg;
(void)severity;
return 0;
}
static inline void
dirserv_set_node_flags_from_authoritative_status(node_t *node,
uint32_t authstatus)
{
(void)node;
(void)authstatus;
}
#endif
#endif /* !defined(TOR_RECV_UPLOADS_H) */ #endif /* !defined(TOR_RECV_UPLOADS_H) */

View File

@ -24,13 +24,36 @@
#define REACHABILITY_TEST_CYCLE_PERIOD \ #define REACHABILITY_TEST_CYCLE_PERIOD \
(REACHABILITY_TEST_INTERVAL*REACHABILITY_MODULO_PER_TEST) (REACHABILITY_TEST_INTERVAL*REACHABILITY_MODULO_PER_TEST)
void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
void dirserv_test_reachability(time_t now);
#ifdef HAVE_MODULE_DIRAUTH
int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
const routerinfo_t *ri_old);
void dirserv_orconn_tls_done(const tor_addr_t *addr, void dirserv_orconn_tls_done(const tor_addr_t *addr,
uint16_t or_port, uint16_t or_port,
const char *digest_rcvd, const char *digest_rcvd,
const struct ed25519_public_key_t *ed_id_rcvd); const struct ed25519_public_key_t *ed_id_rcvd);
int dirserv_should_launch_reachability_test(const routerinfo_t *ri, #else
const routerinfo_t *ri_old); static inline int
void dirserv_single_reachability_test(time_t now, routerinfo_t *router); dirserv_should_launch_reachability_test(const routerinfo_t *ri,
void dirserv_test_reachability(time_t now); const routerinfo_t *ri_old)
{
(void)ri;
(void)ri_old;
return 0;
}
static inline void
dirserv_orconn_tls_done(const tor_addr_t *addr,
uint16_t or_port,
const char *digest_rcvd,
const struct ed25519_public_key_t *ed_id_rcvd)
{
(void)addr;
(void)or_port;
(void)digest_rcvd;
(void)ed_id_rcvd;
}
#endif
#endif /* !defined(TOR_REACHABILITY_H) */ #endif /* !defined(TOR_REACHABILITY_H) */