version 1.243, 2019/11/14 21:27:30 |
version 1.244, 2019/11/15 02:38:07 |
|
|
#include "ssherr.h" |
#include "ssherr.h" |
#include "match.h" |
#include "match.h" |
#include "msg.h" |
#include "msg.h" |
|
#include "ssherr.h" |
#include "pathnames.h" |
#include "pathnames.h" |
#include "ssh-pkcs11.h" |
#include "ssh-pkcs11.h" |
#include "ssh-sk.h" |
#include "ssh-sk.h" |
|
|
*sigp = NULL; |
*sigp = NULL; |
*lenp = 0; |
*lenp = 0; |
|
|
|
if ((fp = sshkey_fingerprint(key, SSH_FP_HASH_DEFAULT, |
|
SSH_FP_DEFAULT)) == NULL) |
|
fatal("%s: sshkey_fingerprint failed", __func__); |
|
notifier = notify_start(0, |
|
"Confirm user presence for key %s %s", sshkey_type(key), fp); |
|
|
if (strcasecmp(provider, "internal") == 0) { |
if (strcasecmp(provider, "internal") == 0) { |
return sshsk_sign(provider, key, sigp, lenp, |
r = sshsk_sign(provider, key, sigp, lenp, |
data, datalen, compat); |
data, datalen, compat); |
|
if (r != 0) { |
|
error("%s: sshsk_sign internal: %s", |
|
__func__, ssh_err(r)); |
|
} |
|
notify_complete(notifier); |
|
return r; |
} |
} |
|
|
helper = getenv("SSH_SK_HELPER"); |
helper = getenv("SSH_SK_HELPER"); |
|
|
error("%s: send: %s", __func__, ssh_err(r)); |
error("%s: send: %s", __func__, ssh_err(r)); |
goto out; |
goto out; |
} |
} |
if ((fp = sshkey_fingerprint(key, SSH_FP_HASH_DEFAULT, |
|
SSH_FP_DEFAULT)) == NULL) |
|
fatal("%s: sshkey_fingerprint failed", __func__); |
|
notifier = notify_start(0, |
|
"Confirm user presence for key %s %s", sshkey_type(key), fp); |
|
if ((r = ssh_msg_recv(pair[0], resp)) != 0) { |
if ((r = ssh_msg_recv(pair[0], resp)) != 0) { |
error("%s: receive: %s", __func__, ssh_err(r)); |
error("%s: receive: %s", __func__, ssh_err(r)); |
goto out; |
goto out; |
} |
} |
notify_complete(notifier); |
|
notifier = NULL; |
|
if ((r = sshbuf_get_u8(resp, &version)) != 0) { |
if ((r = sshbuf_get_u8(resp, &version)) != 0) { |
error("%s: parse version: %s", __func__, ssh_err(r)); |
error("%s: parse version: %s", __func__, ssh_err(r)); |
goto out; |
goto out; |