1
- /* $OpenBSD: authfd.h,v 1.49 2020/06/26 05:03:36 djm Exp $ */
1
+ /* $OpenBSD: authfd.h,v 1.51 2021/12/19 22:10:24 djm Exp $ */
2
2
3
3
/*
4
4
* Author: Tatu Ylonen <[email protected] >
18
18
19
19
#include <sys/types.h>
20
20
21
+ struct sshbuf ;
22
+ struct sshkey ;
23
+
21
24
/* List of identities returned by ssh_fetch_identitylist() */
22
25
struct ssh_identitylist {
23
26
size_t nkeys ;
24
27
struct sshkey * * keys ;
25
28
char * * comments ;
26
29
};
27
30
31
+ /* Key destination restrictions */
32
+ struct dest_constraint_hop {
33
+ char * user ; /* wildcards allowed */
34
+ char * hostname ; /* used to matching cert principals and for display */
35
+ int is_ca ;
36
+ u_int nkeys ; /* number of entries in *both* 'keys' and 'key_is_ca' */
37
+ struct sshkey * * keys ;
38
+ int * key_is_ca ;
39
+ };
40
+ struct dest_constraint {
41
+ struct dest_constraint_hop from ;
42
+ struct dest_constraint_hop to ;
43
+ };
44
+
28
45
int ssh_get_authentication_socket (int * fdp );
29
46
int ssh_get_authentication_socket_path (const char * authsocket , int * fdp );
30
47
void ssh_close_authentication_socket (int sock );
@@ -33,18 +50,25 @@ int ssh_lock_agent(int sock, int lock, const char *password);
33
50
int ssh_fetch_identitylist (int sock , struct ssh_identitylist * * idlp );
34
51
void ssh_free_identitylist (struct ssh_identitylist * idl );
35
52
int ssh_add_identity_constrained (int sock , struct sshkey * key ,
36
- const char * comment , u_int life , u_int confirm , u_int maxsign ,
37
- const char * provider );
53
+ const char * comment , u_int life , u_int confirm , u_int maxsign ,
54
+ const char * provider , struct dest_constraint * * dest_constraints ,
55
+ size_t ndest_constraints );
38
56
int ssh_agent_has_key (int sock , const struct sshkey * key );
39
57
int ssh_remove_identity (int sock , const struct sshkey * key );
40
58
int ssh_update_card (int sock , int add , const char * reader_id ,
41
- const char * pin , u_int life , u_int confirm );
59
+ const char * pin , u_int life , u_int confirm ,
60
+ struct dest_constraint * * dest_constraints ,
61
+ size_t ndest_constraints );
42
62
int ssh_remove_all_identities (int sock , int version );
43
63
44
64
int ssh_agent_sign (int sock , const struct sshkey * key ,
45
65
u_char * * sigp , size_t * lenp ,
46
66
const u_char * data , size_t datalen , const char * alg , u_int compat );
47
67
68
+ int ssh_agent_bind_hostkey (int sock , const struct sshkey * key ,
69
+ const struct sshbuf * session_id , const struct sshbuf * signature ,
70
+ int forwarding );
71
+
48
72
/* Messages for the authentication agent connection. */
49
73
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
50
74
#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
@@ -78,6 +102,9 @@ int ssh_agent_sign(int sock, const struct sshkey *key,
78
102
#define SSH2_AGENTC_ADD_ID_CONSTRAINED 25
79
103
#define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26
80
104
105
+ /* generic extension mechanism */
106
+ #define SSH_AGENTC_EXTENSION 27
107
+
81
108
#define SSH_AGENT_CONSTRAIN_LIFETIME 1
82
109
#define SSH_AGENT_CONSTRAIN_CONFIRM 2
83
110
#define SSH_AGENT_CONSTRAIN_MAXSIGN 3
0 commit comments