106-less-tls-constraint.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Filename: 106-less-tls-constraint.txt
  2. Title: Checking fewer things during TLS handshakes
  3. Author: Nick Mathewson
  4. Created: 9-Feb-2007
  5. Status: Closed
  6. Implemented-In: 0.2.0.x
  7. Overview:
  8. This document proposes that we relax our requirements on the context of
  9. X.509 certificates during initial TLS handshakes.
  10. Motivation:
  11. Later, we want to try harder to avoid protocol fingerprinting attacks.
  12. This means that we'll need to make our connection handshake look closer
  13. to a regular HTTPS connection: one certificate on the server side and
  14. zero certificates on the client side. For now, about the best we
  15. can do is to stop requiring things during handshake that we don't
  16. actually use.
  17. What we check now, and where we check it:
  18. tor_tls_check_lifetime:
  19. peer has certificate
  20. notBefore <= now <= notAfter
  21. tor_tls_verify:
  22. peer has at least one certificate
  23. There is at least one certificate in the chain
  24. At least one of the certificates in the chain is not the one used to
  25. negotiate the connection. (The "identity cert".)
  26. The certificate _not_ used to negotiate the connection has signed the
  27. link cert
  28. tor_tls_get_peer_cert_nickname:
  29. peer has a certificate.
  30. certificate has a subjectName.
  31. subjectName has a commonName.
  32. commonName consists only of characters in LEGAL_NICKNAME_CHARACTERS. [2]
  33. tor_tls_peer_has_cert:
  34. peer has a certificate.
  35. connection_or_check_valid_handshake:
  36. tor_tls_peer_has_cert [1]
  37. tor_tls_get_peer_cert_nickname [1]
  38. tor_tls_verify [1]
  39. If nickname in cert is a known, named router, then its identity digest
  40. must be as expected.
  41. If we initiated the connection, then we got the identity digest we
  42. expected.
  43. USEFUL THINGS WE COULD DO:
  44. [1] We could just not force clients to have any certificate at all, let alone
  45. an identity certificate. Internally to the code, we could assign the
  46. identity_digest field of these or_connections to a random number, or even
  47. not add them to the identity_digest->or_conn map.
  48. [so if somebody connects with no certs, we let them. and mark them as
  49. a client and don't treat them as a server. great. -rd]
  50. [2] Instead of using a restricted nickname character set that makes our
  51. commonName structure look unlike typical SSL certificates, we could treat
  52. the nickname as extending from the start of the commonName up to but not
  53. including the first non-nickname character.
  54. Alternatively, we could stop checking commonNames entirely. We don't
  55. actually _do_ anything based on the nickname in the certificate, so
  56. there's really no harm in letting every router have any commonName it
  57. wants.
  58. [this is the better choice -rd]
  59. [agreed. -nm]
  60. REMAINING WAYS TO RECOGNIZE CLIENT->SERVER CONNECTIONS:
  61. Assuming that we removed the above requirements, we could then (in a later
  62. release) have clients not send certificates, and sometimes and started
  63. making our DNs a little less formulaic, client->server OR connections would
  64. still be recognizable by:
  65. having a two-certificate chain sent by the server
  66. using a particular set of ciphersuites
  67. traffic patterns
  68. probing the server later
  69. OTHER IMPLICATIONS:
  70. If we stop verifying the above requirements:
  71. It will be slightly (but only slightly) more common to connect to a non-Tor
  72. server running TLS, and believe that you're talking to a Tor server (until
  73. you send the first cell).
  74. It will be far easier for non-Tor SSL clients to accidentally connect to
  75. Tor servers and speak HTTPS or whatever to them.
  76. If, in a later release, we have clients not send certificates, and we make
  77. DNs less recognizable:
  78. If clients don't send certs, servers don't need to verify them: win!
  79. If we remove these restrictions, it will be easier for people to write
  80. clients to fuzz our protocol: sorta win!
  81. If clients don't send certs, they look slightly less like servers.
  82. OTHER SPEC CHANGES:
  83. When a client doesn't give us an identity, we should never extend any
  84. circuits to it (duh), and we should allow it to set circuit ID however it
  85. wants.