libssh: /build/libssh/src/libssh-0.12.1/include/libssh/auth.h Source File

libssh 0.12.1 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);
55int ssh_userauth_gssapi_keyex(ssh_session session);
56
61enum ssh_auth_state_e {
63 SSH_AUTH_STATE_NONE = 0,
65 SSH_AUTH_STATE_PARTIAL,
67 SSH_AUTH_STATE_SUCCESS,
69 SSH_AUTH_STATE_FAILED,
71 SSH_AUTH_STATE_ERROR,
73 SSH_AUTH_STATE_INFO,
75 SSH_AUTH_STATE_PK_OK,
77 SSH_AUTH_STATE_KBDINT_SENT,
79 SSH_AUTH_STATE_GSSAPI_REQUEST_SENT,
81 SSH_AUTH_STATE_GSSAPI_TOKEN,
83 SSH_AUTH_STATE_GSSAPI_MIC_SENT,
85 SSH_AUTH_STATE_PUBKEY_OFFER_SENT,
87 SSH_AUTH_STATE_PUBKEY_AUTH_SENT,
89 SSH_AUTH_STATE_PASSWORD_AUTH_SENT,
91 SSH_AUTH_STATE_AUTH_NONE_SENT,
93 SSH_AUTH_STATE_GSSAPI_KEYEX_MIC_SENT,
94};
95
99enum ssh_auth_service_state_e {
101 SSH_AUTH_SERVICE_NONE=0,
103 SSH_AUTH_SERVICE_SENT,
105 SSH_AUTH_SERVICE_ACCEPTED,
107 SSH_AUTH_SERVICE_DENIED,
108};
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* AUTH_H_ */
ssh_userauth_gssapi_keyex
int ssh_userauth_gssapi_keyex(ssh_session session)
Try to authenticate through the "gssapi-keyex" method.
Definition auth.c:2487
SSH_PACKET_CALLBACK
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition callbacks.h:625