krb5ssp

package
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	TokenIdKrb5APReq uint16 = 1
	TokenIdKrb5APRep uint16 = 2
	TokenIdKrb5Error uint16 = 3
)

Possible values for the KRB5Token struct's TokenId field

View Source
const (
	APOptionUseSessionKey  = 1
	APOptionMutualRequired = 2
)

RFC4120 Section 5.5.1 APOption Flags

View Source
const IanaKrb5ChecksumGSSAPI int32 = 32771

https://www.iana.org/assignments/kerberos-parameters/kerberos-parameters.xhtml

View Source
const MICTokenHdrLen = 16

Length of the first four fields of the Wrap Tokens in RFC 4121 Section 4.2.6.2

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
	// contains filtered or unexported fields
}

func InitKerberosClient

func InitKerberosClient(username, domain, password string, hash, aesKey []byte, dcip, spn string) (c *Client, err error)

func NewClient

func NewClient(client *client.Client) *Client

func (*Client) GetAPReq

func (i *Client) GetAPReq(spn string) ([]byte, error)

func (*Client) GetMICToken

func (client *Client) GetMICToken(bs []byte, seqNum uint64) ([]byte, error)

func (*Client) GetSessionKey

func (client *Client) GetSessionKey() []byte

func (*Client) GetSessionSubKey

func (client *Client) GetSessionSubKey() []byte

func (*Client) ParseAPRep

func (client *Client) ParseAPRep(encpart types.EncryptedData) error

type KRB5Token

type KRB5Token struct {
	Oid      asn1.ObjectIdentifier
	TokenId  uint16
	APReq    messages.APReq
	APRep    messages.APRep
	KRBError messages.KRBError
}

This is the type that is marshallized into the mechToken in the negTokenInit request

func (*KRB5Token) MarshalBinary

func (self *KRB5Token) MarshalBinary() (res []byte, err error)

func (*KRB5Token) UnmarshalBinary

func (self *KRB5Token) UnmarshalBinary(buf []byte) (err error)

type MICToken

type MICToken struct {
	TokenId      uint16 // big-endian 0x0404
	Flags        byte
	Filler       []byte // Must be 5 bytes of 0xFF
	SenderSeqNum uint64 // big-endian
	Payload      []byte // Not actually part of the MICToken but included for convenience
	Checksum     []byte
}

RFC 4121 Section 4.2.6.1

func (*MICToken) MarshalBinary

func (self *MICToken) MarshalBinary() (ret []byte, err error)

func (*MICToken) MarshalHeader

func (self *MICToken) MarshalHeader() []byte

Return the header fields to calculate the checksum on

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL