libssh: auth.h Source File

libssh 0.11.2 The SSH library

Loading...
Searching...
No Matches
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#ifdef __cplusplus
27extern "C" {
28#endif
29
30 SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
31 SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
32 SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
33 SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
34 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
35 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response);
36
41struct ssh_kbdint_struct {
42 uint32_t nprompts;
43 uint32_t nanswers;
44 char *name;
45 char *instruction;
46 char **prompts;
47 unsigned char *echo; /* bool array */
48 char **answers;
49};
50typedef struct ssh_kbdint_struct* ssh_kbdint;
51
52ssh_kbdint ssh_kbdint_new(void);
53void ssh_kbdint_clean(ssh_kbdint kbd);
54void ssh_kbdint_free(ssh_kbdint kbd);
55
60enum ssh_auth_state_e {
62 SSH_AUTH_STATE_NONE=0,
64 SSH_AUTH_STATE_PARTIAL,
66 SSH_AUTH_STATE_SUCCESS,
68 SSH_AUTH_STATE_FAILED,
70 SSH_AUTH_STATE_ERROR,
72 SSH_AUTH_STATE_INFO,
74 SSH_AUTH_STATE_PK_OK,
76 SSH_AUTH_STATE_KBDINT_SENT,
78 SSH_AUTH_STATE_GSSAPI_REQUEST_SENT,
80 SSH_AUTH_STATE_GSSAPI_TOKEN,
82 SSH_AUTH_STATE_GSSAPI_MIC_SENT,
84 SSH_AUTH_STATE_PUBKEY_OFFER_SENT,
86 SSH_AUTH_STATE_PUBKEY_AUTH_SENT,
88 SSH_AUTH_STATE_PASSWORD_AUTH_SENT,
90 SSH_AUTH_STATE_AUTH_NONE_SENT,
91};
92
96enum ssh_auth_service_state_e {
98 SSH_AUTH_SERVICE_NONE=0,
100 SSH_AUTH_SERVICE_SENT,
102 SSH_AUTH_SERVICE_ACCEPTED,
104 SSH_AUTH_SERVICE_DENIED,
105};
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* AUTH_H_ */
SSH_PACKET_CALLBACK
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition callbacks.h:560