1
0
Fork 0
forked from External/grumble

grumble: add support for crypto mode negotiation.

This commit is contained in:
Mikkel Krautz 2012-12-08 22:10:21 +01:00
parent 12381e89c4
commit cabe380244
4 changed files with 43 additions and 8 deletions

View file

@ -36,6 +36,11 @@ type CryptState struct {
cipher cipher.Block
}
// SupportedModes returns the list of supported CryptoModes.
func SupportedModes() []string {
return []string{"OCB2-AES128"}
}
func (cs *CryptState) GenerateKey() error {
_, err := io.ReadFull(rand.Reader, cs.RawKey[0:])
if err != nil {
@ -239,4 +244,4 @@ func (cs *CryptState) Encrypt(dst, src []byte) {
dst[3] = tag[2]
return
}
}

View file

@ -206,11 +206,12 @@ func (x *ContextActionModify_Operation) UnmarshalJSON(data []byte) error {
}
type Version struct {
Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
Release *string `protobuf:"bytes,2,opt,name=release" json:"release,omitempty"`
Os *string `protobuf:"bytes,3,opt,name=os" json:"os,omitempty"`
OsVersion *string `protobuf:"bytes,4,opt,name=os_version" json:"os_version,omitempty"`
XXX_unrecognized []byte `json:"-"`
Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
Release *string `protobuf:"bytes,2,opt,name=release" json:"release,omitempty"`
Os *string `protobuf:"bytes,3,opt,name=os" json:"os,omitempty"`
OsVersion *string `protobuf:"bytes,4,opt,name=os_version" json:"os_version,omitempty"`
CryptoModes []string `protobuf:"bytes,5,rep,name=crypto_modes" json:"crypto_modes,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (this *Version) Reset() { *this = Version{} }

View file

@ -7,6 +7,7 @@ message Version {
optional string release = 2;
optional string os = 3;
optional string os_version = 4;
repeated string crypto_modes = 5;
}
message UDPTunnel {