summaryrefslogtreecommitdiff
path: root/authfd.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-14 20:05:27 +0000
committerDamien Miller <djm@mindrot.org>2015-01-15 21:37:34 +1100
commit141efe49542f7156cdbc2e4cd0a041d8b1aab622 (patch)
treea9142350f2b8689f4d42548ca272ed577b32a881 /authfd.h
parent0088c57af302cda278bd26d8c3ae81d5b6f7c289 (diff)
upstream commit
move authfd.c and its tentacles to the new buffer/key API; ok markus@
Diffstat (limited to 'authfd.h')
-rw-r--r--authfd.h60
1 files changed, 28 insertions, 32 deletions
diff --git a/authfd.h b/authfd.h
index 2582a27aa..bea20c26b 100644
--- a/authfd.h
+++ b/authfd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.h,v 1.37 2009/08/27 17:44:52 djm Exp $ */ 1/* $OpenBSD: authfd.h,v 1.38 2015/01/14 20:05:27 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,6 +16,33 @@
16#ifndef AUTHFD_H 16#ifndef AUTHFD_H
17#define AUTHFD_H 17#define AUTHFD_H
18 18
19/* List of identities returned by ssh_fetch_identitylist() */
20struct ssh_identitylist {
21 size_t nkeys;
22 struct sshkey **keys;
23 char **comments;
24};
25
26int ssh_get_authentication_socket(int *fdp);
27void ssh_close_authentication_socket(int sock);
28
29int ssh_lock_agent(int sock, int lock, const char *password);
30int ssh_fetch_identitylist(int sock, int version,
31 struct ssh_identitylist **idlp);
32void ssh_free_identitylist(struct ssh_identitylist *idl);
33int ssh_add_identity_constrained(int sock, struct sshkey *key,
34 const char *comment, u_int life, u_int confirm);
35int ssh_remove_identity(int sock, struct sshkey *key);
36int ssh_update_card(int sock, int add, const char *reader_id,
37 const char *pin, u_int life, u_int confirm);
38int ssh_remove_all_identities(int sock, int version);
39
40int ssh_decrypt_challenge(int sock, struct sshkey* key, BIGNUM *challenge,
41 u_char session_id[16], u_char response[16]);
42int ssh_agent_sign(int sock, struct sshkey *key,
43 u_char **sigp, size_t *lenp,
44 const u_char *data, size_t datalen, u_int compat);
45
19/* Messages for the authentication agent connection. */ 46/* Messages for the authentication agent connection. */
20#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 47#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
21#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2 48#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
@@ -60,35 +87,4 @@
60 87
61#define SSH_AGENT_OLD_SIGNATURE 0x01 88#define SSH_AGENT_OLD_SIGNATURE 0x01
62 89
63typedef struct {
64 int fd;
65 Buffer identities;
66 int howmany;
67} AuthenticationConnection;
68
69int ssh_agent_present(void);
70int ssh_get_authentication_socket(void);
71void ssh_close_authentication_socket(int);
72
73AuthenticationConnection *ssh_get_authentication_connection(void);
74void ssh_close_authentication_connection(AuthenticationConnection *);
75int ssh_get_num_identities(AuthenticationConnection *, int);
76Key *ssh_get_first_identity(AuthenticationConnection *, char **, int);
77Key *ssh_get_next_identity(AuthenticationConnection *, char **, int);
78int ssh_add_identity_constrained(AuthenticationConnection *, Key *,
79 const char *, u_int, u_int);
80int ssh_remove_identity(AuthenticationConnection *, Key *);
81int ssh_remove_all_identities(AuthenticationConnection *, int);
82int ssh_lock_agent(AuthenticationConnection *, int, const char *);
83int ssh_update_card(AuthenticationConnection *, int, const char *,
84 const char *, u_int, u_int);
85
86int
87ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16],
88 u_int, u_char[16]);
89
90int
91ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, u_int *, u_char *,
92 u_int);
93
94#endif /* AUTHFD_H */ 90#endif /* AUTHFD_H */