Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 1 | /* $OpenBSD: ssh2.h,v 1.14 2010/08/31 11:54:45 djm Exp $ */ |
Ben Lindstrom | 05764b9 | 2002-03-05 01:53:02 +0000 | [diff] [blame] | 2 | |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 3 | /* |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 4 | * 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 Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 28 | * draft-ietf-secsh-architecture-05.txt |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 29 | * |
| 30 | * Transport layer protocol: |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 31 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 32 | * 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 Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 37 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 38 | * User authentication protocol: |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 39 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 40 | * 50-59 User authentication generic |
| 41 | * 60-79 User authentication method specific (numbers can be reused |
| 42 | * for different authentication methods) |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 43 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 44 | * Connection protocol: |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 45 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 46 | * 80-89 Connection protocol generic |
| 47 | * 90-127 Channel related messages |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 48 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 49 | * Reserved for client protocols: |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 50 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 51 | * 128-191 Reserved |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 52 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 53 | * Local extensions: |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 54 | * |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 55 | * 192-255 Local extensions |
| 56 | */ |
Damien Miller | 84b8ab3 | 2002-01-22 23:23:41 +1100 | [diff] [blame] | 57 | |
| 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 |
Damien Miller | f84cc63 | 2003-05-14 13:46:53 +1000 | [diff] [blame] | 64 | #define SSH2_MSG_USERAUTH_PER_METHOD_MIN 60 |
| 65 | #define SSH2_MSG_USERAUTH_PER_METHOD_MAX SSH2_MSG_USERAUTH_MAX |
Damien Miller | 84b8ab3 | 2002-01-22 23:23:41 +1100 | [diff] [blame] | 66 | #define SSH2_MSG_CONNECTION_MIN 80 |
| 67 | #define SSH2_MSG_CONNECTION_MAX 127 |
| 68 | #define SSH2_MSG_RESERVED_MIN 128 |
| 69 | #define SSH2_MSG_RESERVED_MAX 191 |
| 70 | #define SSH2_MSG_LOCAL_MIN 192 |
| 71 | #define SSH2_MSG_LOCAL_MAX 255 |
| 72 | #define SSH2_MSG_MIN 1 |
| 73 | #define SSH2_MSG_MAX 255 |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 74 | |
| 75 | /* transport layer: generic */ |
| 76 | |
| 77 | #define SSH2_MSG_DISCONNECT 1 |
| 78 | #define SSH2_MSG_IGNORE 2 |
| 79 | #define SSH2_MSG_UNIMPLEMENTED 3 |
| 80 | #define SSH2_MSG_DEBUG 4 |
| 81 | #define SSH2_MSG_SERVICE_REQUEST 5 |
| 82 | #define SSH2_MSG_SERVICE_ACCEPT 6 |
| 83 | |
| 84 | /* transport layer: alg negotiation */ |
| 85 | |
| 86 | #define SSH2_MSG_KEXINIT 20 |
| 87 | #define SSH2_MSG_NEWKEYS 21 |
| 88 | |
| 89 | /* transport layer: kex specific messages, can be reused */ |
| 90 | |
| 91 | #define SSH2_MSG_KEXDH_INIT 30 |
| 92 | #define SSH2_MSG_KEXDH_REPLY 31 |
| 93 | |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 94 | /* dh-group-exchange */ |
Ben Lindstrom | df22139 | 2001-03-29 00:36:16 +0000 | [diff] [blame] | 95 | #define SSH2_MSG_KEX_DH_GEX_REQUEST_OLD 30 |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 96 | #define SSH2_MSG_KEX_DH_GEX_GROUP 31 |
| 97 | #define SSH2_MSG_KEX_DH_GEX_INIT 32 |
| 98 | #define SSH2_MSG_KEX_DH_GEX_REPLY 33 |
Ben Lindstrom | df22139 | 2001-03-29 00:36:16 +0000 | [diff] [blame] | 99 | #define SSH2_MSG_KEX_DH_GEX_REQUEST 34 |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 100 | |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 101 | /* ecdh */ |
| 102 | #define SSH2_MSG_KEX_ECDH_INIT 30 |
| 103 | #define SSH2_MSG_KEX_ECDH_REPLY 31 |
| 104 | |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 105 | /* user authentication: generic */ |
| 106 | |
| 107 | #define SSH2_MSG_USERAUTH_REQUEST 50 |
| 108 | #define SSH2_MSG_USERAUTH_FAILURE 51 |
| 109 | #define SSH2_MSG_USERAUTH_SUCCESS 52 |
| 110 | #define SSH2_MSG_USERAUTH_BANNER 53 |
| 111 | |
| 112 | /* user authentication: method specific, can be reused */ |
| 113 | |
| 114 | #define SSH2_MSG_USERAUTH_PK_OK 60 |
| 115 | #define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ 60 |
| 116 | #define SSH2_MSG_USERAUTH_INFO_REQUEST 60 |
| 117 | #define SSH2_MSG_USERAUTH_INFO_RESPONSE 61 |
Damien Miller | 01ed227 | 2008-11-05 16:20:46 +1100 | [diff] [blame] | 118 | #define SSH2_MSG_USERAUTH_JPAKE_CLIENT_STEP1 60 |
| 119 | #define SSH2_MSG_USERAUTH_JPAKE_SERVER_STEP1 61 |
| 120 | #define SSH2_MSG_USERAUTH_JPAKE_CLIENT_STEP2 62 |
| 121 | #define SSH2_MSG_USERAUTH_JPAKE_SERVER_STEP2 63 |
| 122 | #define SSH2_MSG_USERAUTH_JPAKE_CLIENT_CONFIRM 64 |
| 123 | #define SSH2_MSG_USERAUTH_JPAKE_SERVER_CONFIRM 65 |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 124 | |
| 125 | /* connection protocol: generic */ |
| 126 | |
| 127 | #define SSH2_MSG_GLOBAL_REQUEST 80 |
| 128 | #define SSH2_MSG_REQUEST_SUCCESS 81 |
| 129 | #define SSH2_MSG_REQUEST_FAILURE 82 |
| 130 | |
| 131 | /* channel related messages */ |
| 132 | |
| 133 | #define SSH2_MSG_CHANNEL_OPEN 90 |
| 134 | #define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION 91 |
| 135 | #define SSH2_MSG_CHANNEL_OPEN_FAILURE 92 |
| 136 | #define SSH2_MSG_CHANNEL_WINDOW_ADJUST 93 |
| 137 | #define SSH2_MSG_CHANNEL_DATA 94 |
| 138 | #define SSH2_MSG_CHANNEL_EXTENDED_DATA 95 |
| 139 | #define SSH2_MSG_CHANNEL_EOF 96 |
| 140 | #define SSH2_MSG_CHANNEL_CLOSE 97 |
| 141 | #define SSH2_MSG_CHANNEL_REQUEST 98 |
| 142 | #define SSH2_MSG_CHANNEL_SUCCESS 99 |
| 143 | #define SSH2_MSG_CHANNEL_FAILURE 100 |
| 144 | |
| 145 | /* disconnect reason code */ |
| 146 | |
| 147 | #define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 1 |
| 148 | #define SSH2_DISCONNECT_PROTOCOL_ERROR 2 |
| 149 | #define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED 3 |
| 150 | #define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED 4 |
Damien Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 151 | #define SSH2_DISCONNECT_RESERVED 4 |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 152 | #define SSH2_DISCONNECT_MAC_ERROR 5 |
| 153 | #define SSH2_DISCONNECT_COMPRESSION_ERROR 6 |
| 154 | #define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE 7 |
| 155 | #define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8 |
| 156 | #define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9 |
| 157 | #define SSH2_DISCONNECT_CONNECTION_LOST 10 |
| 158 | #define SSH2_DISCONNECT_BY_APPLICATION 11 |
Damien Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 159 | #define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS 12 |
| 160 | #define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER 13 |
| 161 | #define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14 |
| 162 | #define SSH2_DISCONNECT_ILLEGAL_USER_NAME 15 |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 163 | |
| 164 | /* misc */ |
| 165 | |
| 166 | #define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED 1 |
| 167 | #define SSH2_OPEN_CONNECT_FAILED 2 |
| 168 | #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE 3 |
| 169 | #define SSH2_OPEN_RESOURCE_SHORTAGE 4 |
| 170 | |
| 171 | #define SSH2_EXTENDED_DATA_STDERR 1 |
Damien Miller | 01ed227 | 2008-11-05 16:20:46 +1100 | [diff] [blame] | 172 | |
Darren Tucker | f9e6eb8 | 2010-01-08 16:52:32 +1100 | [diff] [blame] | 173 | /* kex messages for resume@appgate.com */ |
| 174 | #define SSH2_MSG_KEX_ROAMING_RESUME 30 |
| 175 | #define SSH2_MSG_KEX_ROAMING_AUTH_REQUIRED 31 |
| 176 | #define SSH2_MSG_KEX_ROAMING_AUTH 32 |
| 177 | #define SSH2_MSG_KEX_ROAMING_AUTH_OK 33 |
| 178 | #define SSH2_MSG_KEX_ROAMING_AUTH_FAIL 34 |
| 179 | |
Damien Miller | 0a80ca1 | 2010-02-27 07:55:05 +1100 | [diff] [blame] | 180 | /* Certificate types for OpenSSH certificate keys extension */ |
| 181 | #define SSH2_CERT_TYPE_USER 1 |
| 182 | #define SSH2_CERT_TYPE_HOST 2 |