version 1.28, 2000/09/21 11:07:50 |
version 1.29, 2000/10/09 21:51:00 |
|
|
/* helper */ |
/* helper */ |
int decode_reply(int type); |
int decode_reply(int type); |
|
|
|
/* macro to check for "agent failure" message */ |
|
#define agent_failed(x) \ |
|
((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE)) |
|
|
/* Returns the number of the authentication fd, or -1 if there is none. */ |
/* Returns the number of the authentication fd, or -1 if there is none. */ |
|
|
int |
int |
|
|
|
|
/* Get message type, and verify that we got a proper answer. */ |
/* Get message type, and verify that we got a proper answer. */ |
type = buffer_get_char(&auth->identities); |
type = buffer_get_char(&auth->identities); |
if (type == SSH_AGENT_FAILURE) { |
if (agent_failed(type)) { |
return NULL; |
return NULL; |
} else if (type != code2) { |
} else if (type != code2) { |
fatal("Bad authentication reply message type: %d", type); |
fatal("Bad authentication reply message type: %d", type); |
|
|
} |
} |
type = buffer_get_char(&buffer); |
type = buffer_get_char(&buffer); |
|
|
if (type == SSH_AGENT_FAILURE) { |
if (agent_failed(type)) { |
log("Agent admitted failure to authenticate using the key."); |
log("Agent admitted failure to authenticate using the key."); |
} else if (type != SSH_AGENT_RSA_RESPONSE) { |
} else if (type != SSH_AGENT_RSA_RESPONSE) { |
fatal("Bad authentication response: %d", type); |
fatal("Bad authentication response: %d", type); |
|
|
return -1; |
return -1; |
} |
} |
type = buffer_get_char(&msg); |
type = buffer_get_char(&msg); |
if (type == SSH_AGENT_FAILURE) { |
if (agent_failed(type)) { |
log("Agent admitted failure to sign using the key."); |
log("Agent admitted failure to sign using the key."); |
} else if (type != SSH2_AGENT_SIGN_RESPONSE) { |
} else if (type != SSH2_AGENT_SIGN_RESPONSE) { |
fatal("Bad authentication response: %d", type); |
fatal("Bad authentication response: %d", type); |
|
|
{ |
{ |
switch (type) { |
switch (type) { |
case SSH_AGENT_FAILURE: |
case SSH_AGENT_FAILURE: |
|
case SSH_COM_AGENT2_FAILURE: |
log("SSH_AGENT_FAILURE"); |
log("SSH_AGENT_FAILURE"); |
return 0; |
return 0; |
case SSH_AGENT_SUCCESS: |
case SSH_AGENT_SUCCESS: |