version 1.184, 2014/03/15 17:28:26 |
version 1.185, 2014/04/29 18:01:49 |
|
|
#include <sys/un.h> |
#include <sys/un.h> |
#include <sys/param.h> |
#include <sys/param.h> |
|
|
|
#ifdef WITH_OPENSSL |
#include <openssl/evp.h> |
#include <openssl/evp.h> |
|
#endif |
|
|
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
|
|
buffer_put_int(&msg, tab->nentries); |
buffer_put_int(&msg, tab->nentries); |
TAILQ_FOREACH(id, &tab->idlist, next) { |
TAILQ_FOREACH(id, &tab->idlist, next) { |
if (id->key->type == KEY_RSA1) { |
if (id->key->type == KEY_RSA1) { |
|
#ifdef WITH_SSH1 |
buffer_put_int(&msg, BN_num_bits(id->key->rsa->n)); |
buffer_put_int(&msg, BN_num_bits(id->key->rsa->n)); |
buffer_put_bignum(&msg, id->key->rsa->e); |
buffer_put_bignum(&msg, id->key->rsa->e); |
buffer_put_bignum(&msg, id->key->rsa->n); |
buffer_put_bignum(&msg, id->key->rsa->n); |
|
#endif |
} else { |
} else { |
u_char *blob; |
u_char *blob; |
u_int blen; |
u_int blen; |
|
|
buffer_free(&msg); |
buffer_free(&msg); |
} |
} |
|
|
|
#ifdef WITH_SSH1 |
/* ssh1 only */ |
/* ssh1 only */ |
static void |
static void |
process_authentication_challenge1(SocketEntry *e) |
process_authentication_challenge1(SocketEntry *e) |
|
|
BN_clear_free(challenge); |
BN_clear_free(challenge); |
buffer_free(&msg); |
buffer_free(&msg); |
} |
} |
|
#endif |
|
|
/* ssh2 only */ |
/* ssh2 only */ |
static void |
static void |
|
|
case SSH_AGENTC_UNLOCK: |
case SSH_AGENTC_UNLOCK: |
process_lock_agent(e, type == SSH_AGENTC_LOCK); |
process_lock_agent(e, type == SSH_AGENTC_LOCK); |
break; |
break; |
|
#ifdef WITH_SSH1 |
/* ssh1 */ |
/* ssh1 */ |
case SSH_AGENTC_RSA_CHALLENGE: |
case SSH_AGENTC_RSA_CHALLENGE: |
process_authentication_challenge1(e); |
process_authentication_challenge1(e); |
|
|
case SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES: |
case SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES: |
process_remove_all_identities(e, 1); |
process_remove_all_identities(e, 1); |
break; |
break; |
|
#endif |
/* ssh2 */ |
/* ssh2 */ |
case SSH2_AGENTC_SIGN_REQUEST: |
case SSH2_AGENTC_SIGN_REQUEST: |
process_sign_request2(e); |
process_sign_request2(e); |
|
|
setegid(getgid()); |
setegid(getgid()); |
setgid(getgid()); |
setgid(getgid()); |
|
|
|
#ifdef WITH_OPENSSL |
OpenSSL_add_all_algorithms(); |
OpenSSL_add_all_algorithms(); |
|
#endif |
|
|
while ((ch = getopt(ac, av, "cdksa:t:")) != -1) { |
while ((ch = getopt(ac, av, "cdksa:t:")) != -1) { |
switch (ch) { |
switch (ch) { |