|
Lines 307-313
int input_gssapi_errtok(int, u_int32_t, struct ssh *);
Link Here
|
| 307 |
|
307 |
|
| 308 |
void userauth(Authctxt *, char *); |
308 |
void userauth(Authctxt *, char *); |
| 309 |
|
309 |
|
| 310 |
static int sign_and_send_pubkey(Authctxt *, Identity *); |
310 |
static int sign_and_send_pubkey(struct ssh *ssh, Authctxt *, Identity *); |
| 311 |
static void pubkey_prepare(Authctxt *); |
311 |
static void pubkey_prepare(Authctxt *); |
| 312 |
static void pubkey_cleanup(Authctxt *); |
312 |
static void pubkey_cleanup(Authctxt *); |
| 313 |
static void pubkey_reset(Authctxt *); |
313 |
static void pubkey_reset(Authctxt *); |
|
Lines 611-617
input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
Link Here
|
| 611 |
*/ |
611 |
*/ |
| 612 |
TAILQ_FOREACH_REVERSE(id, &authctxt->keys, idlist, next) { |
612 |
TAILQ_FOREACH_REVERSE(id, &authctxt->keys, idlist, next) { |
| 613 |
if (key_equal(key, id->key)) { |
613 |
if (key_equal(key, id->key)) { |
| 614 |
sent = sign_and_send_pubkey(authctxt, id); |
614 |
sent = sign_and_send_pubkey(ssh, authctxt, id); |
| 615 |
break; |
615 |
break; |
| 616 |
} |
616 |
} |
| 617 |
} |
617 |
} |
|
Lines 979-1048
input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
Link Here
|
| 979 |
} |
979 |
} |
| 980 |
|
980 |
|
| 981 |
static const char * |
981 |
static const char * |
| 982 |
key_sign_encode(const struct sshkey *key) |
982 |
key_sign_encode(struct ssh *ssh, const struct sshkey *key) |
| 983 |
{ |
983 |
{ |
| 984 |
struct ssh *ssh = active_state; |
984 |
switch (key->type) { |
| 985 |
|
985 |
case KEY_RSA: |
| 986 |
if (key->type == KEY_RSA) { |
|
|
| 987 |
switch (ssh->kex->rsa_sha2) { |
986 |
switch (ssh->kex->rsa_sha2) { |
| 988 |
case 256: |
987 |
case 256: |
| 989 |
return "rsa-sha2-256"; |
988 |
return "rsa-sha2-256"; |
| 990 |
case 512: |
989 |
case 512: |
| 991 |
return "rsa-sha2-512"; |
990 |
return "rsa-sha2-512"; |
| 992 |
} |
991 |
} |
|
|
992 |
break; |
| 993 |
case KEY_RSA_CERT: |
| 994 |
switch (ssh->kex->rsa_sha2_cert) { |
| 995 |
case 256: |
| 996 |
return "rsa-sha2-256-cert-v01@openssh.com"; |
| 997 |
case 512: |
| 998 |
return "rsa-sha2-512-cert-v01@openssh.com"; |
| 999 |
} |
| 1000 |
break; |
| 993 |
} |
1001 |
} |
| 994 |
return key_ssh_name(key); |
1002 |
return key_ssh_name(key); |
| 995 |
} |
1003 |
} |
| 996 |
|
1004 |
|
| 997 |
/* |
|
|
| 998 |
* Some agents will return ssh-rsa signatures when asked to make a |
| 999 |
* rsa-sha2-* signature. Check what they actually gave back and warn the |
| 1000 |
* user if the agent has returned an unexpected type. |
| 1001 |
*/ |
| 1002 |
static int |
| 1003 |
check_sigtype(const struct sshkey *key, const u_char *sig, size_t len) |
| 1004 |
{ |
| 1005 |
int r; |
| 1006 |
char *sigtype = NULL; |
| 1007 |
const char *alg = key_sign_encode(key); |
| 1008 |
|
| 1009 |
if ((r = sshkey_sigtype(sig, len, &sigtype)) != 0) |
| 1010 |
return r; |
| 1011 |
if (strcmp(sigtype, alg) != 0) { |
| 1012 |
logit("warning: agent returned different signature type %s " |
| 1013 |
"(expected %s)", sigtype, alg); |
| 1014 |
} |
| 1015 |
free(sigtype); |
| 1016 |
/* Incorrect signature types aren't an error ... yet */ |
| 1017 |
return 0; |
| 1018 |
} |
| 1019 |
|
| 1020 |
static int |
1005 |
static int |
| 1021 |
identity_sign(struct identity *id, u_char **sigp, size_t *lenp, |
1006 |
identity_sign(struct identity *id, u_char **sigp, size_t *lenp, |
| 1022 |
const u_char *data, size_t datalen, u_int compat) |
1007 |
const u_char *data, size_t datalen, u_int compat, const char *alg) |
| 1023 |
{ |
1008 |
{ |
| 1024 |
struct sshkey *prv; |
1009 |
struct sshkey *prv; |
| 1025 |
int r; |
1010 |
int r; |
| 1026 |
|
1011 |
|
| 1027 |
/* the agent supports this key */ |
1012 |
/* The agent supports this key. */ |
| 1028 |
if (id->key != NULL && id->agent_fd != -1) { |
1013 |
if (id->key != NULL && id->agent_fd != -1) { |
| 1029 |
if ((r = ssh_agent_sign(id->agent_fd, id->key, sigp, lenp, |
1014 |
return ssh_agent_sign(id->agent_fd, id->key, sigp, lenp, |
| 1030 |
data, datalen, key_sign_encode(id->key), compat)) != 0 || |
1015 |
data, datalen, alg, compat); |
| 1031 |
(r = check_sigtype(id->key, *sigp, *lenp)) != 0) |
|
|
| 1032 |
return r; |
| 1033 |
return 0; |
| 1034 |
} |
1016 |
} |
| 1035 |
|
1017 |
|
| 1036 |
/* |
1018 |
/* |
| 1037 |
* we have already loaded the private key or |
1019 |
* We have already loaded the private key or the private key is |
| 1038 |
* the private key is stored in external hardware |
1020 |
* stored in external hardware. |
| 1039 |
*/ |
1021 |
*/ |
| 1040 |
if (id->key != NULL && |
1022 |
if (id->key != NULL && |
| 1041 |
(id->isprivate || (id->key->flags & SSHKEY_FLAG_EXT))) |
1023 |
(id->isprivate || (id->key->flags & SSHKEY_FLAG_EXT))) { |
| 1042 |
return (sshkey_sign(id->key, sigp, lenp, data, datalen, |
1024 |
if ((r = sshkey_sign(id->key, sigp, lenp, data, datalen, |
| 1043 |
key_sign_encode(id->key), compat)); |
1025 |
alg, compat)) != 0) |
|
|
1026 |
return r; |
| 1027 |
/* |
| 1028 |
* PKCS#11 tokens may not support all signature algorithms, |
| 1029 |
* so check what we get back. |
| 1030 |
*/ |
| 1031 |
if ((r = sshkey_check_sigtype(*sigp, *lenp, alg)) != 0) |
| 1032 |
return r; |
| 1033 |
return 0; |
| 1034 |
} |
| 1044 |
|
1035 |
|
| 1045 |
/* load the private key from the file */ |
1036 |
/* Load the private key from the file. */ |
| 1046 |
if ((prv = load_identity_file(id)) == NULL) |
1037 |
if ((prv = load_identity_file(id)) == NULL) |
| 1047 |
return SSH_ERR_KEY_NOT_FOUND; |
1038 |
return SSH_ERR_KEY_NOT_FOUND; |
| 1048 |
if (id->key != NULL && !sshkey_equal_public(prv, id->key)) { |
1039 |
if (id->key != NULL && !sshkey_equal_public(prv, id->key)) { |
|
Lines 1050-1057
identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
Link Here
|
| 1050 |
__func__, id->filename); |
1041 |
__func__, id->filename); |
| 1051 |
return SSH_ERR_KEY_NOT_FOUND; |
1042 |
return SSH_ERR_KEY_NOT_FOUND; |
| 1052 |
} |
1043 |
} |
| 1053 |
r = sshkey_sign(prv, sigp, lenp, data, datalen, |
1044 |
r = sshkey_sign(prv, sigp, lenp, data, datalen, alg, compat); |
| 1054 |
key_sign_encode(prv), compat); |
|
|
| 1055 |
sshkey_free(prv); |
1045 |
sshkey_free(prv); |
| 1056 |
return r; |
1046 |
return r; |
| 1057 |
} |
1047 |
} |
|
Lines 1076-1132
id_filename_matches(Identity *id, Identity *private_id)
Link Here
|
| 1076 |
} |
1066 |
} |
| 1077 |
|
1067 |
|
| 1078 |
static int |
1068 |
static int |
| 1079 |
sign_and_send_pubkey(Authctxt *authctxt, Identity *id) |
1069 |
sign_and_send_pubkey(struct ssh *ssh, Authctxt *authctxt, Identity *id) |
| 1080 |
{ |
1070 |
{ |
| 1081 |
Buffer b; |
1071 |
struct sshbuf *b = NULL; |
| 1082 |
Identity *private_id; |
1072 |
Identity *private_id, *sign_id = NULL; |
| 1083 |
u_char *blob, *signature; |
1073 |
u_char *signature = NULL; |
| 1084 |
size_t slen; |
1074 |
size_t slen = 0, skip = 0; |
| 1085 |
u_int bloblen, skip = 0; |
1075 |
int r, fallback_sigtype, sent = 0; |
| 1086 |
int matched, ret = -1, have_sig = 1; |
1076 |
char *fp = NULL; |
| 1087 |
char *fp; |
1077 |
const char *alg, *loc = ""; |
| 1088 |
|
1078 |
|
| 1089 |
if ((fp = sshkey_fingerprint(id->key, options.fingerprint_hash, |
1079 |
if ((fp = sshkey_fingerprint(id->key, options.fingerprint_hash, |
| 1090 |
SSH_FP_DEFAULT)) == NULL) |
1080 |
SSH_FP_DEFAULT)) == NULL) |
| 1091 |
return 0; |
1081 |
return 0; |
| 1092 |
debug3("%s: %s %s", __func__, key_type(id->key), fp); |
|
|
| 1093 |
free(fp); |
| 1094 |
|
1082 |
|
| 1095 |
if (key_to_blob(id->key, &blob, &bloblen) == 0) { |
1083 |
debug3("%s: %s %s", __func__, sshkey_type(id->key), fp); |
| 1096 |
/* we cannot handle this key */ |
|
|
| 1097 |
debug3("sign_and_send_pubkey: cannot handle key"); |
| 1098 |
return 0; |
| 1099 |
} |
| 1100 |
/* data to be signed */ |
| 1101 |
buffer_init(&b); |
| 1102 |
if (datafellows & SSH_OLD_SESSIONID) { |
| 1103 |
buffer_append(&b, session_id2, session_id2_len); |
| 1104 |
skip = session_id2_len; |
| 1105 |
} else { |
| 1106 |
buffer_put_string(&b, session_id2, session_id2_len); |
| 1107 |
skip = buffer_len(&b); |
| 1108 |
} |
| 1109 |
buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST); |
| 1110 |
buffer_put_cstring(&b, authctxt->server_user); |
| 1111 |
buffer_put_cstring(&b, authctxt->service); |
| 1112 |
buffer_put_cstring(&b, authctxt->method->name); |
| 1113 |
buffer_put_char(&b, have_sig); |
| 1114 |
buffer_put_cstring(&b, key_sign_encode(id->key)); |
| 1115 |
buffer_put_string(&b, blob, bloblen); |
| 1116 |
|
1084 |
|
| 1117 |
/* |
1085 |
/* |
| 1118 |
* If the key is an certificate, try to find a matching private key |
1086 |
* If the key is an certificate, try to find a matching private key |
| 1119 |
* and use it to complete the signature. |
1087 |
* and use it to complete the signature. |
| 1120 |
* If no such private key exists, fall back to trying the certificate |
1088 |
* If no such private key exists, fall back to trying the certificate |
| 1121 |
* key itself in case it has a private half already loaded. |
1089 |
* key itself in case it has a private half already loaded. |
|
|
1090 |
* This will try to set sign_id to the private key that will perform |
| 1091 |
* the signature. |
| 1122 |
*/ |
1092 |
*/ |
| 1123 |
if (key_is_cert(id->key)) { |
1093 |
if (sshkey_is_cert(id->key)) { |
| 1124 |
matched = 0; |
|
|
| 1125 |
TAILQ_FOREACH(private_id, &authctxt->keys, next) { |
1094 |
TAILQ_FOREACH(private_id, &authctxt->keys, next) { |
| 1126 |
if (sshkey_equal_public(id->key, private_id->key) && |
1095 |
if (sshkey_equal_public(id->key, private_id->key) && |
| 1127 |
id->key->type != private_id->key->type) { |
1096 |
id->key->type != private_id->key->type) { |
| 1128 |
id = private_id; |
1097 |
sign_id = private_id; |
| 1129 |
matched = 1; |
|
|
| 1130 |
break; |
1098 |
break; |
| 1131 |
} |
1099 |
} |
| 1132 |
} |
1100 |
} |
|
Lines 1137-1154
sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
Link Here
|
| 1137 |
* of keeping just a private key file and public |
1105 |
* of keeping just a private key file and public |
| 1138 |
* certificate on disk. |
1106 |
* certificate on disk. |
| 1139 |
*/ |
1107 |
*/ |
| 1140 |
if (!matched && !id->isprivate && id->agent_fd == -1 && |
1108 |
if (sign_id == NULL && |
|
|
1109 |
!id->isprivate && id->agent_fd == -1 && |
| 1141 |
(id->key->flags & SSHKEY_FLAG_EXT) == 0) { |
1110 |
(id->key->flags & SSHKEY_FLAG_EXT) == 0) { |
| 1142 |
TAILQ_FOREACH(private_id, &authctxt->keys, next) { |
1111 |
TAILQ_FOREACH(private_id, &authctxt->keys, next) { |
| 1143 |
if (private_id->key == NULL && |
1112 |
if (private_id->key == NULL && |
| 1144 |
id_filename_matches(id, private_id)) { |
1113 |
id_filename_matches(id, private_id)) { |
| 1145 |
id = private_id; |
1114 |
sign_id = private_id; |
| 1146 |
matched = 1; |
|
|
| 1147 |
break; |
1115 |
break; |
| 1148 |
} |
1116 |
} |
| 1149 |
} |
1117 |
} |
| 1150 |
} |
1118 |
} |
| 1151 |
if (matched) { |
1119 |
if (sign_id != NULL) { |
| 1152 |
debug2("%s: using private key \"%s\"%s for " |
1120 |
debug2("%s: using private key \"%s\"%s for " |
| 1153 |
"certificate", __func__, id->filename, |
1121 |
"certificate", __func__, id->filename, |
| 1154 |
id->agent_fd != -1 ? " from agent" : ""); |
1122 |
id->agent_fd != -1 ? " from agent" : ""); |
|
Lines 1158-1198
sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
Link Here
|
| 1158 |
} |
1126 |
} |
| 1159 |
} |
1127 |
} |
| 1160 |
|
1128 |
|
| 1161 |
/* generate signature */ |
1129 |
/* |
| 1162 |
ret = identity_sign(id, &signature, &slen, |
1130 |
* If the above didn't select another identity to do the signing |
| 1163 |
buffer_ptr(&b), buffer_len(&b), datafellows); |
1131 |
* then default to the one we started with. |
| 1164 |
if (ret != 0) { |
1132 |
*/ |
| 1165 |
if (ret != SSH_ERR_KEY_NOT_FOUND) |
1133 |
if (sign_id == NULL) |
| 1166 |
error("%s: signing failed: %s", __func__, ssh_err(ret)); |
1134 |
sign_id = id; |
| 1167 |
free(blob); |
1135 |
|
| 1168 |
buffer_free(&b); |
1136 |
/* assemble and sign data */ |
| 1169 |
return 0; |
1137 |
for (fallback_sigtype = 0; fallback_sigtype <= 1; fallback_sigtype++) { |
|
|
1138 |
slen = 0; |
| 1139 |
signature = NULL; |
| 1140 |
alg = fallback_sigtype ? |
| 1141 |
sshkey_ssh_name(id->key) : key_sign_encode(ssh, id->key); |
| 1142 |
|
| 1143 |
sshbuf_free(b); |
| 1144 |
if ((b = sshbuf_new()) == NULL) |
| 1145 |
fatal("%s: sshbuf_new failed", __func__); |
| 1146 |
if (datafellows & SSH_OLD_SESSIONID) { |
| 1147 |
if ((r = sshbuf_put(b, session_id2, |
| 1148 |
session_id2_len)) != 0) { |
| 1149 |
fatal("%s: sshbuf_put: %s", |
| 1150 |
__func__, ssh_err(r)); |
| 1151 |
} |
| 1152 |
} else { |
| 1153 |
if ((r = sshbuf_put_string(b, session_id2, |
| 1154 |
session_id2_len)) != 0) { |
| 1155 |
fatal("%s: sshbuf_put_string: %s", |
| 1156 |
__func__, ssh_err(r)); |
| 1157 |
} |
| 1158 |
} |
| 1159 |
skip = buffer_len(b); |
| 1160 |
if ((r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
| 1161 |
(r = sshbuf_put_cstring(b, authctxt->server_user)) != 0 || |
| 1162 |
(r = sshbuf_put_cstring(b, authctxt->service)) != 0 || |
| 1163 |
(r = sshbuf_put_cstring(b, authctxt->method->name)) != 0 || |
| 1164 |
(r = sshbuf_put_u8(b, 1)) != 0 || |
| 1165 |
(r = sshbuf_put_cstring(b, alg)) != 0 || |
| 1166 |
(r = sshkey_puts(id->key, b)) != 0) { |
| 1167 |
fatal("%s: assemble signed data: %s", |
| 1168 |
__func__, ssh_err(r)); |
| 1169 |
} |
| 1170 |
|
| 1171 |
/* generate signature */ |
| 1172 |
r = identity_sign(sign_id, &signature, &slen, |
| 1173 |
sshbuf_ptr(b), sshbuf_len(b), datafellows, alg); |
| 1174 |
if (r == 0) |
| 1175 |
break; |
| 1176 |
else if (r == SSH_ERR_KEY_NOT_FOUND) |
| 1177 |
goto out; /* soft failure */ |
| 1178 |
else if (r == SSH_ERR_SIGN_ALG_UNSUPPORTED && |
| 1179 |
!fallback_sigtype) { |
| 1180 |
if (sign_id->agent_fd != -1) |
| 1181 |
loc = "agent "; |
| 1182 |
else if ((sign_id->key->flags & SSHKEY_FLAG_EXT) != 0) |
| 1183 |
loc = "token "; |
| 1184 |
logit("%skey %s %s returned incorrect signature type", |
| 1185 |
loc, sshkey_type(id->key), fp); |
| 1186 |
continue; |
| 1187 |
} |
| 1188 |
error("%s: signing failed: %s", __func__, ssh_err(r)); |
| 1189 |
goto out; |
| 1170 |
} |
1190 |
} |
| 1171 |
#ifdef DEBUG_PK |
1191 |
if (slen == 0 || signature == NULL) /* shouldn't happen */ |
| 1172 |
buffer_dump(&b); |
1192 |
fatal("%s: no signature", __func__); |
| 1173 |
#endif |
|
|
| 1174 |
free(blob); |
| 1175 |
|
1193 |
|
| 1176 |
/* append signature */ |
1194 |
/* append signature */ |
| 1177 |
buffer_put_string(&b, signature, slen); |
1195 |
if ((r = sshbuf_put_string(b, signature, slen)) != 0) |
| 1178 |
free(signature); |
1196 |
fatal("%s: append signature: %s", __func__, ssh_err(r)); |
| 1179 |
|
1197 |
|
|
|
1198 |
#ifdef DEBUG_PK |
| 1199 |
sshbuf_dump(b, stderr); |
| 1200 |
#endif |
| 1180 |
/* skip session id and packet type */ |
1201 |
/* skip session id and packet type */ |
| 1181 |
if (buffer_len(&b) < skip + 1) |
1202 |
if ((r = sshbuf_consume(b, skip + 1)) != 0) |
| 1182 |
fatal("userauth_pubkey: internal error"); |
1203 |
fatal("%s: consume: %s", __func__, ssh_err(r)); |
| 1183 |
buffer_consume(&b, skip + 1); |
|
|
| 1184 |
|
1204 |
|
| 1185 |
/* put remaining data from buffer into packet */ |
1205 |
/* put remaining data from buffer into packet */ |
| 1186 |
packet_start(SSH2_MSG_USERAUTH_REQUEST); |
1206 |
if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
| 1187 |
packet_put_raw(buffer_ptr(&b), buffer_len(&b)); |
1207 |
(r = sshpkt_putb(ssh, b)) != 0 || |
| 1188 |
buffer_free(&b); |
1208 |
(r = sshpkt_send(ssh)) != 0) |
| 1189 |
packet_send(); |
1209 |
fatal("%s: enqueue request: %s", __func__, ssh_err(r)); |
| 1190 |
|
1210 |
|
| 1191 |
return 1; |
1211 |
/* success */ |
|
|
1212 |
sent = 1; |
| 1213 |
|
| 1214 |
out: |
| 1215 |
free(fp); |
| 1216 |
sshbuf_free(b); |
| 1217 |
freezero(signature, slen); |
| 1218 |
return sent; |
| 1192 |
} |
1219 |
} |
| 1193 |
|
1220 |
|
| 1194 |
static int |
1221 |
static int |
| 1195 |
send_pubkey_test(Authctxt *authctxt, Identity *id) |
1222 |
send_pubkey_test(struct ssh *ssh, Authctxt *authctxt, Identity *id) |
| 1196 |
{ |
1223 |
{ |
| 1197 |
u_char *blob; |
1224 |
u_char *blob; |
| 1198 |
u_int bloblen, have_sig = 0; |
1225 |
u_int bloblen, have_sig = 0; |
|
Lines 1212-1218
send_pubkey_test(Authctxt *authctxt, Identity *id)
Link Here
|
| 1212 |
packet_put_cstring(authctxt->service); |
1239 |
packet_put_cstring(authctxt->service); |
| 1213 |
packet_put_cstring(authctxt->method->name); |
1240 |
packet_put_cstring(authctxt->method->name); |
| 1214 |
packet_put_char(have_sig); |
1241 |
packet_put_char(have_sig); |
| 1215 |
packet_put_cstring(key_sign_encode(id->key)); |
1242 |
packet_put_cstring(key_sign_encode(ssh, id->key)); |
| 1216 |
packet_put_string(blob, bloblen); |
1243 |
packet_put_string(blob, bloblen); |
| 1217 |
free(blob); |
1244 |
free(blob); |
| 1218 |
packet_send(); |
1245 |
packet_send(); |
|
Lines 1469-1474
try_identity(Identity *id)
Link Here
|
| 1469 |
int |
1496 |
int |
| 1470 |
userauth_pubkey(Authctxt *authctxt) |
1497 |
userauth_pubkey(Authctxt *authctxt) |
| 1471 |
{ |
1498 |
{ |
|
|
1499 |
struct ssh *ssh = active_state; /* XXX */ |
| 1472 |
Identity *id; |
1500 |
Identity *id; |
| 1473 |
int sent = 0; |
1501 |
int sent = 0; |
| 1474 |
char *fp; |
1502 |
char *fp; |
|
Lines 1496-1502
userauth_pubkey(Authctxt *authctxt)
Link Here
|
| 1496 |
debug("Offering public key: %s %s %s", |
1524 |
debug("Offering public key: %s %s %s", |
| 1497 |
sshkey_type(id->key), fp, id->filename); |
1525 |
sshkey_type(id->key), fp, id->filename); |
| 1498 |
free(fp); |
1526 |
free(fp); |
| 1499 |
sent = send_pubkey_test(authctxt, id); |
1527 |
sent = send_pubkey_test(ssh, authctxt, id); |
| 1500 |
} |
1528 |
} |
| 1501 |
} else { |
1529 |
} else { |
| 1502 |
debug("Trying private key: %s", id->filename); |
1530 |
debug("Trying private key: %s", id->filename); |
|
Lines 1504-1510
userauth_pubkey(Authctxt *authctxt)
Link Here
|
| 1504 |
if (id->key != NULL) { |
1532 |
if (id->key != NULL) { |
| 1505 |
if (try_identity(id)) { |
1533 |
if (try_identity(id)) { |
| 1506 |
id->isprivate = 1; |
1534 |
id->isprivate = 1; |
| 1507 |
sent = sign_and_send_pubkey( |
1535 |
sent = sign_and_send_pubkey(ssh, |
| 1508 |
authctxt, id); |
1536 |
authctxt, id); |
| 1509 |
} |
1537 |
} |
| 1510 |
key_free(id->key); |
1538 |
key_free(id->key); |
|
Lines 1725-1731
ssh_keysign(struct sshkey *key, u_char **sigp, size_t *lenp,
Link Here
|
| 1725 |
int |
1753 |
int |
| 1726 |
userauth_hostbased(Authctxt *authctxt) |
1754 |
userauth_hostbased(Authctxt *authctxt) |
| 1727 |
{ |
1755 |
{ |
| 1728 |
struct ssh *ssh = active_state; |
1756 |
struct ssh *ssh = active_state; /* XXX */ |
| 1729 |
struct sshkey *private = NULL; |
1757 |
struct sshkey *private = NULL; |
| 1730 |
struct sshbuf *b = NULL; |
1758 |
struct sshbuf *b = NULL; |
| 1731 |
u_char *sig = NULL, *keyblob = NULL; |
1759 |
u_char *sig = NULL, *keyblob = NULL; |