106-less-tls-constraint.txt 4.1 KB

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