diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 04:46:56 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 04:46:56 +0000 |
commit | 4cc240dabbd81a308f06f2717b1942041fe0e205 (patch) | |
tree | 07291c8c2c467fc2ecec9166ed0d8ec1e75631a3 /authfd.h | |
parent | 5bf5d67d497ed91c19851db6b904d54003afe67e (diff) |
- markus@cvs.openbsd.org 2001/06/26 17:27:25
[authfd.h authfile.h auth.h auth-options.h bufaux.h buffer.h
canohost.h channels.h cipher.h clientloop.h compat.h compress.h
crc32.h deattack.h dh.h dispatch.h groupaccess.c groupaccess.h
hostfile.h kex.h key.h log.c log.h mac.h misc.c misc.h mpaux.h
packet.h radix.h readconf.h readpass.h rsa.h servconf.h serverloop.h
session.h sftp-common.c sftp-common.h sftp-glob.h sftp-int.h
sshconnect.h ssh-dss.h sshlogin.h sshpty.h ssh-rsa.h sshtty.h
tildexpand.h uidswap.h uuencode.h xmalloc.h]
remove comments from .h, since they are cut&paste from the .c files
and out of sync
Diffstat (limited to 'authfd.h')
-rw-r--r-- | authfd.h | 85 |
1 files changed, 12 insertions, 73 deletions
@@ -11,7 +11,7 @@ | |||
11 | * called by a name other than "ssh" or "Secure Shell". | 11 | * called by a name other than "ssh" or "Secure Shell". |
12 | */ | 12 | */ |
13 | 13 | ||
14 | /* RCSID("$OpenBSD: authfd.h,v 1.18 2001/06/26 06:32:47 itojun Exp $"); */ | 14 | /* RCSID("$OpenBSD: authfd.h,v 1.19 2001/06/26 17:27:22 markus Exp $"); */ |
15 | 15 | ||
16 | #ifndef AUTHFD_H | 16 | #ifndef AUTHFD_H |
17 | #define AUTHFD_H | 17 | #define AUTHFD_H |
@@ -43,96 +43,35 @@ | |||
43 | #define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 | 43 | #define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 |
44 | 44 | ||
45 | /* additional error code for ssh.com's ssh-agent2 */ | 45 | /* additional error code for ssh.com's ssh-agent2 */ |
46 | #define SSH_COM_AGENT2_FAILURE 102 | 46 | #define SSH_COM_AGENT2_FAILURE 102 |
47 | 47 | ||
48 | #define SSH_AGENT_OLD_SIGNATURE 0x01 | 48 | #define SSH_AGENT_OLD_SIGNATURE 0x01 |
49 | 49 | ||
50 | |||
51 | typedef struct { | 50 | typedef struct { |
52 | int fd; | 51 | int fd; |
53 | Buffer identities; | 52 | Buffer identities; |
54 | int howmany; | 53 | int howmany; |
55 | } AuthenticationConnection; | 54 | } AuthenticationConnection; |
56 | 55 | ||
57 | /* Returns the number of the authentication fd, or -1 if there is none. */ | 56 | int ssh_get_authentication_socket(void); |
58 | int ssh_get_authentication_socket(void); | 57 | void ssh_close_authentication_socket(int); |
59 | |||
60 | /* | ||
61 | * This should be called for any descriptor returned by | ||
62 | * ssh_get_authentication_socket(). Depending on the way the descriptor was | ||
63 | * obtained, this may close the descriptor. | ||
64 | */ | ||
65 | void ssh_close_authentication_socket(int); | ||
66 | 58 | ||
67 | /* | ||
68 | * Opens and connects a private socket for communication with the | ||
69 | * authentication agent. Returns NULL if an error occurred and the | ||
70 | * connection could not be opened. The connection should be closed by the | ||
71 | * caller by calling ssh_close_authentication_connection(). | ||
72 | */ | ||
73 | AuthenticationConnection *ssh_get_authentication_connection(void); | 59 | AuthenticationConnection *ssh_get_authentication_connection(void); |
74 | 60 | void ssh_close_authentication_connection(AuthenticationConnection *); | |
75 | /* | 61 | int ssh_get_num_identities(AuthenticationConnection *, int); |
76 | * Closes the connection to the authentication agent and frees any associated | ||
77 | * memory. | ||
78 | */ | ||
79 | void ssh_close_authentication_connection(AuthenticationConnection *); | ||
80 | |||
81 | /* | ||
82 | * Returns the number authentication identity held by the agent. | ||
83 | */ | ||
84 | int ssh_get_num_identities(AuthenticationConnection *, int); | ||
85 | |||
86 | /* | ||
87 | * Returns the first authentication identity held by the agent or NULL if | ||
88 | * no identies are available. Caller must free comment and key. | ||
89 | * Note that you cannot mix calls with different versions. | ||
90 | */ | ||
91 | Key *ssh_get_first_identity(AuthenticationConnection *, char **, int); | 62 | Key *ssh_get_first_identity(AuthenticationConnection *, char **, int); |
92 | |||
93 | /* | ||
94 | * Returns the next authentication identity for the agent. Other functions | ||
95 | * can be called between this and ssh_get_first_identity or two calls of this | ||
96 | * function. This returns NULL if there are no more identities. The caller | ||
97 | * must free key and comment after a successful return. | ||
98 | */ | ||
99 | Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); | 63 | Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); |
64 | int ssh_add_identity(AuthenticationConnection *, Key *, const char *); | ||
65 | int ssh_remove_identity(AuthenticationConnection *, Key *); | ||
66 | int ssh_remove_all_identities(AuthenticationConnection *, int); | ||
67 | int ssh_update_card(AuthenticationConnection *, int, int); | ||
100 | 68 | ||
101 | /* | ||
102 | * Requests the agent to decrypt the given challenge. Returns true if the | ||
103 | * agent claims it was able to decrypt it. | ||
104 | */ | ||
105 | int | 69 | int |
106 | ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16], | 70 | ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16], |
107 | u_int, u_char[16]); | 71 | u_int, u_char[16]); |
108 | 72 | ||
109 | /* Requests the agent to sign data using key */ | ||
110 | int | ||
111 | ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, int *, | ||
112 | u_char *, int); | ||
113 | |||
114 | /* | ||
115 | * Adds an identity to the authentication server. This call is not meant to | ||
116 | * be used by normal applications. This returns true if the identity was | ||
117 | * successfully added. | ||
118 | */ | ||
119 | int | 73 | int |
120 | ssh_add_identity(AuthenticationConnection *, Key *, const char *); | 74 | ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, int *, u_char *, |
121 | 75 | int); | |
122 | /* | ||
123 | * Removes the identity from the authentication server. This call is not | ||
124 | * meant to be used by normal applications. This returns true if the | ||
125 | * identity was successfully added. | ||
126 | */ | ||
127 | int ssh_remove_identity(AuthenticationConnection *, Key *); | ||
128 | |||
129 | /* | ||
130 | * Removes all identities from the authentication agent. This call is not | ||
131 | * meant to be used by normal applications. This returns true if the | ||
132 | * operation was successful. | ||
133 | */ | ||
134 | int ssh_remove_all_identities(AuthenticationConnection *, int); | ||
135 | |||
136 | int ssh_update_card(AuthenticationConnection *, int, int); | ||
137 | 76 | ||
138 | #endif /* AUTHFD_H */ | 77 | #endif /* AUTHFD_H */ |