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 */
}
/* 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. */