1*0Sstevel@tonic-gate /* $OpenBSD: ssh2.h,v 1.8 2002/03/04 17:27:39 stevesk Exp $ */ 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gate #ifndef _SSH2_H 4*0Sstevel@tonic-gate #define _SSH2_H 5*0Sstevel@tonic-gate 6*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 7*0Sstevel@tonic-gate 8*0Sstevel@tonic-gate #ifdef __cplusplus 9*0Sstevel@tonic-gate extern "C" { 10*0Sstevel@tonic-gate #endif 11*0Sstevel@tonic-gate 12*0Sstevel@tonic-gate 13*0Sstevel@tonic-gate /* 14*0Sstevel@tonic-gate * Copyright (c) 2000 Markus Friedl. All rights reserved. 15*0Sstevel@tonic-gate * 16*0Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 17*0Sstevel@tonic-gate * modification, are permitted provided that the following conditions 18*0Sstevel@tonic-gate * are met: 19*0Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright 20*0Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 21*0Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 22*0Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in the 23*0Sstevel@tonic-gate * documentation and/or other materials provided with the distribution. 24*0Sstevel@tonic-gate * 25*0Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 26*0Sstevel@tonic-gate * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27*0Sstevel@tonic-gate * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28*0Sstevel@tonic-gate * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 29*0Sstevel@tonic-gate * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 30*0Sstevel@tonic-gate * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31*0Sstevel@tonic-gate * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32*0Sstevel@tonic-gate * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33*0Sstevel@tonic-gate * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34*0Sstevel@tonic-gate * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35*0Sstevel@tonic-gate */ 36*0Sstevel@tonic-gate /* 37*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 38*0Sstevel@tonic-gate * Use is subject to license terms. 39*0Sstevel@tonic-gate */ 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gate /* 42*0Sstevel@tonic-gate * draft-ietf-secsh-architecture-05.txt 43*0Sstevel@tonic-gate * 44*0Sstevel@tonic-gate * Transport layer protocol: 45*0Sstevel@tonic-gate * 46*0Sstevel@tonic-gate * 1-19 Transport layer generic (e.g. disconnect, ignore, debug, 47*0Sstevel@tonic-gate * etc) 48*0Sstevel@tonic-gate * 20-29 Algorithm negotiation 49*0Sstevel@tonic-gate * 30-49 Key exchange method specific (numbers can be reused for 50*0Sstevel@tonic-gate * different authentication methods) 51*0Sstevel@tonic-gate * 52*0Sstevel@tonic-gate * User authentication protocol: 53*0Sstevel@tonic-gate * 54*0Sstevel@tonic-gate * 50-59 User authentication generic 55*0Sstevel@tonic-gate * 60-79 User authentication method specific (numbers can be reused 56*0Sstevel@tonic-gate * for different authentication methods) 57*0Sstevel@tonic-gate * 58*0Sstevel@tonic-gate * Connection protocol: 59*0Sstevel@tonic-gate * 60*0Sstevel@tonic-gate * 80-89 Connection protocol generic 61*0Sstevel@tonic-gate * 90-127 Channel related messages 62*0Sstevel@tonic-gate * 63*0Sstevel@tonic-gate * Reserved for client protocols: 64*0Sstevel@tonic-gate * 65*0Sstevel@tonic-gate * 128-191 Reserved 66*0Sstevel@tonic-gate * 67*0Sstevel@tonic-gate * Local extensions: 68*0Sstevel@tonic-gate * 69*0Sstevel@tonic-gate * 192-255 Local extensions 70*0Sstevel@tonic-gate */ 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate /* ranges */ 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate #define SSH2_MSG_TRANSPORT_MIN 1 75*0Sstevel@tonic-gate #define SSH2_MSG_TRANSPORT_MAX 49 76*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_MIN 50 77*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_MAX 79 78*0Sstevel@tonic-gate #define SSH2_MSG_CONNECTION_MIN 80 79*0Sstevel@tonic-gate #define SSH2_MSG_CONNECTION_MAX 127 80*0Sstevel@tonic-gate #define SSH2_MSG_RESERVED_MIN 128 81*0Sstevel@tonic-gate #define SSH2_MSG_RESERVED_MAX 191 82*0Sstevel@tonic-gate #define SSH2_MSG_LOCAL_MIN 192 83*0Sstevel@tonic-gate #define SSH2_MSG_LOCAL_MAX 255 84*0Sstevel@tonic-gate #define SSH2_MSG_MIN 1 85*0Sstevel@tonic-gate #define SSH2_MSG_MAX 255 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gate /* transport layer: generic */ 88*0Sstevel@tonic-gate 89*0Sstevel@tonic-gate #define SSH2_MSG_DISCONNECT 1 90*0Sstevel@tonic-gate #define SSH2_MSG_IGNORE 2 91*0Sstevel@tonic-gate #define SSH2_MSG_UNIMPLEMENTED 3 92*0Sstevel@tonic-gate #define SSH2_MSG_DEBUG 4 93*0Sstevel@tonic-gate #define SSH2_MSG_SERVICE_REQUEST 5 94*0Sstevel@tonic-gate #define SSH2_MSG_SERVICE_ACCEPT 6 95*0Sstevel@tonic-gate 96*0Sstevel@tonic-gate /* transport layer: alg negotiation */ 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gate #define SSH2_MSG_KEXINIT 20 99*0Sstevel@tonic-gate #define SSH2_MSG_NEWKEYS 21 100*0Sstevel@tonic-gate 101*0Sstevel@tonic-gate /* transport layer: kex specific messages, can be reused */ 102*0Sstevel@tonic-gate 103*0Sstevel@tonic-gate #define SSH2_MSG_KEXDH_INIT 30 104*0Sstevel@tonic-gate #define SSH2_MSG_KEXDH_REPLY 31 105*0Sstevel@tonic-gate 106*0Sstevel@tonic-gate /* dh-group-exchange */ 107*0Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REQUEST_OLD 30 108*0Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_GROUP 31 109*0Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_INIT 32 110*0Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REPLY 33 111*0Sstevel@tonic-gate #define SSH2_MSG_KEX_DH_GEX_REQUEST 34 112*0Sstevel@tonic-gate 113*0Sstevel@tonic-gate /* user authentication: generic */ 114*0Sstevel@tonic-gate 115*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_REQUEST 50 116*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_FAILURE 51 117*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_SUCCESS 52 118*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_BANNER 53 119*0Sstevel@tonic-gate 120*0Sstevel@tonic-gate /* user authentication: method specific, can be reused */ 121*0Sstevel@tonic-gate 122*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_PK_OK 60 123*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ 60 124*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_INFO_REQUEST 60 125*0Sstevel@tonic-gate #define SSH2_MSG_USERAUTH_INFO_RESPONSE 61 126*0Sstevel@tonic-gate 127*0Sstevel@tonic-gate /* connection protocol: generic */ 128*0Sstevel@tonic-gate 129*0Sstevel@tonic-gate #define SSH2_MSG_GLOBAL_REQUEST 80 130*0Sstevel@tonic-gate #define SSH2_MSG_REQUEST_SUCCESS 81 131*0Sstevel@tonic-gate #define SSH2_MSG_REQUEST_FAILURE 82 132*0Sstevel@tonic-gate 133*0Sstevel@tonic-gate /* channel related messages */ 134*0Sstevel@tonic-gate 135*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN 90 136*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION 91 137*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_OPEN_FAILURE 92 138*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_WINDOW_ADJUST 93 139*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_DATA 94 140*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_EXTENDED_DATA 95 141*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_EOF 96 142*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_CLOSE 97 143*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_REQUEST 98 144*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_SUCCESS 99 145*0Sstevel@tonic-gate #define SSH2_MSG_CHANNEL_FAILURE 100 146*0Sstevel@tonic-gate 147*0Sstevel@tonic-gate /* ALTPRIVSEP */ 148*0Sstevel@tonic-gate #ifdef ALTPRIVSEP 149*0Sstevel@tonic-gate #define SSH2_PRIV_MSG_ALTPRIVSEP 254 150*0Sstevel@tonic-gate #endif /* ALTPRIVSEP */ 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate /* disconnect reason code */ 153*0Sstevel@tonic-gate 154*0Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 1 155*0Sstevel@tonic-gate #define SSH2_DISCONNECT_PROTOCOL_ERROR 2 156*0Sstevel@tonic-gate #define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED 3 157*0Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED 4 158*0Sstevel@tonic-gate #define SSH2_DISCONNECT_RESERVED 4 159*0Sstevel@tonic-gate #define SSH2_DISCONNECT_MAC_ERROR 5 160*0Sstevel@tonic-gate #define SSH2_DISCONNECT_COMPRESSION_ERROR 6 161*0Sstevel@tonic-gate #define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE 7 162*0Sstevel@tonic-gate #define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8 163*0Sstevel@tonic-gate #define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9 164*0Sstevel@tonic-gate #define SSH2_DISCONNECT_CONNECTION_LOST 10 165*0Sstevel@tonic-gate #define SSH2_DISCONNECT_BY_APPLICATION 11 166*0Sstevel@tonic-gate #define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS 12 167*0Sstevel@tonic-gate #define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER 13 168*0Sstevel@tonic-gate #define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14 169*0Sstevel@tonic-gate #define SSH2_DISCONNECT_ILLEGAL_USER_NAME 15 170*0Sstevel@tonic-gate 171*0Sstevel@tonic-gate /* misc */ 172*0Sstevel@tonic-gate 173*0Sstevel@tonic-gate #define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED 1 174*0Sstevel@tonic-gate #define SSH2_OPEN_CONNECT_FAILED 2 175*0Sstevel@tonic-gate #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE 3 176*0Sstevel@tonic-gate #define SSH2_OPEN_RESOURCE_SHORTAGE 4 177*0Sstevel@tonic-gate 178*0Sstevel@tonic-gate #define SSH2_EXTENDED_DATA_STDERR 1 179*0Sstevel@tonic-gate 180*0Sstevel@tonic-gate #ifdef __cplusplus 181*0Sstevel@tonic-gate } 182*0Sstevel@tonic-gate #endif 183*0Sstevel@tonic-gate 184*0Sstevel@tonic-gate #endif /* _SSH2_H */ 185