mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Require that certain public keys have public exponent 65537
This commit is contained in:
parent
d2629f78a0
commit
987190c2bc
5
changes/check-public-key-exponents
Normal file
5
changes/check-public-key-exponents
Normal file
@ -0,0 +1,5 @@
|
||||
o Minor bugfixes:
|
||||
- Require that introduction point keys and onion keys have public
|
||||
exponent 65537. Bugfix on 0.2.0.10-alpha.
|
||||
|
||||
|
@ -1326,6 +1326,11 @@ router_parse_entry_from_string(const char *s, const char *end,
|
||||
goto err;
|
||||
|
||||
tok = find_by_keyword(tokens, K_ONION_KEY);
|
||||
if (!crypto_pk_check_key_public_exponent(tok->key)) {
|
||||
log_warn(LD_DIR,
|
||||
"Relay's onion key had invalid exponent.");
|
||||
goto err;
|
||||
}
|
||||
router->onion_pkey = tok->key;
|
||||
tok->key = NULL; /* Prevent free */
|
||||
|
||||
@ -3971,10 +3976,22 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
|
||||
}
|
||||
/* Parse onion key. */
|
||||
tok = find_by_keyword(tokens, R_IPO_ONION_KEY);
|
||||
if (!crypto_pk_check_key_public_exponent(tok->key)) {
|
||||
log_warn(LD_REND,
|
||||
"Introduction point's onion key had invalid exponent.");
|
||||
rend_intro_point_free(intro);
|
||||
goto err;
|
||||
}
|
||||
info->onion_key = tok->key;
|
||||
tok->key = NULL; /* Prevent free */
|
||||
/* Parse service key. */
|
||||
tok = find_by_keyword(tokens, R_IPO_SERVICE_KEY);
|
||||
if (!crypto_pk_check_key_public_exponent(tok->key)) {
|
||||
log_warn(LD_REND,
|
||||
"Introduction point key had invalid exponent.");
|
||||
rend_intro_point_free(intro);
|
||||
goto err;
|
||||
}
|
||||
intro->intro_key = tok->key;
|
||||
tok->key = NULL; /* Prevent free */
|
||||
/* Add extend info to list of introduction points. */
|
||||
|
Loading…
Reference in New Issue
Block a user