libssh  0.8.4
The SSH library
auth.h
1 /*
2  * This file is part of the SSH Library
3  *
4  * Copyright (c) 2009 by Aris Adamantiadis
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AUTH_H_
22 #define AUTH_H_
23 #include "config.h"
24 #include "libssh/callbacks.h"
25 
26 SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
27 SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
28 SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
29 SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
30 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
31 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response);
32 
38  uint32_t nprompts;
39  uint32_t nanswers;
40  char *name;
41  char *instruction;
42  char **prompts;
43  unsigned char *echo; /* bool array */
44  char **answers;
45 };
46 typedef struct ssh_kbdint_struct* ssh_kbdint;
47 
48 ssh_kbdint ssh_kbdint_new(void);
49 void ssh_kbdint_clean(ssh_kbdint kbd);
50 void ssh_kbdint_free(ssh_kbdint kbd);
51 
56 enum ssh_auth_state_e {
58  SSH_AUTH_STATE_NONE=0,
60  SSH_AUTH_STATE_PARTIAL,
62  SSH_AUTH_STATE_SUCCESS,
64  SSH_AUTH_STATE_FAILED,
66  SSH_AUTH_STATE_ERROR,
68  SSH_AUTH_STATE_INFO,
70  SSH_AUTH_STATE_PK_OK,
72  SSH_AUTH_STATE_KBDINT_SENT,
74  SSH_AUTH_STATE_GSSAPI_REQUEST_SENT,
76  SSH_AUTH_STATE_GSSAPI_TOKEN,
78  SSH_AUTH_STATE_GSSAPI_MIC_SENT,
80  SSH_AUTH_STATE_PUBKEY_OFFER_SENT,
82  SSH_AUTH_STATE_PUBKEY_AUTH_SENT,
84  SSH_AUTH_STATE_PASSWORD_AUTH_SENT,
86  SSH_AUTH_STATE_AUTH_NONE_SENT,
87 };
88 
92 enum ssh_auth_service_state_e {
94  SSH_AUTH_SERVICE_NONE=0,
96  SSH_AUTH_SERVICE_SENT,
98  SSH_AUTH_SERVICE_ACCEPTED,
100  SSH_AUTH_SERVICE_DENIED,
101 };
102 
103 #endif /* AUTH_H_ */
Definition: auth.h:37
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition: callbacks.h:527