Documentation ¶
Index ¶
- Variables
- func ComputeEphemeralKey(g *dhkx.DHGroup, receivedPublicKey []byte, priv *dhkx.DHKey) []byte
- func CreateConfirmTunnelCronstructionMessage(confirmTunnelConstruction models.ConfirmTunnelConstruction) []byte
- func CreateConfirmTunnelInstruction(confirmTunnelInstruction models.ConfirmTunnelInstruction) []byte
- func CreateConstructTunnelMessage(constructTunnel models.ConstructTunnel) []byte
- func CreateDataConfirmTunnelConstruction(dataConfirmTunnelConstruction models.DataConfirmTunnelConstruction) []byte
- func CreateDataConstructTunnel(dataConstructTunnel models.DataConstructTunnel) []byte
- func CreateDataExchangeKey(exchangeKey models.ExchangeKey) []byte
- func CreateExchangeKey(exchangeKey models.ExchangeKey) []byte
- func CreateInitialUDPConnectionLeft(leftHost string, leftPort int, tunndelId uint32) (*models.UDPConnection, error)
- func CreateInitialUDPConnectionRight(rightHost string, rightPort int, tunndelId uint32) (*models.UDPConnection, error)
- func CreateOnionTunnelBuild(onionTunnelBuild models.OnionTunnelBuild) []byte
- func CreateOnionTunnelData(onionTunnelData models.OnionTunnelData) []byte
- func CreateOnionTunnelDestroy(onionTunnelDestroy models.OnionTunnelDestroy) []byte
- func CreateOnionTunnelError(onionError models.OnionError) []byte
- func CreateOnionTunnelIncoming(onionTunnelIncoming models.OnionTunnelIncoming) []byte
- func CreateOnionTunnelReady(onionTunnelReady models.OnionTunnelReady) []byte
- func CreateOnionTunnelTrafficJamTCP(tunnelTrafficJam models.OnionTunnelTrafficJam) []byte
- func CreateRPSQuery() []byte
- func CreateTunnelID() uint32
- func CreateTunnelInstruction(tunnelInstruction models.TunnelInstruction) []byte
- func CreateUDPWriter(destinationAddress string, destinationPort int) (net.Conn, error)
- func DecryptData(key []byte, data []byte) ([]byte, error)
- func DecryptKeyExchange(privateKey *rsa.PrivateKey, key []byte) ([]byte, error)
- func EncryptData(key []byte, data []byte) ([]byte, error)
- func EncryptKeyExchange(publicKey *rsa.PublicKey, key []byte) ([]byte, error)
- func GenRandomData() []byte
- func GenerateIdentityOfKey(pubKey *rsa.PublicKey) []byte
- func GeneratePreMasterKey() (*dhkx.DHKey, []byte, *dhkx.DHGroup)
- func GetFreePort() (int, error)
- func GetIPOutOfAddr(addr string) string
- func NewConfigObject() (*models.Config, error)
- func ParseKeys(path string) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func ScanCRLF(data []byte, atEOF bool) (advance int, token []byte, err error)
- type ChannelError
- type ConfirmMessageChannel
- type Peer
- func (peer *Peer) AppendNewUDPConnection(myUDPConnectio *models.UDPConnection)
- func (peer *Peer) CreateInitialTCPConnection(tunnelId uint32, finalDestinationHostkey []byte, leftWriter *models.TCPWriter, ...)
- func (peer *Peer) CreateTCPWriter(destinationIP string, tcpPort int) (*models.TCPWriter, error)
- func (peer *Peer) StartTCPListening()
- func (peer *Peer) StartUDPListening()
- type TCPMessageChannel
- type UDPConnection
Constants ¶
This section is empty.
Variables ¶
var CommunicationChannelTCPConfirm chan ConfirmMessageChannel
var CommunicationChannelTCPMessages chan TCPMessageChannel
var CommunicationChannelUDPMessages chan []byte
GLobal channel for messages from TCP
var CummunicationChannelError chan ChannelError
GLobal channel for communication errors and messages from TCP and special confirm messages for the peerController
Functions ¶
func ComputeEphemeralKey ¶
Compute an ephemeral key using DH algorithm
func CreateConfirmTunnelCronstructionMessage ¶
func CreateConfirmTunnelCronstructionMessage(confirmTunnelConstruction models.ConfirmTunnelConstruction) []byte
func CreateConfirmTunnelInstruction ¶
func CreateConfirmTunnelInstruction(confirmTunnelInstruction models.ConfirmTunnelInstruction) []byte
func CreateConstructTunnelMessage ¶
func CreateConstructTunnelMessage(constructTunnel models.ConstructTunnel) []byte
Function to create Construct Tunnel Messages. Type: 567.
func CreateDataConfirmTunnelConstruction ¶
func CreateDataConfirmTunnelConstruction(dataConfirmTunnelConstruction models.DataConfirmTunnelConstruction) []byte
func CreateDataConstructTunnel ¶
func CreateDataConstructTunnel(dataConstructTunnel models.DataConstructTunnel) []byte
func CreateDataExchangeKey ¶
func CreateDataExchangeKey(exchangeKey models.ExchangeKey) []byte
func CreateExchangeKey ¶
func CreateExchangeKey(exchangeKey models.ExchangeKey) []byte
func CreateInitialUDPConnectionLeft ¶
func CreateInitialUDPConnectionLeft(leftHost string, leftPort int, tunndelId uint32) (*models.UDPConnection, error)
When Creating Initial (despite first element in tunnel), always set writer for left side >> Write back to origin
func CreateOnionTunnelBuild ¶
func CreateOnionTunnelBuild(onionTunnelBuild models.OnionTunnelBuild) []byte
func CreateOnionTunnelData ¶
func CreateOnionTunnelData(onionTunnelData models.OnionTunnelData) []byte
func CreateOnionTunnelDestroy ¶
func CreateOnionTunnelDestroy(onionTunnelDestroy models.OnionTunnelDestroy) []byte
func CreateOnionTunnelError ¶
func CreateOnionTunnelError(onionError models.OnionError) []byte
func CreateOnionTunnelIncoming ¶
func CreateOnionTunnelIncoming(onionTunnelIncoming models.OnionTunnelIncoming) []byte
func CreateOnionTunnelReady ¶
func CreateOnionTunnelReady(onionTunnelReady models.OnionTunnelReady) []byte
func CreateOnionTunnelTrafficJamTCP ¶
func CreateOnionTunnelTrafficJamTCP(tunnelTrafficJam models.OnionTunnelTrafficJam) []byte
func CreateRPSQuery ¶
func CreateRPSQuery() []byte
func CreateTunnelInstruction ¶
func CreateTunnelInstruction(tunnelInstruction models.TunnelInstruction) []byte
func CreateUDPWriter ¶
Creates a new writer for a given ip and port
func DecryptData ¶
Decrypt Data with DH key.
func DecryptKeyExchange ¶
func DecryptKeyExchange(privateKey *rsa.PrivateKey, key []byte) ([]byte, error)
Decrypt DH key for key exchange
func EncryptData ¶
Encrypt Data with DH key.
func EncryptKeyExchange ¶
Encrypt DH key for key exchange
func GenerateIdentityOfKey ¶
Generates an identity byte array based on SHA256 Hash
func GeneratePreMasterKey ¶
Generate a pre-master key for DH algorithm
func GetIPOutOfAddr ¶
func NewConfigObject ¶
NewConfigObject creates a new config struct based on an config.ini file, passed as parameter
Types ¶
type ChannelError ¶
ChannelError contains error and the tunnel id
type ConfirmMessageChannel ¶
type ConfirmMessageChannel struct {
TunnelId uint32
}
type Peer ¶
Just used to wrap the actual Peer from models.Peer here to use it as caller
func CreateNewPeer ¶
CreatePeer crates a new Peer object that is just listening, now writing necessary at the moment
func (*Peer) AppendNewUDPConnection ¶
func (peer *Peer) AppendNewUDPConnection(myUDPConnectio *models.UDPConnection)
func (*Peer) CreateInitialTCPConnection ¶
func (peer *Peer) CreateInitialTCPConnection(tunnelId uint32, finalDestinationHostkey []byte, leftWriter *models.TCPWriter, originHostkey []byte)
Creates a new TCPConnection for the peer with the left writer already set
func (*Peer) CreateTCPWriter ¶
func (*Peer) StartTCPListening ¶
func (peer *Peer) StartTCPListening()
StartTCPListening lets the peer listen for new TCP-messages on its P2P_Port
func (*Peer) StartUDPListening ¶
func (peer *Peer) StartUDPListening()
StartUDPListening lets the peer listen for new UDP-messages
type TCPMessageChannel ¶
Used to transmit the message and the ip in the CommunicationChannelTCPMessages
type UDPConnection ¶
type UDPConnection struct {
UCPConnObject *models.UDPConnection
}
Just used to wrap the actual Peer from models.Peer here to use it as caller