1
- /* $OpenBSD: auth.h,v 1.91 2017/05/30 14:29:59 markus Exp $ */
1
+ /* $OpenBSD: auth.h,v 1.92 2017/06/24 06:34:38 djm Exp $ */
2
2
3
3
/*
4
4
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
44
45
45
struct ssh ;
46
46
struct sshkey ;
47
+ struct sshbuf ;
47
48
48
49
typedef struct Authctxt Authctxt ;
49
50
typedef struct Authmethod Authmethod ;
@@ -62,28 +63,41 @@ struct Authctxt {
62
63
char * service ;
63
64
struct passwd * pw ; /* set if 'valid' */
64
65
char * style ;
66
+
67
+ /* Method lists for multiple authentication */
68
+ char * * auth_methods ; /* modified from server config */
69
+ u_int num_auth_methods ;
70
+
71
+ /* Authentication method-specific data */
72
+ void * methoddata ;
65
73
void * kbdintctxt ;
66
- char * info ; /* Extra info for next auth_log */
67
74
#ifdef BSD_AUTH
68
75
auth_session_t * as ;
69
76
#endif
70
- char * * auth_methods ; /* modified from server config */
71
- u_int num_auth_methods ;
72
77
#ifdef KRB5
73
78
krb5_context krb5_ctx ;
74
79
krb5_ccache krb5_fwd_ccache ;
75
80
krb5_principal krb5_user ;
76
81
char * krb5_ticket_file ;
77
82
char * krb5_ccname ;
78
83
#endif
79
- Buffer * loginmsg ;
80
- void * methoddata ;
84
+ struct sshbuf * loginmsg ;
85
+
86
+ /* Authentication keys already used; these will be refused henceforth */
87
+ struct sshkey * * prev_keys ;
88
+ u_int nprev_keys ;
89
+
90
+ /* Last used key and ancilliary information from active auth method */
91
+ struct sshkey * auth_method_key ;
92
+ char * auth_method_info ;
93
+
94
+ /* Information exposed to session */
95
+ struct sshbuf * session_info ; /* Auth info for environment */
81
96
#ifdef WINDOWS
82
97
void * auth_token ;
83
98
#endif
84
- struct sshkey * * prev_userkeys ;
85
- u_int nprev_userkeys ;
86
99
};
100
+
87
101
/*
88
102
* Every authentication method has to handle authentication requests for
89
103
* non-existing users, or for users that are not allowed to login. In this
@@ -122,10 +136,18 @@ int auth_password(Authctxt *, const char *);
122
136
int hostbased_key_allowed (struct passwd * , const char * , char * ,
123
137
struct sshkey * );
124
138
int user_key_allowed (struct passwd * , struct sshkey * , int );
125
- void pubkey_auth_info (Authctxt * , const struct sshkey * , const char * , ...)
126
- __attribute__((__format__ (printf , 3 , 4 )));
127
- void auth2_record_userkey (Authctxt * , struct sshkey * );
128
- int auth2_userkey_already_used (Authctxt * , struct sshkey * );
139
+ int auth2_key_already_used (Authctxt * , const struct sshkey * );
140
+
141
+ /*
142
+ * Handling auth method-specific information for logging and prevention
143
+ * of key reuse during multiple authentication.
144
+ */
145
+ void auth2_authctxt_reset_info (Authctxt * );
146
+ void auth2_record_key (Authctxt * , int , const struct sshkey * );
147
+ void auth2_record_info (Authctxt * authctxt , const char * , ...)
148
+ __attribute__((__format__ (printf , 2 , 3 )))
149
+ __attribute__((__nonnull__ (2 )));
150
+ void auth2_update_session_info (Authctxt * , const char * , const char * );
129
151
130
152
struct stat ;
131
153
int auth_secure_path (const char * , struct stat * , const char * , uid_t ,
@@ -152,9 +174,6 @@ void disable_forwarding(void);
152
174
153
175
void do_authentication2 (Authctxt * );
154
176
155
- void auth_info (Authctxt * authctxt , const char * , ...)
156
- __attribute__((__format__ (printf , 2 , 3 )))
157
- __attribute__((__nonnull__ (2 )));
158
177
void auth_log (Authctxt * , int , int , const char * , const char * );
159
178
void auth_maxtries_exceeded (Authctxt * ) __attribute__((noreturn ));
160
179
void userauth_finish (struct ssh * , int , const char * , const char * );
0 commit comments