Documentation ¶
Index ¶
- Constants
- type Authentication
- type Certificate
- type CertificateRequest
- type Configuration
- type ConfigurationAttributeContainer
- type Delete
- type EAP
- type EAPExpanded
- type EAPIdentity
- type EAPNak
- type EAPNotification
- type EAPType
- type EAPTypeDataContainer
- type EAPTypeFormat
- type Encrypted
- type IKEMessage
- type IKEPayload
- type IKEPayloadContainer
- func (container *IKEPayloadContainer) BUildKeyExchange(diffiehellmanGroup uint16, keyExchangeData []byte)
- func (container *IKEPayloadContainer) BuildAuthentication(authenticationMethod uint8, authenticationData []byte)
- func (container *IKEPayloadContainer) BuildCertificate(certificateEncode uint8, certificateData []byte)
- func (container *IKEPayloadContainer) BuildConfiguration(configurationType uint8) *Configuration
- func (container *IKEPayloadContainer) BuildDeletePayload(protocolID uint8, SPISize uint8, numberOfSPI uint16, SPIs []byte)
- func (container *IKEPayloadContainer) BuildEAP(code uint8, identifier uint8) *EAP
- func (container *IKEPayloadContainer) BuildEAP5GNAS(identifier uint8, nasPDU []byte)
- func (container *IKEPayloadContainer) BuildEAP5GStart(identifier uint8)
- func (container *IKEPayloadContainer) BuildEAPSuccess(identifier uint8)
- func (container *IKEPayloadContainer) BuildEAPfailure(identifier uint8)
- func (container *IKEPayloadContainer) BuildEncrypted(nextPayload IKEPayloadType, encryptedData []byte) *Encrypted
- func (container *IKEPayloadContainer) BuildIdentificationInitiator(idType uint8, idData []byte)
- func (container *IKEPayloadContainer) BuildIdentificationResponder(idType uint8, idData []byte)
- func (container *IKEPayloadContainer) BuildNonce(nonceData []byte)
- func (container *IKEPayloadContainer) BuildNotification(protocolID uint8, notifyMessageType uint16, spi []byte, ...)
- func (container *IKEPayloadContainer) BuildNotify5G_QOS_INFO(pduSessionID uint8, qfiList []uint8, isDefault bool, isDSCPSpecified bool, ...)
- func (container *IKEPayloadContainer) BuildNotifyNAS_IP4_ADDRESS(nasIPAddr string)
- func (container *IKEPayloadContainer) BuildNotifyNAS_TCP_PORT(port uint16)
- func (container *IKEPayloadContainer) BuildNotifyUP_IP4_ADDRESS(upIPAddr string)
- func (container *IKEPayloadContainer) BuildSecurityAssociation() *SecurityAssociation
- func (container *IKEPayloadContainer) BuildTrafficSelectorInitiator() *TrafficSelectorInitiator
- func (container *IKEPayloadContainer) BuildTrafficSelectorResponder() *TrafficSelectorResponder
- func (container *IKEPayloadContainer) Decode(nextPayload uint8, rawData []byte) error
- func (container *IKEPayloadContainer) Encode() ([]byte, error)
- func (container *IKEPayloadContainer) Reset()
- type IKEPayloadType
- type IdentificationInitiator
- type IdentificationResponder
- type IndividualConfigurationAttribute
- type IndividualTrafficSelector
- type IndividualTrafficSelectorContainer
- type KeyExchange
- type Nonce
- type Notification
- type Proposal
- type ProposalContainer
- type SecurityAssociation
- type TrafficSelectorInitiator
- type TrafficSelectorResponder
- type Transform
- type TransformContainer
- type VendorID
Constants ¶
const ( NoNext = 0 TypeSA = iota + 32 TypeKE TypeIDi TypeIDr TypeCERT TypeCERTreq TypeAUTH TypeNiNr TypeN TypeD TypeV TypeTSi TypeTSr TypeSK TypeCP TypeEAP )
const ( EAPTypeIdentity = iota + 1 EAPTypeNotification EAPTypeNak EAPTypeExpanded = 254 )
const ( EAPCodeRequest = iota + 1 EAPCodeResponse EAPCodeSuccess EAPCodeFailure )
const ( TypeEncryptionAlgorithm = iota + 1 TypePseudorandomFunction TypeIntegrityAlgorithm TypeDiffieHellmanGroup TypeExtendedSequenceNumbers )
used for SecurityAssociation-Proposal-Transform TransformType
const ( AttributeFormatUseTLV = iota AttributeFormatUseTV )
used for SecurityAssociation-Proposal-Transform AttributeFormat
const ( ENCR_DES_IV64 = 1 ENCR_DES = 2 ENCR_3DES = 3 ENCR_RC5 = 4 ENCR_IDEA = 5 ENCR_CAST = 6 ENCR_BLOWFISH = 7 ENCR_3IDEA = 8 ENCR_DES_IV32 = 9 ENCR_NULL = 11 ENCR_AES_CBC = 12 ENCR_AES_CTR = 13 )
used for SecurityAssociation-Proposal-Transform TransformID
const ( PRF_HMAC_MD5 = iota + 1 PRF_HMAC_SHA1 PRF_HMAC_TIGER )
const ( AUTH_NONE = iota AUTH_HMAC_MD5_96 AUTH_HMAC_SHA1_96 AUTH_DES_MAC AUTH_KPDK_MD5 AUTH_AES_XCBC_96 )
const ( DH_NONE = 0 DH_768_BIT_MODP = 1 DH_1024_BIT_MODP = 2 DH_1536_BIT_MODP = 5 DH_2048_BIT_MODP = iota + 10 DH_3072_BIT_MODP DH_4096_BIT_MODP DH_6144_BIT_MODP DH_8192_BIT_MODP )
const ( ESN_NO = iota ESN_NEED )
const ( TS_IPV4_ADDR_RANGE = 7 TS_IPV6_ADDR_RANGE = 8 )
used for TrafficSelector-Individual Traffic Selector TSType
const ( IKE_SA_INIT = iota + 34 IKE_AUTH CREATE_CHILD_SA INFORMATIONAL )
Exchange Type
const ( UNSUPPORTED_CRITICAL_PAYLOAD = 1 INVALID_IKE_SPI = 4 INVALID_MAJOR_VERSION = 5 INVALID_SYNTAX = 7 INVALID_MESSAGE_ID = 9 INVALID_SPI = 11 NO_PROPOSAL_CHOSEN = 14 INVALID_KE_PAYLOAD = 17 AUTHENTICATION_FAILED = 24 SINGLE_PAIR_REQUIRED = 34 NO_ADDITIONAL_SAS = 35 INTERNAL_ADDRESS_FAILURE = 36 FAILED_CP_REQUIRED = 37 TS_UNACCEPTABLE = 38 INVALID_SELECTORS = 39 TEMPORARY_FAILURE = 43 CHILD_SA_NOT_FOUND = 44 INITIAL_CONTACT = 16384 SET_WINDOW_SIZE = 16385 ADDITIONAL_TS_POSSIBLE = 16386 IPCOMP_SUPPORTED = 16387 NAT_DETECTION_SOURCE_IP = 16388 NAT_DETECTION_DESTINATION_IP = 16389 COOKIE = 16390 USE_TRANSPORT_MODE = 16391 HTTP_CERT_LOOKUP_SUPPORTED = 16392 REKEY_SA = 16393 ESP_TFC_PADDING_NOT_SUPPORTED = 16394 NON_FIRST_FRAGMENTS_ALSO = 16395 )
Notify message types
const ( TypeNone = iota TypeIKE TypeAH TypeESP )
Protocol ID
const ( ResponseBitCheck = 0x20 VersionBitCheck = 0x10 InitiatorBitCheck = 0x08 )
Flags
const ( PKCS7WrappedX509Certificate = 1 PGPCertificate = 2 DNSSignedKey = 3 X509CertificateSignature = 4 KerberosToken = 6 CertificateRevocationList = 7 AuthorityRevocationList = 8 SPKICertificate = 9 X509CertificateAttribute = 10 HashAndURLOfX509Certificate = 12 HashAndURLOfX509Bundle = 13 )
Certificate encoding
const ( ID_IPV4_ADDR = 1 ID_FQDN = 2 ID_RFC822_ADDR = 3 ID_IPV6_ADDR = 5 ID_DER_ASN1_DN = 9 ID_DER_ASN1_GN = 10 ID_KEY_ID = 11 )
ID Types
const ( RSADigitalSignature = iota + 1 DSSDigitalSignature )
Authentication Methods
const ( CFG_REQUEST = 1 CFG_REPLY = 2 CFG_SET = 3 CFG_ACK = 4 )
Configuration types
const ( INTERNAL_IP4_ADDRESS = 1 INTERNAL_IP4_NETMASK = 2 INTERNAL_IP4_DNS = 3 INTERNAL_IP4_NBNS = 4 INTERNAL_IP4_DHCP = 6 APPLICATION_VERSION = 7 INTERNAL_IP6_ADDRESS = 8 INTERNAL_IP6_DNS = 10 INTERNAL_IP6_DHCP = 12 INTERNAL_IP4_SUBNET = 13 SUPPORTED_ATTRIBUTES = 14 INTERNAL_IP6_SUBNET = 15 )
Configuration attribute types
const ( IPProtocolAll = 0 IPProtocolICMP = 1 IPProtocolTCP = 6 IPProtocolUDP = 17 IPProtocolGRE = 47 )
IP protocols ID, used in individual traffic selector
const ( EAP5GType5GStart = 1 EAP5GType5GNAS = 2 EAP5GType5GStop = 4 )
Used in EAP-5G for message ID
const ( ANParametersTypeGUAMI = 1 ANParametersTypeSelectedPLMNID = 2 ANParametersTypeRequestedNSSAI = 3 ANParametersTypeEstablishmentCause = 4 )
Used in AN-Parameter field for IE types
const ( ANParametersLenGUAMI = 6 ANParametersLenPLMNID = 3 ANParametersLenEstCause = 1 )
Used for checking if AN-Parameter length field is legal
const ( EstablishmentCauseEmergency = 0 EstablishmentCauseHighPriorityAccess = 1 EstablishmentCauseMO_Signalling = 3 EstablishmentCauseMO_Data = 4 EstablishmentCauseMPS_PriorityAccess = 8 EstablishmentCauseMCS_PriorityAccess = 9 )
Used in IE Establishment Cause field for cause types
const ( Vendor3GPPNotifyType5G_QOS_INFO uint16 = 55501 Vendor3GPPNotifyTypeNAS_IP4_ADDRESS uint16 = 55502 Vendor3GPPNotifyTypeUP_IP4_ADDRESS uint16 = 55504 Vendor3GPPNotifyTypeNAS_TCP_PORT uint16 = 55506 )
3GPP specified IKE Notify 3GPP specified IKE Notify Message Types
const ( NotifyType5G_QOS_INFOBitDSCPICheck uint8 = 1 NotifyType5G_QOS_INFOBitDCSICheck uint8 = 1 << 1 )
Used in NotifyType5G_QOS_INFO
const (
AttributeTypeKeyLength = 14
)
used for SecurityAssociation-Proposal-Trandform AttributeType
const EAP5GSpareValue = 0
Spare
const VendorID3GPP = 10415
Types for EAP-5G Used in IKE EAP expanded for vendor ID
const VendorTypeEAP5G = 3
Used in IKE EAP expanded for vendor data
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
func (*Authentication) Type ¶
func (authentication *Authentication) Type() IKEPayloadType
type Certificate ¶
func (*Certificate) Type ¶
func (certificate *Certificate) Type() IKEPayloadType
type CertificateRequest ¶
func (*CertificateRequest) Type ¶
func (certificateRequest *CertificateRequest) Type() IKEPayloadType
type Configuration ¶
type Configuration struct { ConfigurationType uint8 ConfigurationAttribute ConfigurationAttributeContainer }
func (*Configuration) Type ¶
func (configuration *Configuration) Type() IKEPayloadType
type ConfigurationAttributeContainer ¶
type ConfigurationAttributeContainer []*IndividualConfigurationAttribute
func (*ConfigurationAttributeContainer) BuildConfigurationAttribute ¶
func (container *ConfigurationAttributeContainer) BuildConfigurationAttribute( attributeType uint16, attributeValue []byte, )
func (*ConfigurationAttributeContainer) Reset ¶
func (container *ConfigurationAttributeContainer) Reset()
type EAP ¶
type EAP struct { Code uint8 Identifier uint8 EAPTypeData EAPTypeDataContainer }
func (*EAP) Type ¶
func (eap *EAP) Type() IKEPayloadType
type EAPExpanded ¶
func (*EAPExpanded) Type ¶
func (eapExpanded *EAPExpanded) Type() EAPType
type EAPIdentity ¶
type EAPIdentity struct {
IdentityData []byte
}
func (*EAPIdentity) Type ¶
func (eapIdentity *EAPIdentity) Type() EAPType
type EAPNotification ¶
type EAPNotification struct {
NotificationData []byte
}
func (*EAPNotification) Type ¶
func (eapNotification *EAPNotification) Type() EAPType
type EAPTypeDataContainer ¶
type EAPTypeDataContainer []EAPTypeFormat
func (*EAPTypeDataContainer) BuildEAPExpanded ¶
func (container *EAPTypeDataContainer) BuildEAPExpanded(vendorID uint32, vendorType uint32, vendorData []byte)
type EAPTypeFormat ¶
type EAPTypeFormat interface { // Type specifies EAP types Type() EAPType // contains filtered or unexported methods }
type IKEMessage ¶
type IKEMessage struct { InitiatorSPI uint64 ResponderSPI uint64 Version uint8 ExchangeType uint8 Flags uint8 MessageID uint32 Payloads IKEPayloadContainer }
func (*IKEMessage) BuildIKEHeader ¶
func (*IKEMessage) Decode ¶
func (ikeMessage *IKEMessage) Decode(rawData []byte) error
func (*IKEMessage) Encode ¶
func (ikeMessage *IKEMessage) Encode() ([]byte, error)
type IKEPayload ¶
type IKEPayload interface { // Type specifies the IKE payload types Type() IKEPayloadType // contains filtered or unexported methods }
type IKEPayloadContainer ¶
type IKEPayloadContainer []IKEPayload
func (*IKEPayloadContainer) BUildKeyExchange ¶
func (container *IKEPayloadContainer) BUildKeyExchange(diffiehellmanGroup uint16, keyExchangeData []byte)
func (*IKEPayloadContainer) BuildAuthentication ¶
func (container *IKEPayloadContainer) BuildAuthentication(authenticationMethod uint8, authenticationData []byte)
func (*IKEPayloadContainer) BuildCertificate ¶
func (container *IKEPayloadContainer) BuildCertificate(certificateEncode uint8, certificateData []byte)
func (*IKEPayloadContainer) BuildConfiguration ¶
func (container *IKEPayloadContainer) BuildConfiguration(configurationType uint8) *Configuration
func (*IKEPayloadContainer) BuildDeletePayload ¶
func (container *IKEPayloadContainer) BuildDeletePayload( protocolID uint8, SPISize uint8, numberOfSPI uint16, SPIs []byte, )
func (*IKEPayloadContainer) BuildEAP ¶
func (container *IKEPayloadContainer) BuildEAP(code uint8, identifier uint8) *EAP
func (*IKEPayloadContainer) BuildEAP5GNAS ¶
func (container *IKEPayloadContainer) BuildEAP5GNAS(identifier uint8, nasPDU []byte)
func (*IKEPayloadContainer) BuildEAP5GStart ¶
func (container *IKEPayloadContainer) BuildEAP5GStart(identifier uint8)
func (*IKEPayloadContainer) BuildEAPSuccess ¶
func (container *IKEPayloadContainer) BuildEAPSuccess(identifier uint8)
func (*IKEPayloadContainer) BuildEAPfailure ¶
func (container *IKEPayloadContainer) BuildEAPfailure(identifier uint8)
func (*IKEPayloadContainer) BuildEncrypted ¶
func (container *IKEPayloadContainer) BuildEncrypted(nextPayload IKEPayloadType, encryptedData []byte) *Encrypted
func (*IKEPayloadContainer) BuildIdentificationInitiator ¶
func (container *IKEPayloadContainer) BuildIdentificationInitiator(idType uint8, idData []byte)
func (*IKEPayloadContainer) BuildIdentificationResponder ¶
func (container *IKEPayloadContainer) BuildIdentificationResponder(idType uint8, idData []byte)
func (*IKEPayloadContainer) BuildNonce ¶
func (container *IKEPayloadContainer) BuildNonce(nonceData []byte)
func (*IKEPayloadContainer) BuildNotification ¶
func (container *IKEPayloadContainer) BuildNotification( protocolID uint8, notifyMessageType uint16, spi []byte, notificationData []byte, )
func (*IKEPayloadContainer) BuildNotify5G_QOS_INFO ¶
func (*IKEPayloadContainer) BuildNotifyNAS_IP4_ADDRESS ¶
func (container *IKEPayloadContainer) BuildNotifyNAS_IP4_ADDRESS(nasIPAddr string)
func (*IKEPayloadContainer) BuildNotifyNAS_TCP_PORT ¶
func (container *IKEPayloadContainer) BuildNotifyNAS_TCP_PORT(port uint16)
func (*IKEPayloadContainer) BuildNotifyUP_IP4_ADDRESS ¶
func (container *IKEPayloadContainer) BuildNotifyUP_IP4_ADDRESS(upIPAddr string)
func (*IKEPayloadContainer) BuildSecurityAssociation ¶
func (container *IKEPayloadContainer) BuildSecurityAssociation() *SecurityAssociation
func (*IKEPayloadContainer) BuildTrafficSelectorInitiator ¶
func (container *IKEPayloadContainer) BuildTrafficSelectorInitiator() *TrafficSelectorInitiator
func (*IKEPayloadContainer) BuildTrafficSelectorResponder ¶
func (container *IKEPayloadContainer) BuildTrafficSelectorResponder() *TrafficSelectorResponder
func (*IKEPayloadContainer) Decode ¶
func (container *IKEPayloadContainer) Decode(nextPayload uint8, rawData []byte) error
func (*IKEPayloadContainer) Encode ¶
func (container *IKEPayloadContainer) Encode() ([]byte, error)
func (*IKEPayloadContainer) Reset ¶
func (container *IKEPayloadContainer) Reset()
type IdentificationInitiator ¶
func (*IdentificationInitiator) Type ¶
func (identification *IdentificationInitiator) Type() IKEPayloadType
type IdentificationResponder ¶
func (*IdentificationResponder) Type ¶
func (identification *IdentificationResponder) Type() IKEPayloadType
type IndividualTrafficSelectorContainer ¶
type IndividualTrafficSelectorContainer []*IndividualTrafficSelector
func (*IndividualTrafficSelectorContainer) BuildIndividualTrafficSelector ¶
func (*IndividualTrafficSelectorContainer) Reset ¶
func (container *IndividualTrafficSelectorContainer) Reset()
type KeyExchange ¶
func (*KeyExchange) Type ¶
func (keyExchange *KeyExchange) Type() IKEPayloadType
type Nonce ¶
type Nonce struct {
NonceData []byte
}
func (*Nonce) Type ¶
func (nonce *Nonce) Type() IKEPayloadType
type Notification ¶
type Notification struct { ProtocolID uint8 NotifyMessageType uint16 SPI []byte NotificationData []byte }
func (*Notification) Type ¶
func (notification *Notification) Type() IKEPayloadType
type Proposal ¶
type Proposal struct { ProposalNumber uint8 ProtocolID uint8 SPI []byte EncryptionAlgorithm TransformContainer PseudorandomFunction TransformContainer IntegrityAlgorithm TransformContainer DiffieHellmanGroup TransformContainer ExtendedSequenceNumbers TransformContainer }
type ProposalContainer ¶
type ProposalContainer []*Proposal
func (*ProposalContainer) BuildProposal ¶
func (container *ProposalContainer) BuildProposal(proposalNumber uint8, protocolID uint8, spi []byte) *Proposal
func (*ProposalContainer) Reset ¶
func (container *ProposalContainer) Reset()
type SecurityAssociation ¶
type SecurityAssociation struct {
Proposals ProposalContainer
}
func (*SecurityAssociation) Type ¶
func (securityAssociation *SecurityAssociation) Type() IKEPayloadType
type TrafficSelectorInitiator ¶
type TrafficSelectorInitiator struct {
TrafficSelectors IndividualTrafficSelectorContainer
}
func (*TrafficSelectorInitiator) Type ¶
func (trafficSelector *TrafficSelectorInitiator) Type() IKEPayloadType
type TrafficSelectorResponder ¶
type TrafficSelectorResponder struct {
TrafficSelectors IndividualTrafficSelectorContainer
}
func (*TrafficSelectorResponder) Type ¶
func (trafficSelector *TrafficSelectorResponder) Type() IKEPayloadType
type TransformContainer ¶
type TransformContainer []*Transform
func (*TransformContainer) BuildTransform ¶
func (*TransformContainer) Reset ¶
func (container *TransformContainer) Reset()