blob: 091e52b139f1ea65a3341394825f57b87b8d9c33 [file] [log] [blame]
Ben Lindstrom05764b92002-03-05 01:53:02 +00001/* $OpenBSD: ssh2.h,v 1.8 2002/03/04 17:27:39 stevesk Exp $ */
2
Damien Millerb38eff82000-04-01 11:09:21 +10003/*
Damien Millere4340be2000-09-16 13:29:08 +11004 * Copyright (c) 2000 Markus Friedl. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/*
Damien Millerdcb6ecd2000-05-17 22:34:22 +100028 * draft-ietf-secsh-architecture-05.txt
Damien Millerb38eff82000-04-01 11:09:21 +100029 *
30 * Transport layer protocol:
Damien Miller4af51302000-04-16 11:18:38 +100031 *
Damien Millerb38eff82000-04-01 11:09:21 +100032 * 1-19 Transport layer generic (e.g. disconnect, ignore, debug,
33 * etc)
34 * 20-29 Algorithm negotiation
35 * 30-49 Key exchange method specific (numbers can be reused for
36 * different authentication methods)
Damien Miller4af51302000-04-16 11:18:38 +100037 *
Damien Millerb38eff82000-04-01 11:09:21 +100038 * User authentication protocol:
Damien Miller4af51302000-04-16 11:18:38 +100039 *
Damien Millerb38eff82000-04-01 11:09:21 +100040 * 50-59 User authentication generic
41 * 60-79 User authentication method specific (numbers can be reused
42 * for different authentication methods)
Damien Miller4af51302000-04-16 11:18:38 +100043 *
Damien Millerb38eff82000-04-01 11:09:21 +100044 * Connection protocol:
Damien Miller4af51302000-04-16 11:18:38 +100045 *
Damien Millerb38eff82000-04-01 11:09:21 +100046 * 80-89 Connection protocol generic
47 * 90-127 Channel related messages
Damien Miller4af51302000-04-16 11:18:38 +100048 *
Damien Millerb38eff82000-04-01 11:09:21 +100049 * Reserved for client protocols:
Damien Miller4af51302000-04-16 11:18:38 +100050 *
Damien Millerb38eff82000-04-01 11:09:21 +100051 * 128-191 Reserved
Damien Miller4af51302000-04-16 11:18:38 +100052 *
Damien Millerb38eff82000-04-01 11:09:21 +100053 * Local extensions:
Damien Miller4af51302000-04-16 11:18:38 +100054 *
Damien Millerb38eff82000-04-01 11:09:21 +100055 * 192-255 Local extensions
56 */
Damien Miller84b8ab32002-01-22 23:23:41 +110057
58/* ranges */
59
60#define SSH2_MSG_TRANSPORT_MIN 1
61#define SSH2_MSG_TRANSPORT_MAX 49
62#define SSH2_MSG_USERAUTH_MIN 50
63#define SSH2_MSG_USERAUTH_MAX 79
64#define SSH2_MSG_CONNECTION_MIN 80
65#define SSH2_MSG_CONNECTION_MAX 127
66#define SSH2_MSG_RESERVED_MIN 128
67#define SSH2_MSG_RESERVED_MAX 191
68#define SSH2_MSG_LOCAL_MIN 192
69#define SSH2_MSG_LOCAL_MAX 255
70#define SSH2_MSG_MIN 1
71#define SSH2_MSG_MAX 255
Damien Millerb38eff82000-04-01 11:09:21 +100072
73/* transport layer: generic */
74
75#define SSH2_MSG_DISCONNECT 1
76#define SSH2_MSG_IGNORE 2
77#define SSH2_MSG_UNIMPLEMENTED 3
78#define SSH2_MSG_DEBUG 4
79#define SSH2_MSG_SERVICE_REQUEST 5
80#define SSH2_MSG_SERVICE_ACCEPT 6
81
82/* transport layer: alg negotiation */
83
84#define SSH2_MSG_KEXINIT 20
85#define SSH2_MSG_NEWKEYS 21
86
87/* transport layer: kex specific messages, can be reused */
88
89#define SSH2_MSG_KEXDH_INIT 30
90#define SSH2_MSG_KEXDH_REPLY 31
91
Damien Miller874d77b2000-10-14 16:23:11 +110092/* dh-group-exchange */
Ben Lindstromdf221392001-03-29 00:36:16 +000093#define SSH2_MSG_KEX_DH_GEX_REQUEST_OLD 30
Damien Miller874d77b2000-10-14 16:23:11 +110094#define SSH2_MSG_KEX_DH_GEX_GROUP 31
95#define SSH2_MSG_KEX_DH_GEX_INIT 32
96#define SSH2_MSG_KEX_DH_GEX_REPLY 33
Ben Lindstromdf221392001-03-29 00:36:16 +000097#define SSH2_MSG_KEX_DH_GEX_REQUEST 34
Damien Miller874d77b2000-10-14 16:23:11 +110098
Damien Millerb38eff82000-04-01 11:09:21 +100099/* user authentication: generic */
100
101#define SSH2_MSG_USERAUTH_REQUEST 50
102#define SSH2_MSG_USERAUTH_FAILURE 51
103#define SSH2_MSG_USERAUTH_SUCCESS 52
104#define SSH2_MSG_USERAUTH_BANNER 53
105
106/* user authentication: method specific, can be reused */
107
108#define SSH2_MSG_USERAUTH_PK_OK 60
109#define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ 60
110#define SSH2_MSG_USERAUTH_INFO_REQUEST 60
111#define SSH2_MSG_USERAUTH_INFO_RESPONSE 61
112
113/* connection protocol: generic */
114
115#define SSH2_MSG_GLOBAL_REQUEST 80
116#define SSH2_MSG_REQUEST_SUCCESS 81
117#define SSH2_MSG_REQUEST_FAILURE 82
118
119/* channel related messages */
120
121#define SSH2_MSG_CHANNEL_OPEN 90
122#define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION 91
123#define SSH2_MSG_CHANNEL_OPEN_FAILURE 92
124#define SSH2_MSG_CHANNEL_WINDOW_ADJUST 93
125#define SSH2_MSG_CHANNEL_DATA 94
126#define SSH2_MSG_CHANNEL_EXTENDED_DATA 95
127#define SSH2_MSG_CHANNEL_EOF 96
128#define SSH2_MSG_CHANNEL_CLOSE 97
129#define SSH2_MSG_CHANNEL_REQUEST 98
130#define SSH2_MSG_CHANNEL_SUCCESS 99
131#define SSH2_MSG_CHANNEL_FAILURE 100
132
133/* disconnect reason code */
134
135#define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 1
136#define SSH2_DISCONNECT_PROTOCOL_ERROR 2
137#define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED 3
138#define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED 4
Damien Millerdcb6ecd2000-05-17 22:34:22 +1000139#define SSH2_DISCONNECT_RESERVED 4
Damien Millerb38eff82000-04-01 11:09:21 +1000140#define SSH2_DISCONNECT_MAC_ERROR 5
141#define SSH2_DISCONNECT_COMPRESSION_ERROR 6
142#define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE 7
143#define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8
144#define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9
145#define SSH2_DISCONNECT_CONNECTION_LOST 10
146#define SSH2_DISCONNECT_BY_APPLICATION 11
Damien Millerdcb6ecd2000-05-17 22:34:22 +1000147#define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS 12
148#define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER 13
149#define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14
150#define SSH2_DISCONNECT_ILLEGAL_USER_NAME 15
Damien Millerb38eff82000-04-01 11:09:21 +1000151
152/* misc */
153
154#define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED 1
155#define SSH2_OPEN_CONNECT_FAILED 2
156#define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE 3
157#define SSH2_OPEN_RESOURCE_SHORTAGE 4
158
159#define SSH2_EXTENDED_DATA_STDERR 1