blob: fe0146cbdb9fac0d3b0e767364d409cb6b5c4893 [file] [log] [blame]
Damien Millerb38eff82000-04-01 11:09:21 +10001/*
Damien Millere4340be2000-09-16 13:29:08 +11002 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25/*
Damien Millerdcb6ecd2000-05-17 22:34:22 +100026 * draft-ietf-secsh-architecture-05.txt
Damien Millerb38eff82000-04-01 11:09:21 +100027 *
28 * Transport layer protocol:
Damien Miller4af51302000-04-16 11:18:38 +100029 *
Damien Millerb38eff82000-04-01 11:09:21 +100030 * 1-19 Transport layer generic (e.g. disconnect, ignore, debug,
31 * etc)
32 * 20-29 Algorithm negotiation
33 * 30-49 Key exchange method specific (numbers can be reused for
34 * different authentication methods)
Damien Miller4af51302000-04-16 11:18:38 +100035 *
Damien Millerb38eff82000-04-01 11:09:21 +100036 * User authentication protocol:
Damien Miller4af51302000-04-16 11:18:38 +100037 *
Damien Millerb38eff82000-04-01 11:09:21 +100038 * 50-59 User authentication generic
39 * 60-79 User authentication method specific (numbers can be reused
40 * for different authentication methods)
Damien Miller4af51302000-04-16 11:18:38 +100041 *
Damien Millerb38eff82000-04-01 11:09:21 +100042 * Connection protocol:
Damien Miller4af51302000-04-16 11:18:38 +100043 *
Damien Millerb38eff82000-04-01 11:09:21 +100044 * 80-89 Connection protocol generic
45 * 90-127 Channel related messages
Damien Miller4af51302000-04-16 11:18:38 +100046 *
Damien Millerb38eff82000-04-01 11:09:21 +100047 * Reserved for client protocols:
Damien Miller4af51302000-04-16 11:18:38 +100048 *
Damien Millerb38eff82000-04-01 11:09:21 +100049 * 128-191 Reserved
Damien Miller4af51302000-04-16 11:18:38 +100050 *
Damien Millerb38eff82000-04-01 11:09:21 +100051 * Local extensions:
Damien Miller4af51302000-04-16 11:18:38 +100052 *
Damien Millerb38eff82000-04-01 11:09:21 +100053 * 192-255 Local extensions
54 */
Damien Miller874d77b2000-10-14 16:23:11 +110055/* RCSID("$OpenBSD: ssh2.h,v 1.5 2000/10/11 04:02:17 provos Exp $"); */
Damien Millerb38eff82000-04-01 11:09:21 +100056
57/* transport layer: generic */
58
59#define SSH2_MSG_DISCONNECT 1
60#define SSH2_MSG_IGNORE 2
61#define SSH2_MSG_UNIMPLEMENTED 3
62#define SSH2_MSG_DEBUG 4
63#define SSH2_MSG_SERVICE_REQUEST 5
64#define SSH2_MSG_SERVICE_ACCEPT 6
65
66/* transport layer: alg negotiation */
67
68#define SSH2_MSG_KEXINIT 20
69#define SSH2_MSG_NEWKEYS 21
70
71/* transport layer: kex specific messages, can be reused */
72
73#define SSH2_MSG_KEXDH_INIT 30
74#define SSH2_MSG_KEXDH_REPLY 31
75
Damien Miller874d77b2000-10-14 16:23:11 +110076/* dh-group-exchange */
77#define SSH2_MSG_KEX_DH_GEX_REQUEST 30
78#define SSH2_MSG_KEX_DH_GEX_GROUP 31
79#define SSH2_MSG_KEX_DH_GEX_INIT 32
80#define SSH2_MSG_KEX_DH_GEX_REPLY 33
81
Damien Millerb38eff82000-04-01 11:09:21 +100082/* user authentication: generic */
83
84#define SSH2_MSG_USERAUTH_REQUEST 50
85#define SSH2_MSG_USERAUTH_FAILURE 51
86#define SSH2_MSG_USERAUTH_SUCCESS 52
87#define SSH2_MSG_USERAUTH_BANNER 53
88
89/* user authentication: method specific, can be reused */
90
91#define SSH2_MSG_USERAUTH_PK_OK 60
92#define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ 60
93#define SSH2_MSG_USERAUTH_INFO_REQUEST 60
94#define SSH2_MSG_USERAUTH_INFO_RESPONSE 61
95
96/* connection protocol: generic */
97
98#define SSH2_MSG_GLOBAL_REQUEST 80
99#define SSH2_MSG_REQUEST_SUCCESS 81
100#define SSH2_MSG_REQUEST_FAILURE 82
101
102/* channel related messages */
103
104#define SSH2_MSG_CHANNEL_OPEN 90
105#define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION 91
106#define SSH2_MSG_CHANNEL_OPEN_FAILURE 92
107#define SSH2_MSG_CHANNEL_WINDOW_ADJUST 93
108#define SSH2_MSG_CHANNEL_DATA 94
109#define SSH2_MSG_CHANNEL_EXTENDED_DATA 95
110#define SSH2_MSG_CHANNEL_EOF 96
111#define SSH2_MSG_CHANNEL_CLOSE 97
112#define SSH2_MSG_CHANNEL_REQUEST 98
113#define SSH2_MSG_CHANNEL_SUCCESS 99
114#define SSH2_MSG_CHANNEL_FAILURE 100
115
116/* disconnect reason code */
117
118#define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 1
119#define SSH2_DISCONNECT_PROTOCOL_ERROR 2
120#define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED 3
121#define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED 4
Damien Millerdcb6ecd2000-05-17 22:34:22 +1000122#define SSH2_DISCONNECT_RESERVED 4
Damien Millerb38eff82000-04-01 11:09:21 +1000123#define SSH2_DISCONNECT_MAC_ERROR 5
124#define SSH2_DISCONNECT_COMPRESSION_ERROR 6
125#define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE 7
126#define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8
127#define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9
128#define SSH2_DISCONNECT_CONNECTION_LOST 10
129#define SSH2_DISCONNECT_BY_APPLICATION 11
Damien Millerdcb6ecd2000-05-17 22:34:22 +1000130#define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS 12
131#define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER 13
132#define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14
133#define SSH2_DISCONNECT_ILLEGAL_USER_NAME 15
Damien Millerb38eff82000-04-01 11:09:21 +1000134
135/* misc */
136
137#define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED 1
138#define SSH2_OPEN_CONNECT_FAILED 2
139#define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE 3
140#define SSH2_OPEN_RESOURCE_SHORTAGE 4
141
142#define SSH2_EXTENDED_DATA_STDERR 1