diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-01 09:26:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-01 09:26:24 -0400 |
commit | 34a6755b94015fcbc838b46b54667899c238ac04 (patch) | |
tree | 5e904e93310020615cb0e0351e4effe05ab3d7f8 /src/or/or.h | |
parent | a9be768959c189846178723d5fe44d3b59b0d983 (diff) | |
download | tor-34a6755b94015fcbc838b46b54667899c238ac04.tar.gz tor-34a6755b94015fcbc838b46b54667899c238ac04.zip |
Fix ed25519 link certificate race on tls context rotation
Whenever we rotate our TLS context, we change our Ed25519
Signing->Link certificate. But if we've already started a TLS
connection, then we've already sent the old X509 link certificate,
so the new Ed25519 Signing->Link certificate won't match it.
To fix this, we now store a copy of the Signing->Link certificate
when we initialize the handshake state, and send that certificate
as part of our CERTS cell.
Fixes one case of bug22460; bugfix on 0.3.0.1-alpha.
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 0db9f23604..50e6e3e71b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1449,6 +1449,12 @@ typedef struct or_handshake_state_t { /* True iff we have sent a netinfo cell */ unsigned int sent_netinfo : 1; + /** The signing->ed25519 link certificate corresponding to the x509 + * certificate we used on the TLS connection (if this is a server-side + * connection). We make a copy of this here to prevent a race condition + * caused by TLS context rotation. */ + struct tor_cert_st *own_link_cert; + /** True iff we should feed outgoing cells into digest_sent and * digest_received respectively. * |