[BACK]Return to ssh2.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/ssh2.h, Revision 1.21

1.21    ! djm         1: /* $OpenBSD: ssh2.h,v 1.20 2023/08/14 03:37:00 djm Exp $ */
1.8       stevesk     2:
1.1       markus      3: /*
1.4       deraadt     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: /*
1.19      dtucker    28:  * RFC4251:
1.1       markus     29:  *
                     30:  *   Transport layer protocol:
1.2       markus     31:  *
1.1       markus     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)
1.2       markus     37:  *
1.1       markus     38:  *   User authentication protocol:
1.2       markus     39:  *
1.1       markus     40:  *     50-59    User authentication generic
                     41:  *     60-79    User authentication method specific (numbers can be reused
                     42:  *              for different authentication methods)
1.2       markus     43:  *
1.1       markus     44:  *   Connection protocol:
1.2       markus     45:  *
1.1       markus     46:  *     80-89    Connection protocol generic
                     47:  *     90-127   Channel related messages
1.2       markus     48:  *
1.1       markus     49:  *   Reserved for client protocols:
1.2       markus     50:  *
1.1       markus     51:  *     128-191  Reserved
1.2       markus     52:  *
1.1       markus     53:  *   Local extensions:
1.2       markus     54:  *
1.1       markus     55:  *     192-255  Local extensions
                     56:  */
1.18      markus     57:
                     58: /* special marker for no message */
                     59:
                     60: #define SSH_MSG_NONE                                   0
1.7       markus     61:
                     62: /* ranges */
                     63:
                     64: #define SSH2_MSG_TRANSPORT_MIN                         1
                     65: #define SSH2_MSG_TRANSPORT_MAX                         49
                     66: #define SSH2_MSG_USERAUTH_MIN                          50
                     67: #define SSH2_MSG_USERAUTH_MAX                          79
1.9       markus     68: #define SSH2_MSG_USERAUTH_PER_METHOD_MIN               60
                     69: #define SSH2_MSG_USERAUTH_PER_METHOD_MAX               SSH2_MSG_USERAUTH_MAX
1.7       markus     70: #define SSH2_MSG_CONNECTION_MIN                                80
                     71: #define SSH2_MSG_CONNECTION_MAX                                127
                     72: #define SSH2_MSG_RESERVED_MIN                          128
                     73: #define SSH2_MSG_RESERVED_MAX                          191
                     74: #define SSH2_MSG_LOCAL_MIN                             192
                     75: #define SSH2_MSG_LOCAL_MAX                             255
                     76: #define SSH2_MSG_MIN                                   1
                     77: #define SSH2_MSG_MAX                                   255
1.1       markus     78:
                     79: /* transport layer: generic */
                     80:
                     81: #define SSH2_MSG_DISCONNECT                            1
                     82: #define SSH2_MSG_IGNORE                                        2
                     83: #define SSH2_MSG_UNIMPLEMENTED                         3
                     84: #define SSH2_MSG_DEBUG                                 4
                     85: #define SSH2_MSG_SERVICE_REQUEST                       5
                     86: #define SSH2_MSG_SERVICE_ACCEPT                                6
1.16      markus     87: #define SSH2_MSG_EXT_INFO                              7
1.20      djm        88: #define SSH2_MSG_NEWCOMPRESS                           8
1.1       markus     89:
                     90: /* transport layer: alg negotiation */
                     91:
                     92: #define SSH2_MSG_KEXINIT                               20
                     93: #define SSH2_MSG_NEWKEYS                               21
                     94:
                     95: /* transport layer: kex specific messages, can be reused */
                     96:
                     97: #define SSH2_MSG_KEXDH_INIT                            30
                     98: #define SSH2_MSG_KEXDH_REPLY                           31
1.5       provos     99:
                    100: /* dh-group-exchange */
1.6       provos    101: #define SSH2_MSG_KEX_DH_GEX_REQUEST_OLD                        30
1.5       provos    102: #define SSH2_MSG_KEX_DH_GEX_GROUP                      31
                    103: #define SSH2_MSG_KEX_DH_GEX_INIT                       32
                    104: #define SSH2_MSG_KEX_DH_GEX_REPLY                      33
