goto out;
ct->challenge_hash = alloc(HASH2_SIZE);
if (has_feature("sha256", ct)) {
- hash2_function((char *)crypt_buf, APC_CHALLENGE_SIZE, ct->challenge_hash);
+ hash2_function((char *)crypt_buf, APC_CHALLENGE_SIZE,
+ ct->challenge_hash);
hash2_to_asc(ct->challenge_hash, buf);
} else {
- hash_function((char *)crypt_buf, APC_CHALLENGE_SIZE, ct->challenge_hash);
+ hash_function((char *)crypt_buf, APC_CHALLENGE_SIZE,
+ ct->challenge_hash);
hash_to_asc(ct->challenge_hash, buf);
}
- ct->scc.send = sc_new(crypt_buf + APC_CHALLENGE_SIZE, SESSION_KEY_LEN);
- ct->scc.recv = sc_new(crypt_buf + APC_CHALLENGE_SIZE + SESSION_KEY_LEN,
- SESSION_KEY_LEN);
+ ct->scc.send = sc_new(crypt_buf + APC_CHALLENGE_SIZE,
+ SESSION_KEY_LEN);
+ ct->scc.recv = sc_new(crypt_buf + APC_CHALLENGE_SIZE
+ + SESSION_KEY_LEN, SESSION_KEY_LEN);
PARA_INFO_LOG("--> %s\n", buf);
ct->status = CL_RECEIVED_CHALLENGE;
return 0;
struct lls_parse_result *lpr;
int ret, ll;
struct client_task *ct;
- char *kf = NULL, *user, *errctx, *home = para_homedir();
+ char *kf = NULL, *user, *errctx;
ret = lls(lls_parse(argc, argv, cmd, &lpr, &errctx));
if (ret < 0)
kf = para_strdup(CLIENT_OPT_STRING_VAL(KEY_FILE, lpr));
else {
struct stat statbuf;
- kf = make_message("%s/.paraslash/key.%s", home, user);
+ const char *confdir = get_confdir();
+ kf = make_message("%s/key.%s", confdir, user);
if (stat(kf, &statbuf) != 0) { /* assume file does not exist */
free(kf);
- kf = make_message("%s/.ssh/id_rsa", home);
+ kf = make_message("%s/.ssh/id_rsa", confdir);
}
}
PARA_INFO_LOG("user: %s\n", user);
*ct_ptr = ct;
ret = lls_num_inputs(lpr);
out:
- free(home);
if (ret < 0) {
if (errctx)
PARA_ERROR_LOG("%s\n", errctx);