1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-09 17:55:57 +00:00

Update auto-generated code

This patch updates the auto-generated code to match the latest tooling
versions.

In particular, the protobufs are regenerated, and the new version no
longer supports unkeyed literals, so some minor changes are needed.

Other than that, the cipher list is extended with the latest ciphers.
This commit is contained in:
Alberto Bertogli
2019-10-23 00:08:15 +01:00
parent f399fe3e84
commit 0718749314
10 changed files with 691 additions and 311 deletions

View File

@@ -1,24 +1,13 @@
// Code generated by protoc-gen-go.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: userdb.proto
// DO NOT EDIT!
/*
Package userdb is a generated protocol buffer package.
It is generated from these files:
userdb.proto
It has these top-level messages:
ProtoDB
Password
Scrypt
Plain
*/
package userdb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -29,16 +18,39 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type ProtoDB struct {
Users map[string]*Password `protobuf:"bytes,1,rep,name=users" json:"users,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
Users map[string]*Password `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ProtoDB) Reset() { *m = ProtoDB{} }
func (m *ProtoDB) String() string { return proto.CompactTextString(m) }
func (*ProtoDB) ProtoMessage() {}
func (*ProtoDB) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *ProtoDB) Reset() { *m = ProtoDB{} }
func (m *ProtoDB) String() string { return proto.CompactTextString(m) }
func (*ProtoDB) ProtoMessage() {}
func (*ProtoDB) Descriptor() ([]byte, []int) {
return fileDescriptor_1492f046cfa19579, []int{0}
}
func (m *ProtoDB) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProtoDB.Unmarshal(m, b)
}
func (m *ProtoDB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ProtoDB.Marshal(b, m, deterministic)
}
func (m *ProtoDB) XXX_Merge(src proto.Message) {
xxx_messageInfo_ProtoDB.Merge(m, src)
}
func (m *ProtoDB) XXX_Size() int {
return xxx_messageInfo_ProtoDB.Size(m)
}
func (m *ProtoDB) XXX_DiscardUnknown() {
xxx_messageInfo_ProtoDB.DiscardUnknown(m)
}
var xxx_messageInfo_ProtoDB proto.InternalMessageInfo
func (m *ProtoDB) GetUsers() map[string]*Password {
if m != nil {
@@ -51,27 +63,52 @@ type Password struct {
// Types that are valid to be assigned to Scheme:
// *Password_Scrypt
// *Password_Plain
Scheme isPassword_Scheme `protobuf_oneof:"scheme"`
Scheme isPassword_Scheme `protobuf_oneof:"scheme"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Password) Reset() { *m = Password{} }
func (m *Password) String() string { return proto.CompactTextString(m) }
func (*Password) ProtoMessage() {}
func (*Password) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *Password) Reset() { *m = Password{} }
func (m *Password) String() string { return proto.CompactTextString(m) }
func (*Password) ProtoMessage() {}
func (*Password) Descriptor() ([]byte, []int) {
return fileDescriptor_1492f046cfa19579, []int{1}
}
func (m *Password) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Password.Unmarshal(m, b)
}
func (m *Password) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Password.Marshal(b, m, deterministic)
}
func (m *Password) XXX_Merge(src proto.Message) {
xxx_messageInfo_Password.Merge(m, src)
}
func (m *Password) XXX_Size() int {
return xxx_messageInfo_Password.Size(m)
}
func (m *Password) XXX_DiscardUnknown() {
xxx_messageInfo_Password.DiscardUnknown(m)
}
var xxx_messageInfo_Password proto.InternalMessageInfo
type isPassword_Scheme interface {
isPassword_Scheme()
}
type Password_Scrypt struct {
Scrypt *Scrypt `protobuf:"bytes,2,opt,name=scrypt,oneof"`
Scrypt *Scrypt `protobuf:"bytes,2,opt,name=scrypt,proto3,oneof"`
}
type Password_Plain struct {
Plain *Plain `protobuf:"bytes,3,opt,name=plain,oneof"`
Plain *Plain `protobuf:"bytes,3,opt,name=plain,proto3,oneof"`
}
func (*Password_Scrypt) isPassword_Scheme() {}
func (*Password_Plain) isPassword_Scheme() {}
func (*Password_Plain) isPassword_Scheme() {}
func (m *Password) GetScheme() isPassword_Scheme {
if m != nil {
@@ -94,131 +131,161 @@ func (m *Password) GetPlain() *Plain {
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Password) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Password_OneofMarshaler, _Password_OneofUnmarshaler, _Password_OneofSizer, []interface{}{
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Password) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Password_Scrypt)(nil),
(*Password_Plain)(nil),
}
}
func _Password_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Password)
// scheme
switch x := m.Scheme.(type) {
case *Password_Scrypt:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Scrypt); err != nil {
return err
}
case *Password_Plain:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Plain); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Password.Scheme has unexpected type %T", x)
type Scrypt struct {
LogN uint64 `protobuf:"varint,1,opt,name=logN,proto3" json:"logN,omitempty"`
R int32 `protobuf:"varint,2,opt,name=r,proto3" json:"r,omitempty"`
P int32 `protobuf:"varint,3,opt,name=p,proto3" json:"p,omitempty"`
KeyLen int32 `protobuf:"varint,4,opt,name=keyLen,proto3" json:"keyLen,omitempty"`
Salt []byte `protobuf:"bytes,5,opt,name=salt,proto3" json:"salt,omitempty"`
Encrypted []byte `protobuf:"bytes,6,opt,name=encrypted,proto3" json:"encrypted,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Scrypt) Reset() { *m = Scrypt{} }
func (m *Scrypt) String() string { return proto.CompactTextString(m) }
func (*Scrypt) ProtoMessage() {}
func (*Scrypt) Descriptor() ([]byte, []int) {
return fileDescriptor_1492f046cfa19579, []int{2}
}
func (m *Scrypt) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Scrypt.Unmarshal(m, b)
}
func (m *Scrypt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Scrypt.Marshal(b, m, deterministic)
}
func (m *Scrypt) XXX_Merge(src proto.Message) {
xxx_messageInfo_Scrypt.Merge(m, src)
}
func (m *Scrypt) XXX_Size() int {
return xxx_messageInfo_Scrypt.Size(m)
}
func (m *Scrypt) XXX_DiscardUnknown() {
xxx_messageInfo_Scrypt.DiscardUnknown(m)
}
var xxx_messageInfo_Scrypt proto.InternalMessageInfo
func (m *Scrypt) GetLogN() uint64 {
if m != nil {
return m.LogN
}
return 0
}
func (m *Scrypt) GetR() int32 {
if m != nil {
return m.R
}
return 0
}
func (m *Scrypt) GetP() int32 {
if m != nil {
return m.P
}
return 0
}
func (m *Scrypt) GetKeyLen() int32 {
if m != nil {
return m.KeyLen
}
return 0
}
func (m *Scrypt) GetSalt() []byte {
if m != nil {
return m.Salt
}
return nil
}
func _Password_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Password)
switch tag {
case 2: // scheme.scrypt
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Scrypt)
err := b.DecodeMessage(msg)
m.Scheme = &Password_Scrypt{msg}
return true, err
case 3: // scheme.plain
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Plain)
err := b.DecodeMessage(msg)
m.Scheme = &Password_Plain{msg}
return true, err
default:
return false, nil
func (m *Scrypt) GetEncrypted() []byte {
if m != nil {
return m.Encrypted
}
return nil
}
func _Password_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Password)
// scheme
switch x := m.Scheme.(type) {
case *Password_Scrypt:
s := proto.Size(x.Scrypt)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Password_Plain:
s := proto.Size(x.Plain)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type Scrypt struct {
LogN uint64 `protobuf:"varint,1,opt,name=logN" json:"logN,omitempty"`
R int32 `protobuf:"varint,2,opt,name=r" json:"r,omitempty"`
P int32 `protobuf:"varint,3,opt,name=p" json:"p,omitempty"`
KeyLen int32 `protobuf:"varint,4,opt,name=keyLen" json:"keyLen,omitempty"`
Salt []byte `protobuf:"bytes,5,opt,name=salt,proto3" json:"salt,omitempty"`
Encrypted []byte `protobuf:"bytes,6,opt,name=encrypted,proto3" json:"encrypted,omitempty"`
}
func (m *Scrypt) Reset() { *m = Scrypt{} }
func (m *Scrypt) String() string { return proto.CompactTextString(m) }
func (*Scrypt) ProtoMessage() {}
func (*Scrypt) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
type Plain struct {
Password []byte `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
Password []byte `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Plain) Reset() { *m = Plain{} }
func (m *Plain) String() string { return proto.CompactTextString(m) }
func (*Plain) ProtoMessage() {}
func (*Plain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *Plain) Reset() { *m = Plain{} }
func (m *Plain) String() string { return proto.CompactTextString(m) }
func (*Plain) ProtoMessage() {}
func (*Plain) Descriptor() ([]byte, []int) {
return fileDescriptor_1492f046cfa19579, []int{3}
}
func (m *Plain) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Plain.Unmarshal(m, b)
}
func (m *Plain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Plain.Marshal(b, m, deterministic)
}
func (m *Plain) XXX_Merge(src proto.Message) {
xxx_messageInfo_Plain.Merge(m, src)
}
func (m *Plain) XXX_Size() int {
return xxx_messageInfo_Plain.Size(m)
}
func (m *Plain) XXX_DiscardUnknown() {
xxx_messageInfo_Plain.DiscardUnknown(m)
}
var xxx_messageInfo_Plain proto.InternalMessageInfo
func (m *Plain) GetPassword() []byte {
if m != nil {
return m.Password
}
return nil
}
func init() {
proto.RegisterType((*ProtoDB)(nil), "userdb.ProtoDB")
proto.RegisterMapType((map[string]*Password)(nil), "userdb.ProtoDB.UsersEntry")
proto.RegisterType((*Password)(nil), "userdb.Password")
proto.RegisterType((*Scrypt)(nil), "userdb.Scrypt")
proto.RegisterType((*Plain)(nil), "userdb.Plain")
}
func init() { proto.RegisterFile("userdb.proto", fileDescriptor0) }
func init() { proto.RegisterFile("userdb.proto", fileDescriptor_1492f046cfa19579) }
var fileDescriptor0 = []byte{
// 289 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x44, 0x91, 0x41, 0x4b, 0x03, 0x31,
0x10, 0x85, 0x4d, 0xdb, 0xc4, 0x76, 0xba, 0x4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0x14, 0xd5, 0x98, 0x00, 0xb3, 0xb4, 0x94, 0x2b, 0x66, 0x83, 0x32, 0x94, 0xec, 0x95,
0xc1, 0x23, 0x10, 0xfe, 0x51, 0x0f, 0xba, 0x92, 0x23, 0x42, 0x51, 0x85, 0x1c, 0x97, 0x97, 0x8d,
0xe4, 0x9e, 0x26, 0x8a, 0x6a, 0x3c, 0x86, 0x89, 0xae, 0x68, 0x8d, 0x2e, 0xa4, 0x20, 0x63, 0x07,
0xd2, 0x53, 0xe0, 0x74, 0x20, 0xce, 0x61, 0x6c, 0xe2, 0xa3, 0xe9, 0x8c, 0x44, 0xf5, 0x7a, 0x2d,
0xe8, 0xa7, 0x2e, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x93, 0xae, 0x19, 0xb9, 0x01, 0x00,
0x00,
var fileDescriptor_1492f046cfa19579 = []byte{
// 292 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x91, 0x41, 0x4b, 0xc3, 0x40,
0x10, 0x85, 0xbb, 0x6d, 0x77, 0x6d, 0xa7, 0x51, 0xca, 0x1c, 0x64, 0x29, 0x1e, 0x42, 0x44, 0xc9,
0x29, 0x48, 0xbd, 0x88, 0xc7, 0xa2, 0x50, 0x44, 0x44, 0x56, 0xfc, 0x01, 0xa9, 0x59, 0x54, 0x1a,
0x93, 0x65, 0x37, 0x55, 0x72, 0xf5, 0xe2, 0xdf, 0x96, 0x9d, 0x6c, 0xd3, 0xdb, 0xbc, 0xef, 0xcd,
0xbc, 0x99, 0x65, 0x21, 0xda, 0x39, 0x6d, 0x8b, 0x4d, 0x66, 0x6c, 0xdd, 0xd4, 0x28, 0x3a, 0x95,
0xfc, 0x31, 0x38, 0x7a, 0xf6, 0xe4, 0x6e, 0x85, 0x57, 0xc0, 0x3d, 0x75, 0x92, 0xc5, 0xa3, 0x74,
0xb6, 0x5c, 0x64, 0x61, 0x22,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, 0x19,
0xb9, 0x01, 0x00, 0x00,
}

View File

@@ -208,7 +208,9 @@ func TestInvalidUsername(t *testing.T) {
func plainPassword(p string) *Password {
return &Password{
Scheme: &Password_Plain{&Plain{[]byte(p)}},
Scheme: &Password_Plain{
Plain: &Plain{Password: []byte(p)},
},
}
}