handshake

package
v2.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const SupportedKeyType = p2pcrypto.Ed25519

Variables

View Source
var (
	ErrInvalidLengthHandshake        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHandshake          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHandshake = fmt.Errorf("proto: unexpected end of group")
)
View Source
var HandshakeFrame_HandshakeStep_name = map[int32]string{
	0:   "STEP_1_KEY_AGREEMENT",
	1:   "STEP_2_KEY_AGREEMENT",
	10:  "STEP_3_DISPATCH",
	20:  "STEP_3A_KNOWN_IDENTITY_PROOF",
	21:  "STEP_4A_KNOWN_IDENTITY_DISCLOSURE",
	22:  "STEP_5A_KNOWN_IDENTITY_DISCLOSURE",
	30:  "STEP_3B_KNOWN_DEVICE_PROOF",
	31:  "STEP_4B_KNOWN_DEVICE_DISCLOSURE",
	999: "STEP_9_DONE",
}
View Source
var HandshakeFrame_HandshakeStep_value = map[string]int32{
	"STEP_1_KEY_AGREEMENT":              0,
	"STEP_2_KEY_AGREEMENT":              1,
	"STEP_3_DISPATCH":                   10,
	"STEP_3A_KNOWN_IDENTITY_PROOF":      20,
	"STEP_4A_KNOWN_IDENTITY_DISCLOSURE": 21,
	"STEP_5A_KNOWN_IDENTITY_DISCLOSURE": 22,
	"STEP_3B_KNOWN_DEVICE_PROOF":        30,
	"STEP_4B_KNOWN_DEVICE_DISCLOSURE":   31,
	"STEP_9_DONE":                       999,
}

Functions

func Request

func Response

func Response(ctx context.Context, conn net.Conn, sk p2pcrypto.PrivKey) (p2pcrypto.PubKey, error)

Types

type HandshakeFrame

type HandshakeFrame struct {
	Step                 HandshakeFrame_HandshakeStep `protobuf:"varint,1,opt,name=step,proto3,enum=handshake.HandshakeFrame_HandshakeStep" json:"step,omitempty"`
	SignatureKey         []byte                       `protobuf:"bytes,2,opt,name=signatureKey,proto3" json:"signatureKey,omitempty"`
	EncryptionKey        []byte                       `protobuf:"bytes,3,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"`
	EncryptedPayload     []byte                       `protobuf:"bytes,4,opt,name=encryptedPayload,proto3" json:"encryptedPayload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

func (*HandshakeFrame) Descriptor

func (*HandshakeFrame) Descriptor() ([]byte, []int)

func (*HandshakeFrame) GetEncryptedPayload

func (m *HandshakeFrame) GetEncryptedPayload() []byte

func (*HandshakeFrame) GetEncryptionKey

func (m *HandshakeFrame) GetEncryptionKey() []byte

func (*HandshakeFrame) GetSignatureKey

func (m *HandshakeFrame) GetSignatureKey() []byte

func (*HandshakeFrame) GetStep

func (*HandshakeFrame) Marshal

func (m *HandshakeFrame) Marshal() (dAtA []byte, err error)

func (*HandshakeFrame) MarshalTo

func (m *HandshakeFrame) MarshalTo(dAtA []byte) (int, error)

func (*HandshakeFrame) MarshalToSizedBuffer

func (m *HandshakeFrame) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HandshakeFrame) ProtoMessage

func (*HandshakeFrame) ProtoMessage()

func (*HandshakeFrame) Reset

func (m *HandshakeFrame) Reset()

func (*HandshakeFrame) Size

func (m *HandshakeFrame) Size() (n int)

func (*HandshakeFrame) String

func (m *HandshakeFrame) String() string

func (*HandshakeFrame) Unmarshal

func (m *HandshakeFrame) Unmarshal(dAtA []byte) error

func (*HandshakeFrame) XXX_DiscardUnknown

func (m *HandshakeFrame) XXX_DiscardUnknown()

func (*HandshakeFrame) XXX_Marshal

func (m *HandshakeFrame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HandshakeFrame) XXX_Merge

func (m *HandshakeFrame) XXX_Merge(src proto.Message)

func (*HandshakeFrame) XXX_Size

func (m *HandshakeFrame) XXX_Size() int

func (*HandshakeFrame) XXX_Unmarshal

func (m *HandshakeFrame) XXX_Unmarshal(b []byte) error

type HandshakeFrame_HandshakeStep

type HandshakeFrame_HandshakeStep int32
const (
	HandshakeFrame_STEP_1_KEY_AGREEMENT              HandshakeFrame_HandshakeStep = 0
	HandshakeFrame_STEP_2_KEY_AGREEMENT              HandshakeFrame_HandshakeStep = 1
	HandshakeFrame_STEP_3_DISPATCH                   HandshakeFrame_HandshakeStep = 10
	HandshakeFrame_STEP_3A_KNOWN_IDENTITY_PROOF      HandshakeFrame_HandshakeStep = 20
	HandshakeFrame_STEP_4A_KNOWN_IDENTITY_DISCLOSURE HandshakeFrame_HandshakeStep = 21
	HandshakeFrame_STEP_5A_KNOWN_IDENTITY_DISCLOSURE HandshakeFrame_HandshakeStep = 22
	HandshakeFrame_STEP_3B_KNOWN_DEVICE_PROOF        HandshakeFrame_HandshakeStep = 30
	HandshakeFrame_STEP_4B_KNOWN_DEVICE_DISCLOSURE   HandshakeFrame_HandshakeStep = 31
	HandshakeFrame_STEP_9_DONE                       HandshakeFrame_HandshakeStep = 999
)

func (HandshakeFrame_HandshakeStep) EnumDescriptor

func (HandshakeFrame_HandshakeStep) EnumDescriptor() ([]byte, []int)

func (HandshakeFrame_HandshakeStep) String

type HandshakePayload

type HandshakePayload struct {
	Signature            []byte   `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
	AccountKey           []byte   `protobuf:"bytes,2,opt,name=accountKey,proto3" json:"accountKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HandshakePayload) Descriptor

func (*HandshakePayload) Descriptor() ([]byte, []int)

func (*HandshakePayload) GetAccountKey

func (m *HandshakePayload) GetAccountKey() []byte

func (*HandshakePayload) GetSignature

func (m *HandshakePayload) GetSignature() []byte

func (*HandshakePayload) Marshal

func (m *HandshakePayload) Marshal() (dAtA []byte, err error)

func (*HandshakePayload) MarshalTo

func (m *HandshakePayload) MarshalTo(dAtA []byte) (int, error)

func (*HandshakePayload) MarshalToSizedBuffer

func (m *HandshakePayload) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HandshakePayload) ProtoMessage

func (*HandshakePayload) ProtoMessage()

func (*HandshakePayload) Reset

func (m *HandshakePayload) Reset()

func (*HandshakePayload) Size

func (m *HandshakePayload) Size() (n int)

func (*HandshakePayload) String

func (m *HandshakePayload) String() string

func (*HandshakePayload) Unmarshal

func (m *HandshakePayload) Unmarshal(dAtA []byte) error

func (*HandshakePayload) XXX_DiscardUnknown

func (m *HandshakePayload) XXX_DiscardUnknown()

func (*HandshakePayload) XXX_Marshal

func (m *HandshakePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HandshakePayload) XXX_Merge

func (m *HandshakePayload) XXX_Merge(src proto.Message)

func (*HandshakePayload) XXX_Size

func (m *HandshakePayload) XXX_Size() int

func (*HandshakePayload) XXX_Unmarshal

func (m *HandshakePayload) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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