summaryrefslogtreecommitdiff
path: root/authfd.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-23 10:46:23 +1000
committerDamien Miller <djm@mindrot.org>2000-08-23 10:46:23 +1000
commitad833b3e65c1887674714d514eb818d862bb499a (patch)
tree16fa75fe42aede072c5d3edac562c2870d1bb0e5 /authfd.h
parentb078567bf5de1dcf12d265d98acb4dc9eba8b325 (diff)
- (djm) Pick up LOGIN_PROGRAM from environment or PATH if not set by headers
- (djm) OpenBSD CVS updates: - deraadt@cvs.openbsd.org 2000/08/18 20:07:23 [ssh.c] accept remsh as a valid name as well; roman@buildpoint.com - deraadt@cvs.openbsd.org 2000/08/18 20:17:13 [deattack.c crc32.c packet.c] rename crc32() to ssh_crc32() to avoid zlib name clash. do not move to libz crc32 function yet, because it has ugly "long"'s in it; oneill@cs.sfu.ca - deraadt@cvs.openbsd.org 2000/08/18 20:26:08 [scp.1 scp.c] -S prog support; tv@debian.org - deraadt@cvs.openbsd.org 2000/08/18 20:50:07 [scp.c] knf - deraadt@cvs.openbsd.org 2000/08/18 20:57:33 [log-client.c] shorten - markus@cvs.openbsd.org 2000/08/19 12:48:11 [channels.c channels.h clientloop.c ssh.c ssh.h] support for ~. in ssh2 - deraadt@cvs.openbsd.org 2000/08/19 15:29:40 [crc32.h] proper prototype - markus@cvs.openbsd.org 2000/08/19 15:34:44 [authfd.c authfd.h key.c key.h ssh-add.1 ssh-add.c ssh-agent.1] [ssh-agent.c ssh-keygen.c sshconnect1.c sshconnect2.c Makefile] [fingerprint.c fingerprint.h] add SSH2/DSA support to the agent and some other DSA related cleanups. (note that we cannot talk to ssh.com's ssh2 agents) - markus@cvs.openbsd.org 2000/08/19 15:55:52 [channels.c channels.h clientloop.c] more ~ support for ssh2 - markus@cvs.openbsd.org 2000/08/19 16:21:19 [clientloop.c] oops - millert@cvs.openbsd.org 2000/08/20 12:25:53 [session.c] We have to stash the result of get_remote_name_or_ip() before we close our socket or getpeername() will get EBADF and the process will exit. Only a problem for "UseLogin yes". - millert@cvs.openbsd.org 2000/08/20 12:30:59 [session.c] Only check /etc/nologin if "UseLogin no" since login(1) may have its own policy on determining who is allowed to login when /etc/nologin is present. Also use the _PATH_NOLOGIN define. - millert@cvs.openbsd.org 2000/08/20 12:42:43 [auth1.c auth2.c session.c ssh.c] Add calls to setusercontext() and login_get*(). We basically call setusercontext() in most places where previously we did a setlogin(). Add default login.conf file and put root in the "daemon" login class. - millert@cvs.openbsd.org 2000/08/21 10:23:31 [session.c] Fix incorrect PATH setting; noted by Markus.
Diffstat (limited to 'authfd.h')
-rw-r--r--authfd.h53
1 files changed, 26 insertions, 27 deletions
diff --git a/authfd.h b/authfd.h
index 14b9bee94..5819b9139 100644
--- a/authfd.h
+++ b/authfd.h
@@ -13,7 +13,7 @@
13 * 13 *
14 */ 14 */
15 15
16/* RCSID("$OpenBSD: authfd.h,v 1.9 2000/07/16 08:27:21 markus Exp $"); */ 16/* RCSID("$OpenBSD: authfd.h,v 1.10 2000/08/19 21:34:43 markus Exp $"); */
17 17
18#ifndef AUTHFD_H 18#ifndef AUTHFD_H
19#define AUTHFD_H 19#define AUTHFD_H
@@ -35,18 +35,16 @@
35#define SSH2_AGENT_IDENTITIES_ANSWER 12 35#define SSH2_AGENT_IDENTITIES_ANSWER 12
36#define SSH2_AGENTC_SIGN_REQUEST 13 36#define SSH2_AGENTC_SIGN_REQUEST 13
37#define SSH2_AGENT_SIGN_RESPONSE 14 37#define SSH2_AGENT_SIGN_RESPONSE 14
38#define SSH2_AGENT_FAILURE SSH_AGENT_FAILURE
39#define SSH2_AGENT_SUCCESS SSH_AGENT_SUCCESS
40#define SSH2_AGENTC_ADD_IDENTITY 17 38#define SSH2_AGENTC_ADD_IDENTITY 17
41#define SSH2_AGENTC_REMOVE_IDENTITY 18 39#define SSH2_AGENTC_REMOVE_IDENTITY 18
42#define SSH2_AGENTC_REMOVE_ALL_IDENTITIES 19 40#define SSH2_AGENTC_REMOVE_ALL_IDENTITIES 19
43 41
44typedef struct { 42typedef struct {
45 int fd; 43 int fd;
46 Buffer packet;
47 Buffer identities; 44 Buffer identities;
48 int howmany; 45 int howmany;
49} AuthenticationConnection; 46} AuthenticationConnection;
47
50/* Returns the number of the authentication fd, or -1 if there is none. */ 48/* Returns the number of the authentication fd, or -1 if there is none. */
51int ssh_get_authentication_socket(); 49int ssh_get_authentication_socket();
52 50
@@ -69,44 +67,48 @@ AuthenticationConnection *ssh_get_authentication_connection();
69 * Closes the connection to the authentication agent and frees any associated 67 * Closes the connection to the authentication agent and frees any associated
70 * memory. 68 * memory.
71 */ 69 */
72void ssh_close_authentication_connection(AuthenticationConnection * ac); 70void ssh_close_authentication_connection(AuthenticationConnection *auth);
73 71
74/* 72/*
75 * Returns the first authentication identity held by the agent. Returns true 73 * Returns the first authentication identity held by the agent or NULL if
76 * if an identity is available, 0 otherwise. The caller must initialize the 74 * no identies are available. Caller must free comment and key.
77 * integers before the call, and free the comment after a successful call 75 * Note that you cannot mix calls with different versions.
78 * (before calling ssh_get_next_identity).
79 */ 76 */
80int 77Key *ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int version);
81ssh_get_first_identity(AuthenticationConnection * connection,
82 BIGNUM * e, BIGNUM * n, char **comment);
83 78
84/* 79/*
85 * Returns the next authentication identity for the agent. Other functions 80 * Returns the next authentication identity for the agent. Other functions
86 * can be called between this and ssh_get_first_identity or two calls of this 81 * can be called between this and ssh_get_first_identity or two calls of this
87 * function. This returns 0 if there are no more identities. The caller 82 * function. This returns NULL if there are no more identities. The caller
88 * must free comment after a successful return. 83 * must free key and comment after a successful return.
89 */ 84 */
90int 85Key *ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version);
91ssh_get_next_identity(AuthenticationConnection * connection,
92 BIGNUM * e, BIGNUM * n, char **comment);
93 86
94/* Requests the agent to decrypt the given challenge. Returns true if 87/*
95 the agent claims it was able to decrypt it. */ 88 * Requests the agent to decrypt the given challenge. Returns true if the
89 * agent claims it was able to decrypt it.
90 */
96int 91int
97ssh_decrypt_challenge(AuthenticationConnection * auth, 92ssh_decrypt_challenge(AuthenticationConnection *auth,
98 BIGNUM * e, BIGNUM * n, BIGNUM * challenge, 93 Key *key, BIGNUM * challenge,
99 unsigned char session_id[16], 94 unsigned char session_id[16],
100 unsigned int response_type, 95 unsigned int response_type,
101 unsigned char response[16]); 96 unsigned char response[16]);
102 97
98/* Requests the agent to sign data using key */
99int
100ssh_agent_sign(AuthenticationConnection *auth,
101 Key *key,
102 unsigned char **sigp, int *lenp,
103 unsigned char *data, int datalen);
104
103/* 105/*
104 * Adds an identity to the authentication server. This call is not meant to 106 * Adds an identity to the authentication server. This call is not meant to
105 * be used by normal applications. This returns true if the identity was 107 * be used by normal applications. This returns true if the identity was
106 * successfully added. 108 * successfully added.
107 */ 109 */
108int 110int
109ssh_add_identity(AuthenticationConnection * connection, Key *key, 111ssh_add_identity(AuthenticationConnection *auth, Key *key,
110 const char *comment); 112 const char *comment);
111 113
112/* 114/*
@@ -114,16 +116,13 @@ ssh_add_identity(AuthenticationConnection * connection, Key *key,
114 * meant to be used by normal applications. This returns true if the 116 * meant to be used by normal applications. This returns true if the
115 * identity was successfully added. 117 * identity was successfully added.
116 */ 118 */
117int ssh_remove_identity(AuthenticationConnection * connection, RSA * key); 119int ssh_remove_identity(AuthenticationConnection *auth, Key *key);
118 120
119/* 121/*
120 * Removes all identities from the authentication agent. This call is not 122 * Removes all identities from the authentication agent. This call is not
121 * meant to be used by normal applications. This returns true if the 123 * meant to be used by normal applications. This returns true if the
122 * operation was successful. 124 * operation was successful.
123 */ 125 */
124int ssh_remove_all_identities(AuthenticationConnection * connection); 126int ssh_remove_all_identities(AuthenticationConnection *auth, int version);
125
126/* Closes the connection to the authentication agent. */
127void ssh_close_authentication(AuthenticationConnection * connection);
128 127
129#endif /* AUTHFD_H */ 128#endif /* AUTHFD_H */