Skip to content
Snippets Groups Projects
Commit 71862ed7 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Fix bug in verifying directory signatures with short digests

If we got a signed digest that was shorter than the required digest
length, but longer than 20 bytes, we would accept it as long
enough.... and then immediately fail when we want to check it.

Fixes bug 2409; bug in 0.2.2.20-alpha; found by piebeer.
parent 7a446e67
No related branches found
Tags tor-0.2.2.10-alpha
No related merge requests found
o Minor bugfixes
- Resolve a bug in verifying signatures of directory objects
with digests longer than SHA1. Bugfix on 0.2.2.20-alpha;
fixes bug 2409; found by "piebeer".
......@@ -1088,7 +1088,7 @@ check_signature_token(const char *digest,
signed_digest = tor_malloc(keysize);
if (crypto_pk_public_checksig(pkey, signed_digest, keysize,
tok->object_body, tok->object_size)
< DIGEST_LEN) {
< digest_len) {
log_warn(LD_DIR, "Error reading %s: invalid signature.", doctype);
tor_free(signed_digest);
return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment