auth.h
/*
* This file is part of the SSH Library
*
* Copyright (c) 2009 by Aris Adamantiadis
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AUTH_H_
#define AUTH_H_
#include "config.h"
#include "libssh/callbacks.h"
SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response);
struct ssh_kbdint_struct {
uint32_t nprompts;
uint32_t nanswers;
char *name;
char *instruction;
char **prompts;
unsigned char *echo; /* bool array */
char **answers;
};
typedef struct ssh_kbdint_struct* ssh_kbdint;
ssh_kbdint ssh_kbdint_new(void);
void ssh_kbdint_clean(ssh_kbdint kbd);
void ssh_kbdint_free(ssh_kbdint kbd);
enum ssh_auth_state_e {
SSH_AUTH_STATE_NONE=0,
SSH_AUTH_STATE_PARTIAL,
SSH_AUTH_STATE_SUCCESS,
SSH_AUTH_STATE_FAILED,
SSH_AUTH_STATE_ERROR,
SSH_AUTH_STATE_INFO,
SSH_AUTH_STATE_PK_OK,
SSH_AUTH_STATE_KBDINT_SENT,
SSH_AUTH_STATE_GSSAPI_REQUEST_SENT,
SSH_AUTH_STATE_GSSAPI_TOKEN,
SSH_AUTH_STATE_GSSAPI_MIC_SENT,
SSH_AUTH_STATE_PUBKEY_OFFER_SENT,
SSH_AUTH_STATE_PUBKEY_AUTH_SENT,
SSH_AUTH_STATE_PASSWORD_AUTH_SENT,
SSH_AUTH_STATE_AUTH_NONE_SENT,
};
enum ssh_auth_service_state_e {
SSH_AUTH_SERVICE_NONE=0,
SSH_AUTH_SERVICE_SENT,
SSH_AUTH_SERVICE_ACCEPTED,
SSH_AUTH_SERVICE_DENIED,
};
#endif /* AUTH_H_ */
SSH_PACKET_CALLBACK
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition: callbacks.h:527
ssh_kbdint_struct
Definition: auth.h:37