]> git.ipfire.org Git - thirdparty/tor.git/commit
Give tor_cert_get_id_digests() fail-fast behavior
authorNick Mathewson <nickm@torproject.org>
Wed, 5 Oct 2011 14:33:39 +0000 (10:33 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 11 Oct 2011 03:14:31 +0000 (23:14 -0400)
commite56d7a3809611e85b48474f27b3feb461e82e109
treedaa71e51c83b82649ac51de7b3cde958d5e78467
parent40f0d111c2263b44d30d47a292b3bb9ef3a01a08
Give tor_cert_get_id_digests() fail-fast behavior

Right now we can take the digests only of an RSA key, and only expect to
take the digests of an RSA key.  The old tor_cert_get_id_digests() would
return a good set of digests for an RSA key, and an all-zero one for a
non-RSA key.  This behavior is too error-prone: it carries the risk that
we will someday check two non-RSA keys for equality and conclude that
they must be equal because they both have the same (zero) "digest".

Instead, let's have tor_cert_get_id_digests() return NULL for keys we
can't handle, and make its callers explicitly test for NULL.
src/common/tortls.c
src/or/command.c
src/or/connection_or.c