Documentation ¶
Index ¶
- Variables
- type Act1Message
- func (*Act1Message) Descriptor() ([]byte, []int)deprecated
- func (x *Act1Message) GetNonce() []byte
- func (x *Act1Message) GetProtocol() string
- func (*Act1Message) ProtoMessage()
- func (x *Act1Message) ProtoReflect() protoreflect.Message
- func (x *Act1Message) Reset()
- func (x *Act1Message) String() string
- type Act2Message
- func (*Act2Message) Descriptor() ([]byte, []int)deprecated
- func (x *Act2Message) GetChallenge() []byte
- func (x *Act2Message) GetNonce() []byte
- func (x *Act2Message) GetProtocol() string
- func (*Act2Message) ProtoMessage()
- func (x *Act2Message) ProtoReflect() protoreflect.Message
- func (x *Act2Message) Reset()
- func (x *Act2Message) String() string
- type Act3Message
- type BroadcastNetworkMessage
- func (*BroadcastNetworkMessage) Descriptor() ([]byte, []int)deprecated
- func (x *BroadcastNetworkMessage) GetPayload() []byte
- func (x *BroadcastNetworkMessage) GetSender() []byte
- func (x *BroadcastNetworkMessage) GetSequenceNumber() uint64
- func (x *BroadcastNetworkMessage) GetType() []byte
- func (*BroadcastNetworkMessage) ProtoMessage()
- func (x *BroadcastNetworkMessage) ProtoReflect() protoreflect.Message
- func (x *BroadcastNetworkMessage) Reset()
- func (x *BroadcastNetworkMessage) String() string
- type HandshakeEnvelope
- func (*HandshakeEnvelope) Descriptor() ([]byte, []int)deprecated
- func (x *HandshakeEnvelope) GetMessage() []byte
- func (x *HandshakeEnvelope) GetPeerID() []byte
- func (x *HandshakeEnvelope) GetSignature() []byte
- func (*HandshakeEnvelope) ProtoMessage()
- func (x *HandshakeEnvelope) ProtoReflect() protoreflect.Message
- func (x *HandshakeEnvelope) Reset()
- func (x *HandshakeEnvelope) String() string
- type Identity
Constants ¶
This section is empty.
Variables ¶
var File_pkg_net_gen_pb_handshake_proto protoreflect.FileDescriptor
var File_pkg_net_gen_pb_message_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Act1Message ¶
type Act1Message struct { // nonce by initiator; 8-byte (64-bit) nonce as bytes Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // the identifier of the protocol the initiator is executing Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` // contains filtered or unexported fields }
Act1Message is sent in the first handshake act by the initiator to the responder. It contains randomly generated `nonce1`, an 8-byte (64-bit) unsigned integer, and the protocol identifier.
Act1Message should be signed with initiator's static private key.
func (*Act1Message) Descriptor
deprecated
func (*Act1Message) Descriptor() ([]byte, []int)
Deprecated: Use Act1Message.ProtoReflect.Descriptor instead.
func (*Act1Message) GetNonce ¶
func (x *Act1Message) GetNonce() []byte
func (*Act1Message) GetProtocol ¶ added in v1.2.0
func (x *Act1Message) GetProtocol() string
func (*Act1Message) ProtoMessage ¶
func (*Act1Message) ProtoMessage()
func (*Act1Message) ProtoReflect ¶ added in v1.21.0
func (x *Act1Message) ProtoReflect() protoreflect.Message
func (*Act1Message) Reset ¶
func (x *Act1Message) Reset()
func (*Act1Message) String ¶
func (x *Act1Message) String() string
type Act2Message ¶
type Act2Message struct { // nonce from responder; 8-byte (64-bit) nonce as bytes Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // bytes of sha256(nonce1||nonce2) Challenge []byte `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"` // the identifier of the protocol the responder is executing Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` // contains filtered or unexported fields }
Act2Message is sent in the second handshake act by the responder to the initiator. It contains randomly generated `nonce2`, an 8-byte unsigned integer and `challenge` which is a result of SHA256 on the concatenated bytes of `nonce1` and `nonce2`, and the protocol identifier.
Act2Message should be signed with responder's static private key.
func (*Act2Message) Descriptor
deprecated
func (*Act2Message) Descriptor() ([]byte, []int)
Deprecated: Use Act2Message.ProtoReflect.Descriptor instead.
func (*Act2Message) GetChallenge ¶
func (x *Act2Message) GetChallenge() []byte
func (*Act2Message) GetNonce ¶
func (x *Act2Message) GetNonce() []byte
func (*Act2Message) GetProtocol ¶ added in v1.2.0
func (x *Act2Message) GetProtocol() string
func (*Act2Message) ProtoMessage ¶
func (*Act2Message) ProtoMessage()
func (*Act2Message) ProtoReflect ¶ added in v1.21.0
func (x *Act2Message) ProtoReflect() protoreflect.Message
func (*Act2Message) Reset ¶
func (x *Act2Message) Reset()
func (*Act2Message) String ¶
func (x *Act2Message) String() string
type Act3Message ¶
type Act3Message struct { // bytes of sha256(nonce1||nonce2) Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` // contains filtered or unexported fields }
Act1Message is sent in the first handshake act by the initiator to the responder. It contains randomly generated `nonce1`, an 8-byte (64-bit) unsigned integer.
Act1Message should be signed with initiator's static private key.
func (*Act3Message) Descriptor
deprecated
func (*Act3Message) Descriptor() ([]byte, []int)
Deprecated: Use Act3Message.ProtoReflect.Descriptor instead.
func (*Act3Message) GetChallenge ¶
func (x *Act3Message) GetChallenge() []byte
func (*Act3Message) ProtoMessage ¶
func (*Act3Message) ProtoMessage()
func (*Act3Message) ProtoReflect ¶ added in v1.21.0
func (x *Act3Message) ProtoReflect() protoreflect.Message
func (*Act3Message) Reset ¶
func (x *Act3Message) Reset()
func (*Act3Message) String ¶
func (x *Act3Message) String() string
type BroadcastNetworkMessage ¶
type BroadcastNetworkMessage struct { // The PublicKey of the sender. Sender []byte `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // A marshaled Protocol Message. Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // Type of the message as registered by the protocol. Type []byte `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // Sequence number of the message. Retransmissions have the same sequence // number as the original message. SequenceNumber uint64 `protobuf:"varint,4,opt,name=sequenceNumber,proto3" json:"sequenceNumber,omitempty"` // contains filtered or unexported fields }
BroadcastNetworkMessage represents a network message used by broadcast channels.
func (*BroadcastNetworkMessage) Descriptor
deprecated
func (*BroadcastNetworkMessage) Descriptor() ([]byte, []int)
Deprecated: Use BroadcastNetworkMessage.ProtoReflect.Descriptor instead.
func (*BroadcastNetworkMessage) GetPayload ¶
func (x *BroadcastNetworkMessage) GetPayload() []byte
func (*BroadcastNetworkMessage) GetSender ¶
func (x *BroadcastNetworkMessage) GetSender() []byte
func (*BroadcastNetworkMessage) GetSequenceNumber ¶
func (x *BroadcastNetworkMessage) GetSequenceNumber() uint64
func (*BroadcastNetworkMessage) GetType ¶
func (x *BroadcastNetworkMessage) GetType() []byte
func (*BroadcastNetworkMessage) ProtoMessage ¶
func (*BroadcastNetworkMessage) ProtoMessage()
func (*BroadcastNetworkMessage) ProtoReflect ¶ added in v1.21.0
func (x *BroadcastNetworkMessage) ProtoReflect() protoreflect.Message
func (*BroadcastNetworkMessage) Reset ¶
func (x *BroadcastNetworkMessage) Reset()
func (*BroadcastNetworkMessage) String ¶
func (x *BroadcastNetworkMessage) String() string
type HandshakeEnvelope ¶
type HandshakeEnvelope struct { // The marshalled message. Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Signature of the message. Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Peer id of the message creator PeerID []byte `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"` // contains filtered or unexported fields }
Envelope contains a marshalled message, as well as a signature over the the contents of the message (to ensure an adversary hasn't tampered with the contents).
func (*HandshakeEnvelope) Descriptor
deprecated
func (*HandshakeEnvelope) Descriptor() ([]byte, []int)
Deprecated: Use HandshakeEnvelope.ProtoReflect.Descriptor instead.
func (*HandshakeEnvelope) GetMessage ¶
func (x *HandshakeEnvelope) GetMessage() []byte
func (*HandshakeEnvelope) GetPeerID ¶
func (x *HandshakeEnvelope) GetPeerID() []byte
func (*HandshakeEnvelope) GetSignature ¶
func (x *HandshakeEnvelope) GetSignature() []byte
func (*HandshakeEnvelope) ProtoMessage ¶
func (*HandshakeEnvelope) ProtoMessage()
func (*HandshakeEnvelope) ProtoReflect ¶ added in v1.21.0
func (x *HandshakeEnvelope) ProtoReflect() protoreflect.Message
func (*HandshakeEnvelope) Reset ¶
func (x *HandshakeEnvelope) Reset()
func (*HandshakeEnvelope) String ¶
func (x *HandshakeEnvelope) String() string
type Identity ¶
type Identity struct { PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` // contains filtered or unexported fields }
func (*Identity) Descriptor
deprecated
func (*Identity) ProtoMessage ¶
func (*Identity) ProtoMessage()
func (*Identity) ProtoReflect ¶ added in v1.21.0
func (x *Identity) ProtoReflect() protoreflect.Message