summaryrefslogtreecommitdiff
path: root/src/or/routerkeys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r--src/or/routerkeys.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index 946c48bc08..77bbcfd49f 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -34,14 +34,18 @@ read_encrypted_secret_key(ed25519_secret_key_t *out,
r = 0;
goto done;
}
- if (strcmp(tag, ENC_KEY_TAG))
+ if (strcmp(tag, ENC_KEY_TAG)) {
+ saved_errno = EINVAL;
goto done;
+ }
while (1) {
ssize_t pwlen =
tor_getpass("Enter pasphrase for master key:", pwbuf, sizeof(pwbuf));
- if (pwlen < 0)
+ if (pwlen < 0) {
+ saved_errno = EINVAL;
goto done;
+ }
const int r = crypto_unpwbox(&secret, &secret_len,
encrypted_key, encrypted_len,