Path: blob/main/crypto/heimdal/appl/gssmask/protocol.h
34889 views
/*1* Copyright (c) 2006 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of KTH nor the names of its contributors may be17* used to endorse or promote products derived from this software without18* specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR23* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE24* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR25* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF26* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR27* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,28* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR29* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF30* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31*/3233/*34* $Id$35*/3637/* missing from tests:38* - export context39* - import context40*/4142/*43* wire encodings:44* int16: number, 2 bytes, in network order45* int32: number, 4 bytes, in network order46* length-encoded: [int32 length, data of length bytes]47* string: [int32 length, string of length + 1 bytes, includes trailing '\0' ]48*/4950enum gssMaggotErrorCodes {51GSMERR_OK = 0,52GSMERR_ERROR,53GSMERR_CONTINUE_NEEDED,54GSMERR_INVALID_TOKEN,55GSMERR_AP_MODIFIED,56GSMERR_TEST_ISSUE,57GSMERR_NOT_SUPPORTED58};5960/*61* input:62* int32: message OP (enum gssMaggotProtocol)63* ...64*65* return: -- on error66* int32: not support (GSMERR_NOT_SUPPORTED)67*68* return: -- on existing message OP69* int32: support (GSMERR_OK) -- only sent for extensions70* ...71*/7273#define GSSMAGGOTPROTOCOL 147475enum gssMaggotOp {76eGetVersionInfo = 0,77/*78* input:79* none80* return:81* int32: last version handled82*/83eGoodBye,84/*85* input:86* none87* return:88* close socket89*/90eInitContext,91/*92* input:93* int32: hContext94* int32: hCred95* int32: Flags96* the lowest 0x7f flags maps directly to GSS-API flags97* DELEGATE 0x00198* MUTUAL_AUTH 0x00299* REPLAY_DETECT 0x004100* SEQUENCE_DETECT 0x008101* CONFIDENTIALITY 0x010102* INTEGRITY 0x020103* ANONYMOUS 0x040104*105* FIRST_CALL 0x080106*107* NTLM 0x100108* SPNEGO 0x200109* length-encoded: targetname110* length-encoded: token111* return:112* int32: hNewContextId113* int32: gssapi status val114* length-encoded: output token115*/116eAcceptContext,117/*118* input:119* int32: hContext120* int32: Flags -- unused ?121* flags are same as flags for eInitContext122* length-encoded: token123* return:124* int32: hNewContextId125* int32: gssapi status val126* length-encoded: output token127* int32: delegation cred id128*/129eToastResource,130/*131* input:132* int32: hResource133* return:134* int32: gsm status val135*/136eAcquireCreds,137/*138* input:139* string: principal name140* string: password141* int32: flags142* FORWARDABLE 0x001143* DEFAULT_CREDS 0x002144*145* NTLM 0x100146* SPNEGO 0x200147* return:148* int32: gsm status val149* int32: hCred150*/151eEncrypt,152/*153* input:154* int32: hContext155* int32: flags156* int32: seqno -- unused157* length-encode: plaintext158* return:159* int32: gsm status val160* length-encode: ciphertext161*/162eDecrypt,163/*164* input:165* int32: hContext166* int32: flags167* int32: seqno -- unused168* length-encode: ciphertext169* return:170* int32: gsm status val171* length-encode: plaintext172*/173eSign,174/* message same as eEncrypt */175eVerify,176/*177* input:178* int32: hContext179* int32: flags180* int32: seqno -- unused181* length-encode: message182* length-encode: signature183* return:184* int32: gsm status val185*/186eGetVersionAndCapabilities,187/*188* return:189* int32: protocol version190* int32: capability flags */191#define ISSERVER 0x01192#define ISKDC 0x02193#define MS_KERBEROS 0x04194#define LOGSERVER 0x08195#define HAS_MONIKER 0x10196/* string: version string197*/198eGetTargetName,199/*200* return:201* string: target principal name202*/203eSetLoggingSocket,204/*205* input:206* int32: hostPort207* return to the port on the host:208* int32: opcode - for example eLogSetMoniker209*/210eChangePassword,211/* here ended version 7 of the protocol */212/*213* input:214* string: principal name215* string: old password216* string: new password217* return:218* int32: gsm status val219*/220eSetPasswordSelf,221/* same as eChangePassword */222eWrap,223/* message same as eEncrypt */224eUnwrap,225/* message same as eDecrypt */226eConnectLoggingService2,227/*228* return1:229* int16: log port number230* int32: master log prototocol version (0)231*232* wait for master to connect on the master log socket233*234* return2:235* int32: gsm connection status236* int32: maggot log prototocol version (2)237*/238eGetMoniker,239/*240* return:241* string: moniker (Nickname the master can refer to maggot)242*/243eCallExtension,244/*245* input:246* string: extension name247* int32: message id248* return:249* int32: gsm status val250*/251eAcquirePKInitCreds,252/*253* input:254* int32: flags255* length-encode: certificate (pkcs12 data)256* return:257* int32: hResource258* int32: gsm status val (GSMERR_NOT_SUPPORTED)259*/260/* here ended version 7 of the protocol */261eWrapExt,262/*263* input:264* int32: hContext265* int32: flags266* int32: bflags267* length-encode: protocol header268* length-encode: plaintext269* length-encode: protocol trailer270* return:271* int32: gsm status val272* length-encode: ciphertext273*/274eUnwrapExt,275/*276* input:277* int32: hContext278* int32: flags279* int32: bflags280* length-encode: protocol header281* length-encode: ciphertext282* length-encode: protocol trailer283* return:284* int32: gsm status val285* length-encode: plaintext286*/287/* here ended version 8 of the protocol */288289eLastProtocolMessage290};291292/* bflags */293#define WRAP_EXP_ONLY_HEADER 1294295enum gssMaggotLogOp{296eLogInfo = 0,297/*298string: File299int32: Line300string: message301reply:302int32: ackid303*/304eLogFailure,305/*306string: File307int32: Line308string: message309reply:310int32: ackid311*/312eLogSetMoniker313/*314string: moniker315*/316};317318319