Documentation ¶
Index ¶
- Constants
- func AppendTransformToProposal(proposal *Proposal, transform *Transform) bool
- func Encode(ikeMessage *IKEMessage) ([]byte, error)
- func EncodePayload(ikePayload []IKEPayloadType) ([]byte, error)
- type Authentication
- type Certificate
- type CertificateRequest
- type Configuration
- type Delete
- type EAP
- type EAPExpanded
- type EAPIdentity
- type EAPNak
- type EAPNotification
- type EAPType
- type EAPTypeFormat
- type Encrypted
- type IKEMessage
- type IKEPayloadType
- type IKEType
- type IdentificationInitiator
- type IdentificationResponder
- type IndividualConfigurationAttribute
- type IndividualTrafficSelector
- type KeyExchange
- type Nonce
- type Notification
- func BuildNotification(protocolID uint8, notifyMessageType uint16, spi []byte, ...) *Notification
- func BuildNotify5G_QOS_INFO(pduSessionID uint8, qfiList []uint8, isDefault bool) *Notification
- func BuildNotifyNAS_IP4_ADDRESS(nasIPAddr string) *Notification
- func BuildNotifyNAS_TCP_PORT(port uint16) *Notification
- func BuildNotifyUP_IP4_ADDRESS(upIPAddr string) *Notification
- type Proposal
- type SecurityAssociation
- type TrafficSelectorInitiator
- type TrafficSelectorResponder
- type Transform
- 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 ( 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 ¶
func Encode ¶
func Encode(ikeMessage *IKEMessage) ([]byte, error)
func EncodePayload ¶
func EncodePayload(ikePayload []IKEPayloadType) ([]byte, error)
Types ¶
type Authentication ¶
func BuildAuthentication ¶
func BuildAuthentication(authenticationMethod uint8, authenticationData []byte) *Authentication
func (*Authentication) Type ¶
func (authentication *Authentication) Type() IKEType
type Certificate ¶
func BuildCertificate ¶
func BuildCertificate(certificateEncode uint8, certificateData []byte) *Certificate
func (*Certificate) Type ¶
func (certificate *Certificate) Type() IKEType
type CertificateRequest ¶
func (*CertificateRequest) Type ¶
func (certificateRequest *CertificateRequest) Type() IKEType
type Configuration ¶
type Configuration struct { ConfigurationType uint8 ConfigurationAttribute []*IndividualConfigurationAttribute }
func BuildConfiguration ¶
func BuildConfiguration(configurationType uint8, attributes []*IndividualConfigurationAttribute) *Configuration
func (*Configuration) Type ¶
func (configuration *Configuration) Type() IKEType
type EAP ¶
type EAP struct { Code uint8 Identifier uint8 EAPTypeData []EAPTypeFormat }
func BuildEAP5GNAS ¶
func BuildEAP5GStart ¶
func BuildEAPSuccess ¶
func BuildEAPfailure ¶
type EAPExpanded ¶
func BuildEAPExpanded ¶
func BuildEAPExpanded(vendorID uint32, vendorType uint32, vendorData []byte) *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 EAPTypeFormat ¶
type EAPTypeFormat interface { // Type specifies EAP types Type() EAPType // contains filtered or unexported methods }
type Encrypted ¶
func BuildEncrypted ¶
type IKEMessage ¶
type IKEMessage struct { InitiatorSPI uint64 ResponderSPI uint64 Version uint8 ExchangeType uint8 Flags uint8 MessageID uint32 IKEPayload []IKEPayloadType }
func BuildIKEHeader ¶
func Decode ¶
func Decode(rawData []byte) (*IKEMessage, error)
type IKEPayloadType ¶
type IKEPayloadType interface { // Type specifies the IKE payload types Type() IKEType // contains filtered or unexported methods }
func DecodePayload ¶
func DecodePayload(nextPayload uint8, rawData []byte) ([]IKEPayloadType, error)
type IdentificationInitiator ¶
func BuildIdentificationInitiator ¶
func BuildIdentificationInitiator(idType uint8, idData []byte) *IdentificationInitiator
func (*IdentificationInitiator) Type ¶
func (identification *IdentificationInitiator) Type() IKEType
type IdentificationResponder ¶
func BuildIdentificationResponder ¶
func BuildIdentificationResponder(idType uint8, idData []byte) *IdentificationResponder
func (*IdentificationResponder) Type ¶
func (identification *IdentificationResponder) Type() IKEType
type IndividualConfigurationAttribute ¶
func BuildConfigurationAttribute ¶
func BuildConfigurationAttribute(attributeType uint16, attributeValue []byte) *IndividualConfigurationAttribute
type IndividualTrafficSelector ¶
type IndividualTrafficSelector struct { TSType uint8 IPProtocolID uint8 StartPort uint16 EndPort uint16 StartAddress []byte EndAddress []byte }
type KeyExchange ¶
func BUildKeyExchange ¶
func BUildKeyExchange(diffiehellmanGroup uint16, keyExchangeData []byte) *KeyExchange
func (*KeyExchange) Type ¶
func (keyExchange *KeyExchange) Type() IKEType
type Notification ¶
type Notification struct { ProtocolID uint8 NotifyMessageType uint16 SPI []byte NotificationData []byte }
func BuildNotification ¶
func BuildNotification(protocolID uint8, notifyMessageType uint16, spi []byte, notificationData []byte) *Notification
func BuildNotify5G_QOS_INFO ¶
func BuildNotify5G_QOS_INFO(pduSessionID uint8, qfiList []uint8, isDefault bool) *Notification
func BuildNotifyNAS_IP4_ADDRESS ¶
func BuildNotifyNAS_IP4_ADDRESS(nasIPAddr string) *Notification
func BuildNotifyNAS_TCP_PORT ¶
func BuildNotifyNAS_TCP_PORT(port uint16) *Notification
func BuildNotifyUP_IP4_ADDRESS ¶
func BuildNotifyUP_IP4_ADDRESS(upIPAddr string) *Notification
func (*Notification) Type ¶
func (notification *Notification) Type() IKEType
type Proposal ¶
type SecurityAssociation ¶
type SecurityAssociation struct {
Proposals []*Proposal
}
func BuildSecurityAssociation ¶
func BuildSecurityAssociation(proposals []*Proposal) *SecurityAssociation
func (*SecurityAssociation) Type ¶
func (securityAssociation *SecurityAssociation) Type() IKEType
type TrafficSelectorInitiator ¶
type TrafficSelectorInitiator struct {
TrafficSelectors []*IndividualTrafficSelector
}
func BuildTrafficSelectorInitiator ¶
func BuildTrafficSelectorInitiator(trafficSelectors []*IndividualTrafficSelector) *TrafficSelectorInitiator
func (*TrafficSelectorInitiator) Type ¶
func (trafficSelector *TrafficSelectorInitiator) Type() IKEType
type TrafficSelectorResponder ¶
type TrafficSelectorResponder struct {
TrafficSelectors []*IndividualTrafficSelector
}
func BuildTrafficSelectorResponder ¶
func BuildTrafficSelectorResponder(trafficSelectors []*IndividualTrafficSelector) *TrafficSelectorResponder
func (*TrafficSelectorResponder) Type ¶
func (trafficSelector *TrafficSelectorResponder) Type() IKEType