libssh  0.5.4
auth.h
1 /*
2  * This file is part of the SSH Library
3  *
4  * Copyright (c) 2009 by Aris Adamantiadis
5  *
6  * The SSH Library is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at your
9  * option) any later version.
10  *
11  * The SSH Library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with the SSH Library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19  * MA 02111-1307, USA.
20  */
21 
22 #ifndef AUTH_H_
23 #define AUTH_H_
24 #include "config.h"
25 #include "libssh/callbacks.h"
26 
27 SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
28 SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
29 SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
30 SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
31 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
32 
33 #ifdef WITH_SSH1
34 void ssh_auth1_handler(ssh_session session, uint8_t type);
35 
36 /* auth1.c */
37 int ssh_userauth1_none(ssh_session session, const char *username);
38 int ssh_userauth1_offer_pubkey(ssh_session session, const char *username,
39  int type, ssh_string pubkey);
40 int ssh_userauth1_password(ssh_session session, const char *username,
41  const char *password);
42 
43 
44 #endif
45 
50 enum ssh_auth_state_e {
52  SSH_AUTH_STATE_NONE=0,
54  SSH_AUTH_STATE_PARTIAL,
56  SSH_AUTH_STATE_SUCCESS,
58  SSH_AUTH_STATE_FAILED,
60  SSH_AUTH_STATE_ERROR,
62  SSH_AUTH_STATE_INFO,
64  SSH_AUTH_STATE_PK_OK,
66  SSH_AUTH_STATE_KBDINT_SENT
67 
68 };
69 
73 enum ssh_auth_service_state_e {
75  SSH_AUTH_SERVICE_NONE=0,
77  SSH_AUTH_SERVICE_SENT,
79  SSH_AUTH_SERVICE_ACCEPTED,
81  SSH_AUTH_SERVICE_DENIED,
83  SSH_AUTH_SERVICE_USER_SENT
84 };
85 
86 #endif /* AUTH_H_ */