summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-18 11:35:49 -0700
committerNick Mathewson <nickm@torproject.org>2014-08-28 11:20:31 -0400
commit9b2d8c4e20a57ce849395a2135ac4e720bf99c42 (patch)
tree1e45c14f8fe94cbd8ac4f6c3a0f5af055ea0a1bc /src/or/control.c
parentcc3b04a8c1edbeb1a488e319e3c0d28acd227417 (diff)
downloadtor-9b2d8c4e20a57ce849395a2135ac4e720bf99c42.tar.gz
tor-9b2d8c4e20a57ce849395a2135ac4e720bf99c42.zip
Rename secret_to_key to secret_to_key_rfc2440
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/or/control.c b/src/or/control.c
index b3a9dd693e..08cdad4943 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -993,7 +993,8 @@ handle_control_setevents(control_connection_t *conn, uint32_t len,
/** Decode the hashed, base64'd passwords stored in <b>passwords</b>.
* Return a smartlist of acceptable passwords (unterminated strings of
- * length S2K_SPECIFIER_LEN+DIGEST_LEN) on success, or NULL on failure.
+ * length S2K_RFC2440_SPECIFIER_LEN+DIGEST_LEN) on success, or NULL on
+ * failure.
*/
smartlist_t *
decode_hashed_passwords(config_line_t *passwords)
@@ -1009,16 +1010,17 @@ decode_hashed_passwords(config_line_t *passwords)
if (!strcmpstart(hashed, "16:")) {
if (base16_decode(decoded, sizeof(decoded), hashed+3, strlen(hashed+3))<0
- || strlen(hashed+3) != (S2K_SPECIFIER_LEN+DIGEST_LEN)*2) {
+ || strlen(hashed+3) != (S2K_RFC2440_SPECIFIER_LEN+DIGEST_LEN)*2) {
goto err;
}
} else {
if (base64_decode(decoded, sizeof(decoded), hashed, strlen(hashed))
- != S2K_SPECIFIER_LEN+DIGEST_LEN) {
+ != S2K_RFC2440_SPECIFIER_LEN+DIGEST_LEN) {
goto err;
}
}
- smartlist_add(sl, tor_memdup(decoded, S2K_SPECIFIER_LEN+DIGEST_LEN));
+ smartlist_add(sl,
+ tor_memdup(decoded, S2K_RFC2440_SPECIFIER_LEN+DIGEST_LEN));
}
return sl;
@@ -1171,8 +1173,10 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
} else {
SMARTLIST_FOREACH(sl, char *, expected,
{
- secret_to_key(received,DIGEST_LEN,password,password_len,expected);
- if (tor_memeq(expected+S2K_SPECIFIER_LEN, received, DIGEST_LEN))
+ secret_to_key_rfc2440(received,DIGEST_LEN,
+ password,password_len,expected);
+ if (tor_memeq(expected + S2K_RFC2440_SPECIFIER_LEN,
+ received, DIGEST_LEN))
goto ok;
});
SMARTLIST_FOREACH(sl, char *, cp, tor_free(cp));