tor_cert_t *ed_cert = tor_cert_parse(cert_body, cert_len);
if (!ed_cert) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received undecodable Ed certificate in CERTS cell from %s:%d",
+ "Received undecodable Ed certificate "
+ "in CERTS cell from %s:%d",
safe_str(chan->conn->base_.address),
chan->conn->base_.port);
} else {
chan->conn->handshake_state->authenticated_rsa = 1;
chan->conn->handshake_state->digest_received_data = 0;
{
- crypto_pk_t *identity_rcvd =
- tor_tls_cert_get_key(chan->conn->handshake_state->certs->id_cert);
- const common_digests_t *id_digests =
- tor_x509_cert_get_id_digests(chan->conn->handshake_state->certs->id_cert);
+ tor_x509_cert_t *id_cert = chan->conn->handshake_state->certs->id_cert;
+ crypto_pk_t *identity_rcvd = tor_tls_cert_get_key(id_cert);
+ const common_digests_t *id_digests = tor_x509_cert_get_id_digests(id_cert);
const ed25519_public_key_t *ed_identity_received = NULL;
if (! sig_is_rsa) {
{
channel_t *chan;
-
chan = channel_connect(addr, port, id_digest,
NULL // XXXX Ed25519 id.
);
ssize_t len2 = auth1_parse(&tmp, out, len, ctx);
if (!tmp) {
/* LCOV_EXCL_START */
- log_warn(LD_BUG, "Unable to parse signed part of AUTH1 data that we just "
- "encoded");
+ log_warn(LD_BUG, "Unable to parse signed part of AUTH1 data that "
+ "we just encoded");
goto err;
/* LCOV_EXCL_STOP */
}
* authchallenge_type_is_better().
*/
-
-
-
-
/** The length of the part of the AUTHENTICATE cell body that the client and
* server can generate independently (when using RSA_SHA256_TLSSECRET). It
* contains everything except the client's timestamp, the client's randomly
#undef EXPIRES_SOON
#ifdef TOR_UNIT_TESTS
-/* Helper for unit tests: populate the ed25519 keys without saving or loading */
+/* Helper for unit tests: populate the ed25519 keys without saving or
+ * loading */
void
init_mock_ed_keys(const crypto_pk_t *rsa_identity_key)
{
return 1;
}
-
/**
* Check the Ed certificates and/or the RSA certificates, as appropriate. If
* we obtained an Ed25519 identity, set *ed_id_out. If we obtained an RSA
*rsa_id_out = tor_x509_cert_get_id_digests(certs->id_cert);
}
}
-
}
+
REENCODE();
})
-
static void
test_link_handshake_send_authchallenge(void *arg)
{
require_failure_message = "It had a nonzero circuit ID";
d->cell->circ_id = 1337)
-
static int
mock_get_tlssecrets(tor_tls_t *tls, uint8_t *secrets_out)
{
uint8_t sig[128];
uint8_t digest[32];
tt_int_op(auth1_getlen_sig(auth1), >, 120);
- auth_pubkey = tor_tls_cert_get_key(d->c2->handshake_state->certs->auth_cert);
+ auth_pubkey = tor_tls_cert_get_key(
+ d->c2->handshake_state->certs->auth_cert);
int n = crypto_pk_public_checksig(
auth_pubkey,
(char*)sig, sizeof(sig), (char*)auth1_getarray_sig(auth1),
crypto_pk_free(onion_key);
}
-
static void
test_routerkeys_rsa_ed_crosscert(void *arg)
{
crypto_pk_generate_key_with_bits__get_cached);
#endif
}
+