if (conn->_base.purpose == DIR_PURPOSE_UPLOAD_SIGNATURES) {
switch (status_code) {
case 200: {
- log_notice(LD_DIR,"Uploaded a signatures to dirserver %s:%d",
+ log_notice(LD_DIR,"Uploaded signature(s) to dirserver %s:%d",
conn->_base.address, conn->_base.port);
}
break;
networkstatus_check_voter_signature(target, src_voter, cert);
}
}
- /* If this signature is good, then replace and add. */
- if (src_voter->good_signature || !target_voter->signature) {
+ /* XXXX020 We want to add signatures for which we don't have the cert,
+ * pending the arrival of the cert information. But this means we need
+ * to replace them if a better one comes along, and that's not
+ * implemented yet. */
+ /* If this signature is good, then add it. */
+ if (src_voter->good_signature) {
tor_free(target_voter->signature);
target_voter->signature =
tor_memdup(src_voter->signature, src_voter->signature_len);
log_warn(LD_DIR, "Couldn't parse consensus we generated!");
goto err;
}
+ /* 'Check' our own signature, to mark it valid. */
+ networkstatus_check_consensus_signature(consensus);
+
signatures = networkstatus_get_detached_signatures(consensus);
if (!signatures) {
log_warn(LD_DIR, "Couldn't extract signatures.");
*/
test_eq(2, smartlist_len(dsig2->signatures));
+ /* Try adding to con2 twice; verify that nothing changes. */
+ test_eq(0, networkstatus_add_detached_signatures(con2, dsig1, &addition2));
+
/* Add to con. */
test_eq(2, networkstatus_add_detached_signatures(con, dsig2, &addition2));
/* Check signatures */