00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef AUTHFD_H
00017 #define AUTHFD_H
00018
00019 #include "buffer.h"
00020
00021
00022 #define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
00023 #define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
00024 #define SSH_AGENTC_RSA_CHALLENGE 3
00025 #define SSH_AGENT_RSA_RESPONSE 4
00026 #define SSH_AGENT_FAILURE 5
00027 #define SSH_AGENT_SUCCESS 6
00028 #define SSH_AGENTC_ADD_RSA_IDENTITY 7
00029 #define SSH_AGENTC_REMOVE_RSA_IDENTITY 8
00030 #define SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES 9
00031
00032
00033 #define SSH2_AGENTC_REQUEST_IDENTITIES 11
00034 #define SSH2_AGENT_IDENTITIES_ANSWER 12
00035 #define SSH2_AGENTC_SIGN_REQUEST 13
00036 #define SSH2_AGENT_SIGN_RESPONSE 14
00037 #define SSH2_AGENTC_ADD_IDENTITY 17
00038 #define SSH2_AGENTC_REMOVE_IDENTITY 18
00039 #define SSH2_AGENTC_REMOVE_ALL_IDENTITIES 19
00040
00041
00042 #define SSH_AGENTC_ADD_SMARTCARD_KEY 20
00043 #define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21
00044
00045
00046 #define SSH_AGENTC_LOCK 22
00047 #define SSH_AGENTC_UNLOCK 23
00048
00049
00050 #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24
00051 #define SSH2_AGENTC_ADD_ID_CONSTRAINED 25
00052 #define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26
00053
00054 #define SSH_AGENT_CONSTRAIN_LIFETIME 1
00055 #define SSH_AGENT_CONSTRAIN_CONFIRM 2
00056
00057
00058 #define SSH2_AGENT_FAILURE 30
00059
00060
00061 #define SSH_COM_AGENT2_FAILURE 102
00062
00063 #define SSH_AGENT_OLD_SIGNATURE 0x01
00064
00065 typedef struct {
00066 int fd;
00067 Buffer identities;
00068 int howmany;
00069 } AuthenticationConnection;
00070
00071 int ssh_agent_present(void);
00072 int ssh_get_authentication_socket(void);
00073 void ssh_close_authentication_socket(int);
00074
00075 AuthenticationConnection *ssh_get_authentication_connection(void);
00076 void ssh_close_authentication_connection(AuthenticationConnection *);
00077 int ssh_get_num_identities(AuthenticationConnection *, int);
00078 Key *ssh_get_first_identity(AuthenticationConnection *, char **, int);
00079 Key *ssh_get_next_identity(AuthenticationConnection *, char **, int);
00080 int ssh_add_identity(AuthenticationConnection *, Key *, const char *);
00081 int ssh_add_identity_constrained(AuthenticationConnection *, Key *,
00082 const char *, u_int, u_int);
00083 int ssh_remove_identity(AuthenticationConnection *, Key *);
00084 int ssh_remove_all_identities(AuthenticationConnection *, int);
00085 int ssh_lock_agent(AuthenticationConnection *, int, const char *);
00086 int ssh_update_card(AuthenticationConnection *, int, const char *,
00087 const char *, u_int, u_int);
00088
00089 int
00090 ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16],
00091 u_int, u_char[16]);
00092
00093 int
00094 ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, u_int *, u_char *,
00095 u_int);
00096
00097 #endif