diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-30 08:31:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-24 12:03:10 -0500 |
commit | f253aef14faf7640f94e9e76947b6a4461c3c1a4 (patch) | |
tree | d55cd09b0496498c9a97641329e3e0fa7492b347 /src/or | |
parent | 4a17c541b7a217ca5580fc01d35d2d0d620a31d1 (diff) | |
download | tor-f253aef14faf7640f94e9e76947b6a4461c3c1a4.tar.gz tor-f253aef14faf7640f94e9e76947b6a4461c3c1a4.zip |
Mechanical rename: tor_cert_t -> tor_x509_cert_t
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/channeltls.c | 26 | ||||
-rw-r--r-- | src/or/connection_or.c | 24 | ||||
-rw-r--r-- | src/or/or.h | 4 |
3 files changed, 27 insertions, 27 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index e194c1c4df..10fcb281db 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1747,9 +1747,9 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan) static void channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) { - tor_cert_t *link_cert = NULL; - tor_cert_t *id_cert = NULL; - tor_cert_t *auth_cert = NULL; + tor_x509_cert_t *link_cert = NULL; + tor_x509_cert_t *id_cert = NULL; + tor_x509_cert_t *auth_cert = NULL; uint8_t *ptr; int n_certs, i; int send_netinfo = 0; @@ -1803,7 +1803,7 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) if (cert_type == OR_CERT_TYPE_TLS_LINK || cert_type == OR_CERT_TYPE_ID_1024 || cert_type == OR_CERT_TYPE_AUTH_1024) { - tor_cert_t *cert = tor_cert_decode(ptr + 3, cert_len); + tor_x509_cert_t *cert = tor_x509_cert_decode(ptr + 3, cert_len); if (!cert) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Received undecodable certificate in CERTS cell from %s:%d", @@ -1812,24 +1812,24 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) } else { if (cert_type == OR_CERT_TYPE_TLS_LINK) { if (link_cert) { - tor_cert_free(cert); + tor_x509_cert_free(cert); ERR("Too many TLS_LINK certificates"); } link_cert = cert; } else if (cert_type == OR_CERT_TYPE_ID_1024) { if (id_cert) { - tor_cert_free(cert); + tor_x509_cert_free(cert); ERR("Too many ID_1024 certificates"); } id_cert = cert; } else if (cert_type == OR_CERT_TYPE_AUTH_1024) { if (auth_cert) { - tor_cert_free(cert); + tor_x509_cert_free(cert); ERR("Too many AUTH_1024 certificates"); } auth_cert = cert; } else { - tor_cert_free(cert); + tor_x509_cert_free(cert); } } } @@ -1864,7 +1864,7 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) chan->conn->handshake_state->authenticated = 1; { - const digests_t *id_digests = tor_cert_get_id_digests(id_cert); + const digests_t *id_digests = tor_x509_cert_get_id_digests(id_cert); crypto_pk_t *identity_rcvd; if (!id_digests) ERR("Couldn't compute digests for key in ID cert"); @@ -1929,9 +1929,9 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) } err: - tor_cert_free(id_cert); - tor_cert_free(link_cert); - tor_cert_free(auth_cert); + tor_x509_cert_free(id_cert); + tor_x509_cert_free(link_cert); + tor_x509_cert_free(auth_cert); #undef ERR } @@ -2151,7 +2151,7 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan) crypto_pk_t *identity_rcvd = tor_tls_cert_get_key(chan->conn->handshake_state->id_cert); const digests_t *id_digests = - tor_cert_get_id_digests(chan->conn->handshake_state->id_cert); + tor_x509_cert_get_id_digests(chan->conn->handshake_state->id_cert); /* This must exist; we checked key type when reading the cert. */ tor_assert(id_digests); diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 85462d899d..6c584a5c77 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -1878,8 +1878,8 @@ or_handshake_state_free(or_handshake_state_t *state) return; crypto_digest_free(state->digest_sent); crypto_digest_free(state->digest_received); - tor_cert_free(state->auth_cert); - tor_cert_free(state->id_cert); + tor_x509_cert_free(state->auth_cert); + tor_x509_cert_free(state->id_cert); memwipe(state, 0xBE, sizeof(or_handshake_state_t)); tor_free(state); } @@ -2227,7 +2227,7 @@ connection_or_send_netinfo(or_connection_t *conn) int connection_or_send_certs_cell(or_connection_t *conn) { - const tor_cert_t *link_cert = NULL, *id_cert = NULL; + const tor_x509_cert_t *link_cert = NULL, *id_cert = NULL; const uint8_t *link_encoded = NULL, *id_encoded = NULL; size_t link_len, id_len; var_cell_t *cell; @@ -2242,8 +2242,8 @@ connection_or_send_certs_cell(or_connection_t *conn) server_mode = ! conn->handshake_state->started_here; if (tor_tls_get_my_certs(server_mode, &link_cert, &id_cert) < 0) return -1; - tor_cert_get_der(link_cert, &link_encoded, &link_len); - tor_cert_get_der(id_cert, &id_encoded, &id_len); + tor_x509_cert_get_der(link_cert, &link_encoded, &link_len); + tor_x509_cert_get_der(id_cert, &id_encoded, &id_len); cell_len = 1 /* 1 byte: num certs in cell */ + 2 * ( 1 + 2 ) /* For each cert: 1 byte for type, 2 for length */ + @@ -2342,13 +2342,13 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, ptr += 8; { - const tor_cert_t *id_cert=NULL, *link_cert=NULL; + const tor_x509_cert_t *id_cert=NULL, *link_cert=NULL; const digests_t *my_digests, *their_digests; const uint8_t *my_id, *their_id, *client_id, *server_id; if (tor_tls_get_my_certs(server, &link_cert, &id_cert)) return -1; - my_digests = tor_cert_get_id_digests(id_cert); - their_digests = tor_cert_get_id_digests(conn->handshake_state->id_cert); + my_digests = tor_x509_cert_get_id_digests(id_cert); + their_digests = tor_x509_cert_get_id_digests(conn->handshake_state->id_cert); tor_assert(my_digests); tor_assert(their_digests); my_id = (uint8_t*)my_digests->d[DIGEST_SHA256]; @@ -2387,8 +2387,8 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, { /* Digest of cert used on TLS link : 32 octets. */ - const tor_cert_t *cert = NULL; - tor_cert_t *freecert = NULL; + const tor_x509_cert_t *cert = NULL; + tor_x509_cert_t *freecert = NULL; if (server) { tor_tls_get_my_certs(1, &cert, NULL); } else { @@ -2397,10 +2397,10 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, } if (!cert) return -1; - memcpy(ptr, tor_cert_get_cert_digests(cert)->d[DIGEST_SHA256], 32); + memcpy(ptr, tor_x509_cert_get_cert_digests(cert)->d[DIGEST_SHA256], 32); if (freecert) - tor_cert_free(freecert); + tor_x509_cert_free(freecert); ptr += 32; } diff --git a/src/or/or.h b/src/or/or.h index 6723f93f77..19694a081f 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1411,9 +1411,9 @@ typedef struct or_handshake_state_t { * @{ */ /** The cert for the key that's supposed to sign the AUTHENTICATE cell */ - tor_cert_t *auth_cert; + tor_x509_cert_t *auth_cert; /** A self-signed identity certificate */ - tor_cert_t *id_cert; + tor_x509_cert_t *id_cert; /**@}*/ } or_handshake_state_t; |