libssh 0.5.4

include/libssh/auth.h

00001 /*
00002  * This file is part of the SSH Library
00003  *
00004  * Copyright (c) 2009 by Aris Adamantiadis
00005  *
00006  * The SSH Library is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2.1 of the License, or (at your
00009  * option) any later version.
00010  *
00011  * The SSH Library is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00013  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00014  * License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with the SSH Library; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00019  * MA 02111-1307, USA.
00020  */
00021 
00022 #ifndef AUTH_H_
00023 #define AUTH_H_
00024 #include "config.h"
00025 #include "libssh/callbacks.h"
00026 
00027 SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
00028 SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
00029 SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
00030 SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
00031 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
00032 
00033 #ifdef WITH_SSH1
00034 void ssh_auth1_handler(ssh_session session, uint8_t type);
00035 
00036 /* auth1.c */
00037 int ssh_userauth1_none(ssh_session session, const char *username);
00038 int ssh_userauth1_offer_pubkey(ssh_session session, const char *username,
00039         int type, ssh_string pubkey);
00040 int ssh_userauth1_password(ssh_session session, const char *username,
00041         const char *password);
00042 
00043 
00044 #endif
00045 
00050 enum ssh_auth_state_e {
00052   SSH_AUTH_STATE_NONE=0,
00054   SSH_AUTH_STATE_PARTIAL,
00056   SSH_AUTH_STATE_SUCCESS,
00058   SSH_AUTH_STATE_FAILED,
00060   SSH_AUTH_STATE_ERROR,
00062   SSH_AUTH_STATE_INFO,
00064   SSH_AUTH_STATE_PK_OK,
00066   SSH_AUTH_STATE_KBDINT_SENT
00067 
00068 };
00069 
00073 enum ssh_auth_service_state_e {
00075   SSH_AUTH_SERVICE_NONE=0,
00077   SSH_AUTH_SERVICE_SENT,
00079   SSH_AUTH_SERVICE_ACCEPTED,
00081   SSH_AUTH_SERVICE_DENIED,
00083   SSH_AUTH_SERVICE_USER_SENT
00084 };
00085 
00086 #endif /* AUTH_H_ */