mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add logic in routerparse to not read overlong private keys
I am not at all sure that it is possible to trigger a bug here, but better safe than sorry.
This commit is contained in:
@@ -3132,7 +3132,7 @@ get_next_token(memarea_t *area,
|
||||
RET_ERR("Couldn't parse public key.");
|
||||
} else if (!strcmp(tok->object_type, "RSA PRIVATE KEY")) { /* private key */
|
||||
tok->key = crypto_new_pk_env();
|
||||
if (crypto_pk_read_private_key_from_string(tok->key, obstart))
|
||||
if (crypto_pk_read_private_key_from_string(tok->key, obstart, eol-obstart))
|
||||
RET_ERR("Couldn't parse private key.");
|
||||
} else { /* If it's something else, try to base64-decode it */
|
||||
int r;
|
||||
|
||||
Reference in New Issue
Block a user