|
Lines 315-324
int input_gssapi_errtok(int, u_int32_t, void *);
Link Here
|
| 315 |
|
315 |
|
| 316 |
void userauth(Authctxt *, char *); |
316 |
void userauth(Authctxt *, char *); |
| 317 |
|
317 |
|
| 318 |
static int sign_and_send_pubkey(Authctxt *, Identity *); |
318 |
static int sign_and_send_pubkey(Authctxt *, const Identity *); |
| 319 |
static void pubkey_prepare(Authctxt *); |
319 |
static void pubkey_prepare(Authctxt *); |
| 320 |
static void pubkey_cleanup(Authctxt *); |
320 |
static void pubkey_cleanup(Authctxt *); |
| 321 |
static Key *load_identity_file(Identity *); |
321 |
static void pubkey_reset(Authctxt *); |
|
|
322 |
static Key *load_identity_file(const Identity *); |
| 322 |
|
323 |
|
| 323 |
static Authmethod *authmethod_get(char *authlist); |
324 |
static Authmethod *authmethod_get(char *authlist); |
| 324 |
static Authmethod *authmethod_lookup(const char *name); |
325 |
static Authmethod *authmethod_lookup(const char *name); |
|
Lines 560-567
input_userauth_failure(int type, u_int32_t seq, void *ctxt)
Link Here
|
| 560 |
if (partial != 0) { |
561 |
if (partial != 0) { |
| 561 |
verbose("Authenticated with partial success."); |
562 |
verbose("Authenticated with partial success."); |
| 562 |
/* reset state */ |
563 |
/* reset state */ |
| 563 |
pubkey_cleanup(authctxt); |
564 |
pubkey_reset(authctxt); |
| 564 |
pubkey_prepare(authctxt); |
|
|
| 565 |
} |
565 |
} |
| 566 |
debug("Authentications that can continue: %s", authlist); |
566 |
debug("Authentications that can continue: %s", authlist); |
| 567 |
|
567 |
|
|
Lines 996-1002
input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
Link Here
|
| 996 |
} |
996 |
} |
| 997 |
|
997 |
|
| 998 |
static const char * |
998 |
static const char * |
| 999 |
identity_sign_encode(struct identity *id) |
999 |
identity_sign_encode(const struct identity *id) |
| 1000 |
{ |
1000 |
{ |
| 1001 |
struct ssh *ssh = active_state; |
1001 |
struct ssh *ssh = active_state; |
| 1002 |
|
1002 |
|
|
Lines 1012-1018
identity_sign_encode(struct identity *id)
Link Here
|
| 1012 |
} |
1012 |
} |
| 1013 |
|
1013 |
|
| 1014 |
static int |
1014 |
static int |
| 1015 |
identity_sign(struct identity *id, u_char **sigp, size_t *lenp, |
1015 |
identity_sign(const struct identity *id, u_char **sigp, size_t *lenp, |
| 1016 |
const u_char *data, size_t datalen, u_int compat) |
1016 |
const u_char *data, size_t datalen, u_int compat) |
| 1017 |
{ |
1017 |
{ |
| 1018 |
Key *prv; |
1018 |
Key *prv; |
|
Lines 1042-1048
identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
Link Here
|
| 1042 |
} |
1042 |
} |
| 1043 |
|
1043 |
|
| 1044 |
static int |
1044 |
static int |
| 1045 |
sign_and_send_pubkey(Authctxt *authctxt, Identity *id) |
1045 |
sign_and_send_pubkey(Authctxt *authctxt, const Identity *id) |
| 1046 |
{ |
1046 |
{ |
| 1047 |
Buffer b; |
1047 |
Buffer b; |
| 1048 |
Identity *private_id; |
1048 |
Identity *private_id; |
|
Lines 1160-1166
sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
Link Here
|
| 1160 |
} |
1160 |
} |
| 1161 |
|
1161 |
|
| 1162 |
static int |
1162 |
static int |
| 1163 |
send_pubkey_test(Authctxt *authctxt, Identity *id) |
1163 |
send_pubkey_test(Authctxt *authctxt, const Identity *id) |
| 1164 |
{ |
1164 |
{ |
| 1165 |
u_char *blob; |
1165 |
u_char *blob; |
| 1166 |
u_int bloblen, have_sig = 0; |
1166 |
u_int bloblen, have_sig = 0; |
|
Lines 1189-1195
send_pubkey_test(Authctxt *authctxt, Identity *id)
Link Here
|
| 1189 |
} |
1189 |
} |
| 1190 |
|
1190 |
|
| 1191 |
static Key * |
1191 |
static Key * |
| 1192 |
load_identity_file(Identity *id) |
1192 |
load_identity_file(const Identity *id) |
| 1193 |
{ |
1193 |
{ |
| 1194 |
Key *private = NULL; |
1194 |
Key *private = NULL; |
| 1195 |
char prompt[300], *passphrase, *comment; |
1195 |
char prompt[300], *passphrase, *comment; |
|
Lines 1414-1421
pubkey_cleanup(Authctxt *authctxt)
Link Here
|
| 1414 |
} |
1414 |
} |
| 1415 |
} |
1415 |
} |
| 1416 |
|
1416 |
|
|
|
1417 |
static void |
| 1418 |
pubkey_reset(Authctxt *authctxt) |
| 1419 |
{ |
| 1420 |
Identity *id, *last; |
| 1421 |
|
| 1422 |
last = TAILQ_LAST(&authctxt->keys, idlist); |
| 1423 |
while ((id = TAILQ_FIRST(&authctxt->keys)) && |
| 1424 |
(id->tried != last->tried)) { |
| 1425 |
id->tried++; |
| 1426 |
TAILQ_REMOVE(&authctxt->keys, id, next); |
| 1427 |
TAILQ_INSERT_TAIL(&authctxt->keys, id, next); |
| 1428 |
last = id; |
| 1429 |
} |
| 1430 |
TAILQ_FOREACH(id, &authctxt->keys, next) |
| 1431 |
id->tried = 0; |
| 1432 |
} |
| 1433 |
|
| 1417 |
static int |
1434 |
static int |
| 1418 |
try_identity(Identity *id) |
1435 |
try_identity(const Identity *id) |
| 1419 |
{ |
1436 |
{ |
| 1420 |
if (!id->key) |
1437 |
if (!id->key) |
| 1421 |
return (0); |
1438 |
return (0); |
|
Lines 1459-1464
userauth_pubkey(Authctxt *authctxt)
Link Here
|
| 1459 |
id->isprivate = 1; |
1476 |
id->isprivate = 1; |
| 1460 |
sent = sign_and_send_pubkey( |
1477 |
sent = sign_and_send_pubkey( |
| 1461 |
authctxt, id); |
1478 |
authctxt, id); |
|
|
1479 |
id->isprivate = 0; |
| 1462 |
} |
1480 |
} |
| 1463 |
key_free(id->key); |
1481 |
key_free(id->key); |
| 1464 |
id->key = NULL; |
1482 |
id->key = NULL; |