|
Lines 1021-1029
identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
Link Here
|
| 1021 |
alg = identity_sign_encode(id); |
1021 |
alg = identity_sign_encode(id); |
| 1022 |
|
1022 |
|
| 1023 |
/* the agent supports this key */ |
1023 |
/* the agent supports this key */ |
| 1024 |
if (id->agent_fd != -1) |
1024 |
if (id->agent_fd != -1) { |
|
|
1025 |
if ((ret = ssh_agent_sign(id->agent_fd, id->key, sigp, lenp, |
| 1026 |
data, datalen, alg, compat)) == 0) |
| 1027 |
return 0; |
| 1028 |
/* |
| 1029 |
* If the agent failed to sign with a new signature type, |
| 1030 |
* then it may be too old to support them. Fall back to |
| 1031 |
* using an older signature type. |
| 1032 |
*/ |
| 1033 |
if (strcmp(alg, key_ssh_name(id->key)) == 0) |
| 1034 |
return ret; |
| 1025 |
return ssh_agent_sign(id->agent_fd, id->key, sigp, lenp, |
1035 |
return ssh_agent_sign(id->agent_fd, id->key, sigp, lenp, |
| 1026 |
data, datalen, alg, compat); |
1036 |
data, datalen, key_ssh_name(id->key), compat); |
|
|
1037 |
} |
| 1027 |
|
1038 |
|
| 1028 |
/* |
1039 |
/* |
| 1029 |
* we have already loaded the private key or |
1040 |
* we have already loaded the private key or |