1.6       provos    105: #define SSH2_MSG_KEX_DH_GEX_REQUEST                    34
1.14      djm       106:
                    107: /* ecdh */
                    108: #define SSH2_MSG_KEX_ECDH_INIT                         30
                    109: #define SSH2_MSG_KEX_ECDH_REPLY                                31
1.21    ! djm       110:
        !           111: /* transport layer: OpenSSH extensions */
        !           112: #define SSH2_MSG_PING                                  192
        !           113: #define SSH2_MSG_PONG                                  193
1.1       markus    114:
                    115: /* user authentication: generic */
                    116:
                    117: #define SSH2_MSG_USERAUTH_REQUEST                      50
                    118: #define SSH2_MSG_USERAUTH_FAILURE                      51
                    119: #define SSH2_MSG_USERAUTH_SUCCESS                      52
                    120: #define SSH2_MSG_USERAUTH_BANNER                       53
                    121:
                    122: /* user authentication: method specific, can be reused */
                    123:
                    124: #define SSH2_MSG_USERAUTH_PK_OK                                60
                    125: #define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ             60
                    126: #define SSH2_MSG_USERAUTH_INFO_REQUEST                 60
                    127: #define SSH2_MSG_USERAUTH_INFO_RESPONSE                        61
                    128:
                    129: /* connection protocol: generic */
                    130:
                    131: #define SSH2_MSG_GLOBAL_REQUEST                                80
                    132: #define SSH2_MSG_REQUEST_SUCCESS                       81
                    133: #define SSH2_MSG_REQUEST_FAILURE                       82
                    134:
                    135: /* channel related messages */
                    136:
                    137: #define SSH2_MSG_CHANNEL_OPEN                          90
                    138: #define SSH2_MSG_CHANNEL_OPEN_CONFIRMATION             91
                    139: #define SSH2_MSG_CHANNEL_OPEN_FAILURE                  92
                    140: #define SSH2_MSG_CHANNEL_WINDOW_ADJUST                 93
                    141: #define SSH2_MSG_CHANNEL_DATA                          94
                    142: #define SSH2_MSG_CHANNEL_EXTENDED_DATA                 95
                    143: #define SSH2_MSG_CHANNEL_EOF                           96
                    144: #define SSH2_MSG_CHANNEL_CLOSE                         97
                    145: #define SSH2_MSG_CHANNEL_REQUEST                       98
                    146: #define SSH2_MSG_CHANNEL_SUCCESS                       99
                    147: #define SSH2_MSG_CHANNEL_FAILURE                       100
                    148:
                    149: /* disconnect reason code */
                    150:
                    151: #define SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT    1
                    152: #define SSH2_DISCONNECT_PROTOCOL_ERROR                 2
                    153: #define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED            3
                    154: #define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED     4
1.3       markus    155: #define SSH2_DISCONNECT_RESERVED                       4
1.1       markus    156: #define SSH2_DISCONNECT_MAC_ERROR                      5
                    157: #define SSH2_DISCONNECT_COMPRESSION_ERROR              6
                    158: #define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE          7
                    159: #define SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8
                    160: #define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE                9
                    161: #define SSH2_DISCONNECT_CONNECTION_LOST                        10
                    162: #define SSH2_DISCONNECT_BY_APPLICATION                 11
1.3       markus    163: #define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS           12
                    164: #define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER         13
                    165: #define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14
                    166: #define SSH2_DISCONNECT_ILLEGAL_USER_NAME              15
1.1       markus    167:
                    168: /* misc */
                    169:
                    170: #define SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED          1
                    171: #define SSH2_OPEN_CONNECT_FAILED                       2
                    172: #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE                 3
                    173: #define SSH2_OPEN_RESOURCE_SHORTAGE                    4
                    174:
                    175: #define SSH2_EXTENDED_DATA_STDERR                      1
1.11      djm       176:
1.13      djm       177: /* Certificate types for OpenSSH certificate keys extension */
                    178: #define SSH2_CERT_TYPE_USER                            1
                    179: #define SSH2_CERT_TYPE_HOST                            2