filename);
if (!auth_key_filename_is_valid(filename)) {
- log_warn(LD_REND, "The filename is invalid.");
+ log_notice(LD_REND, "Client authorization unrecognized filename %s. "
+ "File must end in .auth_private. Ignoring.",
+ filename);
continue;
}
/* If we cannot read the file, continue with the next file. */
if (!client_key_str) {
- log_warn(LD_REND, "The file cannot be read.");
+ log_warn(LD_REND, "The file %s cannot be read.", filename);
continue;
}
if (hs_parse_address(auth->onion_address, &identity_pk,
NULL, NULL) < 0) {
client_service_authorization_free(auth);
- log_warn(LD_REND, "The onion address is invalid.");
+ log_warn(LD_REND, "The onion address \"%s\" is invalid in "
+ "file %s", filename, auth->onion_address);
continue;
}
if (digest256map_get(auths, identity_pk.pubkey)) {
client_service_authorization_free(auth);
-
log_warn(LD_REND, "Duplicate authorization for the same hidden "
- "service.");
+ "service address %s.",
+ safe_str_client(auth->onion_address));
goto end;
}
log_info(LD_REND, "Loaded a client authorization key file %s.",
filename);
}
-
} SMARTLIST_FOREACH_END(filename);
/* Success. */
SPLIT_SKIP_SPACE, 0);
/* Wrong number of fields. */
if (smartlist_len(fields) != 3) {
- log_warn(LD_REND, "The file is in a wrong format.");
+ log_warn(LD_REND, "Unknown format of client authorization file.");
goto err;
}
/* Currently, the only supported auth type is "descriptor". */
if (strcmp(auth_type, "descriptor")) {
- log_warn(LD_REND, "The auth type '%s' is not supported.", auth_type);
+ log_warn(LD_REND, "Client authorization auth type '%s' not supported.",
+ auth_type);
goto err;
}
/* Currently, the only supported key type is "x25519". */
if (strcmp(key_type, "x25519")) {
- log_warn(LD_REND, "The key type '%s' is not supported.", key_type);
+ log_warn(LD_REND, "Client authorization key type '%s' not supported.",
+ key_type);
goto err;
}
if (base32_decode((char *) client->client_pk.public_key,
sizeof(client->client_pk.public_key),
pubkey_b32, strlen(pubkey_b32)) < 0) {
- log_warn(LD_REND, "The public key cannot be decoded.");
+ log_warn(LD_REND, "Client authorization public key cannot be decoded: %s",
+ pubkey_b32);
goto err;
}
filename);
if (!client_filename_is_valid(filename)) {
- log_warn(LD_REND, "The filename is invalid.");
+ log_warn(LD_REND, "Client authorization unrecognized filename %s. "
+ "File must end in .auth. Ignoring.", filename);
continue;
}
/* If we cannot read the file, continue with the next file. */
if (!client_key_str) {
- log_warn(LD_REND, "The file cannot be read.");
+ log_warn(LD_REND, "Client authorization file %s can't be read. "
+ "Corrupted or verify permission? Ignoring.",
+ client_key_file_path);
continue;
}