diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: authfd.c,v 1.28 2000/09/21 11:07:50 markus Exp $"); | 38 | RCSID("$OpenBSD: authfd.c,v 1.29 2000/10/09 21:51:00 markus Exp $"); |
39 | 39 | ||
40 | #include "ssh.h" | 40 | #include "ssh.h" |
41 | #include "rsa.h" | 41 | #include "rsa.h" |
@@ -56,6 +56,10 @@ RCSID("$OpenBSD: authfd.c,v 1.28 2000/09/21 11:07:50 markus Exp $"); | |||
56 | /* helper */ | 56 | /* helper */ |
57 | int decode_reply(int type); | 57 | int decode_reply(int type); |
58 | 58 | ||
59 | /* macro to check for "agent failure" message */ | ||
60 | #define agent_failed(x) \ | ||
61 | ((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE)) | ||
62 | |||
59 | /* Returns the number of the authentication fd, or -1 if there is none. */ | 63 | /* Returns the number of the authentication fd, or -1 if there is none. */ |
60 | 64 | ||
61 | int | 65 | int |
@@ -242,7 +246,7 @@ ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int versi | |||
242 | 246 | ||
243 | /* Get message type, and verify that we got a proper answer. */ | 247 | /* Get message type, and verify that we got a proper answer. */ |
244 | type = buffer_get_char(&auth->identities); | 248 | type = buffer_get_char(&auth->identities); |
245 | if (type == SSH_AGENT_FAILURE) { | 249 | if (agent_failed(type)) { |
246 | return NULL; | 250 | return NULL; |
247 | } else if (type != code2) { | 251 | } else if (type != code2) { |
248 | fatal("Bad authentication reply message type: %d", type); | 252 | fatal("Bad authentication reply message type: %d", type); |
@@ -341,7 +345,7 @@ ssh_decrypt_challenge(AuthenticationConnection *auth, | |||
341 | } | 345 | } |
342 | type = buffer_get_char(&buffer); | 346 | type = buffer_get_char(&buffer); |
343 | 347 | ||
344 | if (type == SSH_AGENT_FAILURE) { | 348 | if (agent_failed(type)) { |
345 | log("Agent admitted failure to authenticate using the key."); | 349 | log("Agent admitted failure to authenticate using the key."); |
346 | } else if (type != SSH_AGENT_RSA_RESPONSE) { | 350 | } else if (type != SSH_AGENT_RSA_RESPONSE) { |
347 | fatal("Bad authentication response: %d", type); | 351 | fatal("Bad authentication response: %d", type); |
@@ -390,7 +394,7 @@ ssh_agent_sign(AuthenticationConnection *auth, | |||
390 | return -1; | 394 | return -1; |
391 | } | 395 | } |
392 | type = buffer_get_char(&msg); | 396 | type = buffer_get_char(&msg); |
393 | if (type == SSH_AGENT_FAILURE) { | 397 | if (agent_failed(type)) { |
394 | log("Agent admitted failure to sign using the key."); | 398 | log("Agent admitted failure to sign using the key."); |
395 | } else if (type != SSH2_AGENT_SIGN_RESPONSE) { | 399 | } else if (type != SSH2_AGENT_SIGN_RESPONSE) { |
396 | fatal("Bad authentication response: %d", type); | 400 | fatal("Bad authentication response: %d", type); |
@@ -537,6 +541,7 @@ decode_reply(int type) | |||
537 | { | 541 | { |
538 | switch (type) { | 542 | switch (type) { |
539 | case SSH_AGENT_FAILURE: | 543 | case SSH_AGENT_FAILURE: |
544 | case SSH_COM_AGENT2_FAILURE: | ||
540 | log("SSH_AGENT_FAILURE"); | 545 | log("SSH_AGENT_FAILURE"); |
541 | return 0; | 546 | return 0; |
542 | case SSH_AGENT_SUCCESS: | 547 | case SSH_AGENT_SUCCESS: |