8a94a6344a
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
1153 lines
28 KiB
Go
1153 lines
28 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: v2/service/grpc/verify.proto
|
|
|
|
package service
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// 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.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// Signature of something in NeoFS
|
|
type Signature struct {
|
|
// Public key used for signing.
|
|
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
// Signature
|
|
Sign []byte `protobuf:"bytes,2,opt,name=sign,proto3" json:"sign,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Signature) Reset() { *m = Signature{} }
|
|
func (m *Signature) String() string { return proto.CompactTextString(m) }
|
|
func (*Signature) ProtoMessage() {}
|
|
func (*Signature) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_333853833d6163d3, []int{0}
|
|
}
|
|
func (m *Signature) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Signature.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Signature) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Signature.Merge(m, src)
|
|
}
|
|
func (m *Signature) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Signature) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Signature.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Signature proto.InternalMessageInfo
|
|
|
|
func (m *Signature) GetKey() []byte {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Signature) GetSign() []byte {
|
|
if m != nil {
|
|
return m.Sign
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Verification info for request signed by all intermediate nodes
|
|
type RequestVerificationHeader struct {
|
|
// Request Body signature. Should be generated once by request initiator.
|
|
BodySignature *Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"`
|
|
// Request Meta signature is added and signed by any intermediate node
|
|
MetaSignature *Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"`
|
|
// Sign previous hops
|
|
OriginSignature *Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"`
|
|
// Chain of previous hops signatures
|
|
Origin *RequestVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) Reset() { *m = RequestVerificationHeader{} }
|
|
func (m *RequestVerificationHeader) String() string { return proto.CompactTextString(m) }
|
|
func (*RequestVerificationHeader) ProtoMessage() {}
|
|
func (*RequestVerificationHeader) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_333853833d6163d3, []int{1}
|
|
}
|
|
func (m *RequestVerificationHeader) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *RequestVerificationHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_RequestVerificationHeader.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *RequestVerificationHeader) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RequestVerificationHeader.Merge(m, src)
|
|
}
|
|
func (m *RequestVerificationHeader) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *RequestVerificationHeader) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RequestVerificationHeader.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RequestVerificationHeader proto.InternalMessageInfo
|
|
|
|
func (m *RequestVerificationHeader) GetBodySignature() *Signature {
|
|
if m != nil {
|
|
return m.BodySignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) GetMetaSignature() *Signature {
|
|
if m != nil {
|
|
return m.MetaSignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) GetOriginSignature() *Signature {
|
|
if m != nil {
|
|
return m.OriginSignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader {
|
|
if m != nil {
|
|
return m.Origin
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Verification info for response signed by all intermediate nodes
|
|
type ResponseVerificationHeader struct {
|
|
// Response Body signature. Should be generated once by answering node.
|
|
BodySignature *Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"`
|
|
// Response Meta signature is added and signed by any intermediate node
|
|
MetaSignature *Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"`
|
|
// Sign previous hops
|
|
OriginSignature *Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"`
|
|
// Chain of previous hops signatures
|
|
Origin *ResponseVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) Reset() { *m = ResponseVerificationHeader{} }
|
|
func (m *ResponseVerificationHeader) String() string { return proto.CompactTextString(m) }
|
|
func (*ResponseVerificationHeader) ProtoMessage() {}
|
|
func (*ResponseVerificationHeader) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_333853833d6163d3, []int{2}
|
|
}
|
|
func (m *ResponseVerificationHeader) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *ResponseVerificationHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_ResponseVerificationHeader.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *ResponseVerificationHeader) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ResponseVerificationHeader.Merge(m, src)
|
|
}
|
|
func (m *ResponseVerificationHeader) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *ResponseVerificationHeader) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ResponseVerificationHeader.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ResponseVerificationHeader proto.InternalMessageInfo
|
|
|
|
func (m *ResponseVerificationHeader) GetBodySignature() *Signature {
|
|
if m != nil {
|
|
return m.BodySignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) GetMetaSignature() *Signature {
|
|
if m != nil {
|
|
return m.MetaSignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) GetOriginSignature() *Signature {
|
|
if m != nil {
|
|
return m.OriginSignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader {
|
|
if m != nil {
|
|
return m.Origin
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Signature)(nil), "neo.fs.v2.service.Signature")
|
|
proto.RegisterType((*RequestVerificationHeader)(nil), "neo.fs.v2.service.RequestVerificationHeader")
|
|
proto.RegisterType((*ResponseVerificationHeader)(nil), "neo.fs.v2.service.ResponseVerificationHeader")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("v2/service/grpc/verify.proto", fileDescriptor_333853833d6163d3) }
|
|
|
|
var fileDescriptor_333853833d6163d3 = []byte{
|
|
// 335 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x33, 0xd2, 0x2f,
|
|
0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x4f, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x4b, 0x2d, 0xca,
|
|
0x4c, 0xab, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xcc, 0x4b, 0xcd, 0xd7, 0x4b, 0x2b,
|
|
0xd6, 0x2b, 0x33, 0xd2, 0x83, 0x2a, 0x52, 0x32, 0xe4, 0xe2, 0x0c, 0xce, 0x4c, 0xcf, 0x4b, 0x2c,
|
|
0x29, 0x2d, 0x4a, 0x15, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0,
|
|
0x09, 0x02, 0x31, 0x85, 0x84, 0xb8, 0x58, 0x8a, 0x33, 0xd3, 0xf3, 0x24, 0x98, 0xc0, 0x42, 0x60,
|
|
0xb6, 0xd2, 0x16, 0x26, 0x2e, 0xc9, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x92, 0x30, 0x90, 0xe9,
|
|
0x99, 0xc9, 0x89, 0x25, 0x99, 0xf9, 0x79, 0x1e, 0xa9, 0x89, 0x29, 0xa9, 0x45, 0x42, 0xce, 0x5c,
|
|
0x7c, 0x49, 0xf9, 0x29, 0x95, 0xf1, 0xc5, 0x30, 0x53, 0xc1, 0xc6, 0x71, 0x1b, 0xc9, 0xe8, 0x61,
|
|
0x58, 0xae, 0x07, 0xb7, 0x39, 0x88, 0x17, 0xa4, 0x07, 0xe1, 0x10, 0x67, 0x2e, 0xbe, 0xdc, 0xd4,
|
|
0x92, 0x44, 0x24, 0x43, 0x98, 0x88, 0x31, 0x04, 0xa4, 0x07, 0x61, 0x88, 0x3b, 0x97, 0x40, 0x7e,
|
|
0x51, 0x66, 0x7a, 0x66, 0x1e, 0x92, 0x31, 0xcc, 0x44, 0x18, 0xc3, 0x0f, 0xd1, 0x85, 0x30, 0xc8,
|
|
0x85, 0x8b, 0x0d, 0x22, 0x24, 0xc1, 0x02, 0xd6, 0xae, 0x83, 0x45, 0x3b, 0xce, 0x00, 0x09, 0x82,
|
|
0xea, 0x55, 0xda, 0xc6, 0xc4, 0x25, 0x15, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x3a, 0x32,
|
|
0xc2, 0xcd, 0x15, 0x2d, 0xdc, 0x74, 0xb1, 0x86, 0x1b, 0xae, 0x10, 0x81, 0x05, 0x9c, 0x53, 0xd2,
|
|
0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c,
|
|
0x43, 0x94, 0x65, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x5e, 0x71,
|
|
0x41, 0x72, 0xb2, 0x6e, 0x4a, 0x6a, 0x99, 0x7e, 0x5e, 0x6a, 0x7e, 0x5a, 0xb1, 0x6e, 0x62, 0x41,
|
|
0xa6, 0x6e, 0x7a, 0xbe, 0x3e, 0x5a, 0x3e, 0xb0, 0x86, 0x72, 0x56, 0x31, 0x89, 0xf8, 0xa5, 0xe6,
|
|
0xbb, 0x05, 0xeb, 0x39, 0x06, 0x78, 0x82, 0x9c, 0x11, 0x0c, 0x11, 0x4e, 0x62, 0x03, 0x67, 0x10,
|
|
0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0xd7, 0x4d, 0x30, 0x40, 0x03, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *Signature) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Signature) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Signature) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.Sign) > 0 {
|
|
i -= len(m.Sign)
|
|
copy(dAtA[i:], m.Sign)
|
|
i = encodeVarintVerify(dAtA, i, uint64(len(m.Sign)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if len(m.Key) > 0 {
|
|
i -= len(m.Key)
|
|
copy(dAtA[i:], m.Key)
|
|
i = encodeVarintVerify(dAtA, i, uint64(len(m.Key)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Origin != nil {
|
|
{
|
|
size, err := m.Origin.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
if m.OriginSignature != nil {
|
|
{
|
|
size, err := m.OriginSignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if m.MetaSignature != nil {
|
|
{
|
|
size, err := m.MetaSignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if m.BodySignature != nil {
|
|
{
|
|
size, err := m.BodySignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Origin != nil {
|
|
{
|
|
size, err := m.Origin.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
if m.OriginSignature != nil {
|
|
{
|
|
size, err := m.OriginSignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if m.MetaSignature != nil {
|
|
{
|
|
size, err := m.MetaSignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if m.BodySignature != nil {
|
|
{
|
|
size, err := m.BodySignature.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintVerify(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintVerify(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovVerify(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *Signature) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Key)
|
|
if l > 0 {
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
l = len(m.Sign)
|
|
if l > 0 {
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *RequestVerificationHeader) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.BodySignature != nil {
|
|
l = m.BodySignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.MetaSignature != nil {
|
|
l = m.MetaSignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.OriginSignature != nil {
|
|
l = m.OriginSignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.Origin != nil {
|
|
l = m.Origin.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *ResponseVerificationHeader) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.BodySignature != nil {
|
|
l = m.BodySignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.MetaSignature != nil {
|
|
l = m.MetaSignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.OriginSignature != nil {
|
|
l = m.OriginSignature.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.Origin != nil {
|
|
l = m.Origin.Size()
|
|
n += 1 + l + sovVerify(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovVerify(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozVerify(x uint64) (n int) {
|
|
return sovVerify(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *Signature) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Signature: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Signature: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Key == nil {
|
|
m.Key = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Sign", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Sign = append(m.Sign[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Sign == nil {
|
|
m.Sign = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipVerify(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *RequestVerificationHeader) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: RequestVerificationHeader: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: RequestVerificationHeader: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field BodySignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.BodySignature == nil {
|
|
m.BodySignature = &Signature{}
|
|
}
|
|
if err := m.BodySignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field MetaSignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.MetaSignature == nil {
|
|
m.MetaSignature = &Signature{}
|
|
}
|
|
if err := m.MetaSignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field OriginSignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.OriginSignature == nil {
|
|
m.OriginSignature = &Signature{}
|
|
}
|
|
if err := m.OriginSignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Origin == nil {
|
|
m.Origin = &RequestVerificationHeader{}
|
|
}
|
|
if err := m.Origin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipVerify(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *ResponseVerificationHeader) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: ResponseVerificationHeader: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: ResponseVerificationHeader: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field BodySignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.BodySignature == nil {
|
|
m.BodySignature = &Signature{}
|
|
}
|
|
if err := m.BodySignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field MetaSignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.MetaSignature == nil {
|
|
m.MetaSignature = &Signature{}
|
|
}
|
|
if err := m.MetaSignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field OriginSignature", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.OriginSignature == nil {
|
|
m.OriginSignature = &Signature{}
|
|
}
|
|
if err := m.OriginSignature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Origin == nil {
|
|
m.Origin = &ResponseVerificationHeader{}
|
|
}
|
|
if err := m.Origin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipVerify(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthVerify
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipVerify(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
depth := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 1:
|
|
iNdEx += 8
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowVerify
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthVerify
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupVerify
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthVerify
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthVerify = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowVerify = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupVerify = fmt.Errorf("proto: unexpected end of group")
|
|
)
|