File
Blob: spec/protocol/keyless_vtproto.pb.go
| 1 | // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 2 | // protoc-gen-go-vtproto version: v0.6.0 |
| 3 | // source: spec/proto/keyless.proto |
| 4 | |
| 5 | package protocol |
| 6 | |
| 7 | import ( |
| 8 | fmt "fmt" |
| 9 | protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 10 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 11 | io "io" |
| 12 | ) |
| 13 | |
| 14 | const ( |
| 15 | // Verify that this generated code is sufficiently up-to-date. |
| 16 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 17 | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| 18 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 19 | ) |
| 20 | |
| 21 | func (m *KeylessGetCertificateRequest) MarshalVT() (dAtA []byte, err error) { |
| 22 | if m == nil { |
| 23 | return nil, nil |
| 24 | } |
| 25 | size := m.SizeVT() |
| 26 | dAtA = make([]byte, size) |
| 27 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | return dAtA[:n], nil |
| 32 | } |
| 33 | |
| 34 | func (m *KeylessGetCertificateRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 35 | size := m.SizeVT() |
| 36 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 37 | } |
| 38 | |
| 39 | func (m *KeylessGetCertificateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 40 | if m == nil { |
| 41 | return 0, nil |
| 42 | } |
| 43 | i := len(dAtA) |
| 44 | _ = i |
| 45 | var l int |
| 46 | _ = l |
| 47 | if m.unknownFields != nil { |
| 48 | i -= len(m.unknownFields) |
| 49 | copy(dAtA[i:], m.unknownFields) |
| 50 | } |
| 51 | if len(m.Hostname) > 0 { |
| 52 | i -= len(m.Hostname) |
| 53 | copy(dAtA[i:], m.Hostname) |
| 54 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 55 | i-- |
| 56 | dAtA[i] = 0x12 |
| 57 | } |
| 58 | if m.Proof != nil { |
| 59 | size, err := m.Proof.MarshalToSizedBufferVT(dAtA[:i]) |
| 60 | if err != nil { |
| 61 | return 0, err |
| 62 | } |
| 63 | i -= size |
| 64 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 65 | i-- |
| 66 | dAtA[i] = 0xa |
| 67 | } |
| 68 | return len(dAtA) - i, nil |
| 69 | } |
| 70 | |
| 71 | func (m *KeylessGetCertificateResponse) MarshalVT() (dAtA []byte, err error) { |
| 72 | if m == nil { |
| 73 | return nil, nil |
| 74 | } |
| 75 | size := m.SizeVT() |
| 76 | dAtA = make([]byte, size) |
| 77 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 78 | if err != nil { |
| 79 | return nil, err |
| 80 | } |
| 81 | return dAtA[:n], nil |
| 82 | } |
| 83 | |
| 84 | func (m *KeylessGetCertificateResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 85 | size := m.SizeVT() |
| 86 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 87 | } |
| 88 | |
| 89 | func (m *KeylessGetCertificateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 90 | if m == nil { |
| 91 | return 0, nil |
| 92 | } |
| 93 | i := len(dAtA) |
| 94 | _ = i |
| 95 | var l int |
| 96 | _ = l |
| 97 | if m.unknownFields != nil { |
| 98 | i -= len(m.unknownFields) |
| 99 | copy(dAtA[i:], m.unknownFields) |
| 100 | } |
| 101 | if len(m.Certificates) > 0 { |
| 102 | for iNdEx := len(m.Certificates) - 1; iNdEx >= 0; iNdEx-- { |
| 103 | i -= len(m.Certificates[iNdEx]) |
| 104 | copy(dAtA[i:], m.Certificates[iNdEx]) |
| 105 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Certificates[iNdEx]))) |
| 106 | i-- |
| 107 | dAtA[i] = 0xa |
| 108 | } |
| 109 | } |
| 110 | return len(dAtA) - i, nil |
| 111 | } |
| 112 | |
| 113 | func (m *KeylessSignRequest) MarshalVT() (dAtA []byte, err error) { |
| 114 | if m == nil { |
| 115 | return nil, nil |
| 116 | } |
| 117 | size := m.SizeVT() |
| 118 | dAtA = make([]byte, size) |
| 119 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 120 | if err != nil { |
| 121 | return nil, err |
| 122 | } |
| 123 | return dAtA[:n], nil |
| 124 | } |
| 125 | |
| 126 | func (m *KeylessSignRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 127 | size := m.SizeVT() |
| 128 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 129 | } |
| 130 | |
| 131 | func (m *KeylessSignRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 132 | if m == nil { |
| 133 | return 0, nil |
| 134 | } |
| 135 | i := len(dAtA) |
| 136 | _ = i |
| 137 | var l int |
| 138 | _ = l |
| 139 | if m.unknownFields != nil { |
| 140 | i -= len(m.unknownFields) |
| 141 | copy(dAtA[i:], m.unknownFields) |
| 142 | } |
| 143 | if m.Algo != 0 { |
| 144 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Algo)) |
| 145 | i-- |
| 146 | dAtA[i] = 0x20 |
| 147 | } |
| 148 | if len(m.Digest) > 0 { |
| 149 | i -= len(m.Digest) |
| 150 | copy(dAtA[i:], m.Digest) |
| 151 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Digest))) |
| 152 | i-- |
| 153 | dAtA[i] = 0x1a |
| 154 | } |
| 155 | if len(m.Hostname) > 0 { |
| 156 | i -= len(m.Hostname) |
| 157 | copy(dAtA[i:], m.Hostname) |
| 158 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 159 | i-- |
| 160 | dAtA[i] = 0x12 |
| 161 | } |
| 162 | if m.Proof != nil { |
| 163 | size, err := m.Proof.MarshalToSizedBufferVT(dAtA[:i]) |
| 164 | if err != nil { |
| 165 | return 0, err |
| 166 | } |
| 167 | i -= size |
| 168 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 169 | i-- |
| 170 | dAtA[i] = 0xa |
| 171 | } |
| 172 | return len(dAtA) - i, nil |
| 173 | } |
| 174 | |
| 175 | func (m *KeylessSignResponse) MarshalVT() (dAtA []byte, err error) { |
| 176 | if m == nil { |
| 177 | return nil, nil |
| 178 | } |
| 179 | size := m.SizeVT() |
| 180 | dAtA = make([]byte, size) |
| 181 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 182 | if err != nil { |
| 183 | return nil, err |
| 184 | } |
| 185 | return dAtA[:n], nil |
| 186 | } |
| 187 | |
| 188 | func (m *KeylessSignResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 189 | size := m.SizeVT() |
| 190 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 191 | } |
| 192 | |
| 193 | func (m *KeylessSignResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 194 | if m == nil { |
| 195 | return 0, nil |
| 196 | } |
| 197 | i := len(dAtA) |
| 198 | _ = i |
| 199 | var l int |
| 200 | _ = l |
| 201 | if m.unknownFields != nil { |
| 202 | i -= len(m.unknownFields) |
| 203 | copy(dAtA[i:], m.unknownFields) |
| 204 | } |
| 205 | if len(m.Signature) > 0 { |
| 206 | i -= len(m.Signature) |
| 207 | copy(dAtA[i:], m.Signature) |
| 208 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Signature))) |
| 209 | i-- |
| 210 | dAtA[i] = 0xa |
| 211 | } |
| 212 | return len(dAtA) - i, nil |
| 213 | } |
| 214 | |
| 215 | func (m *KeylessGetCertificateRequest) SizeVT() (n int) { |
| 216 | if m == nil { |
| 217 | return 0 |
| 218 | } |
| 219 | var l int |
| 220 | _ = l |
| 221 | if m.Proof != nil { |
| 222 | l = m.Proof.SizeVT() |
| 223 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 224 | } |
| 225 | l = len(m.Hostname) |
| 226 | if l > 0 { |
| 227 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 228 | } |
| 229 | n += len(m.unknownFields) |
| 230 | return n |
| 231 | } |
| 232 | |
| 233 | func (m *KeylessGetCertificateResponse) SizeVT() (n int) { |
| 234 | if m == nil { |
| 235 | return 0 |
| 236 | } |
| 237 | var l int |
| 238 | _ = l |
| 239 | if len(m.Certificates) > 0 { |
| 240 | for _, b := range m.Certificates { |
| 241 | l = len(b) |
| 242 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 243 | } |
| 244 | } |
| 245 | n += len(m.unknownFields) |
| 246 | return n |
| 247 | } |
| 248 | |
| 249 | func (m *KeylessSignRequest) SizeVT() (n int) { |
| 250 | if m == nil { |
| 251 | return 0 |
| 252 | } |
| 253 | var l int |
| 254 | _ = l |
| 255 | if m.Proof != nil { |
| 256 | l = m.Proof.SizeVT() |
| 257 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 258 | } |
| 259 | l = len(m.Hostname) |
| 260 | if l > 0 { |
| 261 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 262 | } |
| 263 | l = len(m.Digest) |
| 264 | if l > 0 { |
| 265 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 266 | } |
| 267 | if m.Algo != 0 { |
| 268 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Algo)) |
| 269 | } |
| 270 | n += len(m.unknownFields) |
| 271 | return n |
| 272 | } |
| 273 | |
| 274 | func (m *KeylessSignResponse) SizeVT() (n int) { |
| 275 | if m == nil { |
| 276 | return 0 |
| 277 | } |
| 278 | var l int |
| 279 | _ = l |
| 280 | l = len(m.Signature) |
| 281 | if l > 0 { |
| 282 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 283 | } |
| 284 | n += len(m.unknownFields) |
| 285 | return n |
| 286 | } |
| 287 | |
| 288 | func (m *KeylessGetCertificateRequest) UnmarshalVT(dAtA []byte) error { |
| 289 | l := len(dAtA) |
| 290 | iNdEx := 0 |
| 291 | for iNdEx < l { |
| 292 | preIndex := iNdEx |
| 293 | var wire uint64 |
| 294 | for shift := uint(0); ; shift += 7 { |
| 295 | if shift >= 64 { |
| 296 | return protohelpers.ErrIntOverflow |
| 297 | } |
| 298 | if iNdEx >= l { |
| 299 | return io.ErrUnexpectedEOF |
| 300 | } |
| 301 | b := dAtA[iNdEx] |
| 302 | iNdEx++ |
| 303 | wire |= uint64(b&0x7F) << shift |
| 304 | if b < 0x80 { |
| 305 | break |
| 306 | } |
| 307 | } |
| 308 | fieldNum := int32(wire >> 3) |
| 309 | wireType := int(wire & 0x7) |
| 310 | if wireType == 4 { |
| 311 | return fmt.Errorf("proto: KeylessGetCertificateRequest: wiretype end group for non-group") |
| 312 | } |
| 313 | if fieldNum <= 0 { |
| 314 | return fmt.Errorf("proto: KeylessGetCertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 315 | } |
| 316 | switch fieldNum { |
| 317 | case 1: |
| 318 | if wireType != 2 { |
| 319 | return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) |
| 320 | } |
| 321 | var msglen int |
| 322 | for shift := uint(0); ; shift += 7 { |
| 323 | if shift >= 64 { |
| 324 | return protohelpers.ErrIntOverflow |
| 325 | } |
| 326 | if iNdEx >= l { |
| 327 | return io.ErrUnexpectedEOF |
| 328 | } |
| 329 | b := dAtA[iNdEx] |
| 330 | iNdEx++ |
| 331 | msglen |= int(b&0x7F) << shift |
| 332 | if b < 0x80 { |
| 333 | break |
| 334 | } |
| 335 | } |
| 336 | if msglen < 0 { |
| 337 | return protohelpers.ErrInvalidLength |
| 338 | } |
| 339 | postIndex := iNdEx + msglen |
| 340 | if postIndex < 0 { |
| 341 | return protohelpers.ErrInvalidLength |
| 342 | } |
| 343 | if postIndex > l { |
| 344 | return io.ErrUnexpectedEOF |
| 345 | } |
| 346 | if m.Proof == nil { |
| 347 | m.Proof = &ProofOfWork{} |
| 348 | } |
| 349 | if err := m.Proof.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 350 | return err |
| 351 | } |
| 352 | iNdEx = postIndex |
| 353 | case 2: |
| 354 | if wireType != 2 { |
| 355 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 356 | } |
| 357 | var stringLen uint64 |
| 358 | for shift := uint(0); ; shift += 7 { |
| 359 | if shift >= 64 { |
| 360 | return protohelpers.ErrIntOverflow |
| 361 | } |
| 362 | if iNdEx >= l { |
| 363 | return io.ErrUnexpectedEOF |
| 364 | } |
| 365 | b := dAtA[iNdEx] |
| 366 | iNdEx++ |
| 367 | stringLen |= uint64(b&0x7F) << shift |
| 368 | if b < 0x80 { |
| 369 | break |
| 370 | } |
| 371 | } |
| 372 | intStringLen := int(stringLen) |
| 373 | if intStringLen < 0 { |
| 374 | return protohelpers.ErrInvalidLength |
| 375 | } |
| 376 | postIndex := iNdEx + intStringLen |
| 377 | if postIndex < 0 { |
| 378 | return protohelpers.ErrInvalidLength |
| 379 | } |
| 380 | if postIndex > l { |
| 381 | return io.ErrUnexpectedEOF |
| 382 | } |
| 383 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 384 | iNdEx = postIndex |
| 385 | default: |
| 386 | iNdEx = preIndex |
| 387 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 388 | if err != nil { |
| 389 | return err |
| 390 | } |
| 391 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 392 | return protohelpers.ErrInvalidLength |
| 393 | } |
| 394 | if (iNdEx + skippy) > l { |
| 395 | return io.ErrUnexpectedEOF |
| 396 | } |
| 397 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 398 | iNdEx += skippy |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | if iNdEx > l { |
| 403 | return io.ErrUnexpectedEOF |
| 404 | } |
| 405 | return nil |
| 406 | } |
| 407 | func (m *KeylessGetCertificateResponse) UnmarshalVT(dAtA []byte) error { |
| 408 | l := len(dAtA) |
| 409 | iNdEx := 0 |
| 410 | for iNdEx < l { |
| 411 | preIndex := iNdEx |
| 412 | var wire uint64 |
| 413 | for shift := uint(0); ; shift += 7 { |
| 414 | if shift >= 64 { |
| 415 | return protohelpers.ErrIntOverflow |
| 416 | } |
| 417 | if iNdEx >= l { |
| 418 | return io.ErrUnexpectedEOF |
| 419 | } |
| 420 | b := dAtA[iNdEx] |
| 421 | iNdEx++ |
| 422 | wire |= uint64(b&0x7F) << shift |
| 423 | if b < 0x80 { |
| 424 | break |
| 425 | } |
| 426 | } |
| 427 | fieldNum := int32(wire >> 3) |
| 428 | wireType := int(wire & 0x7) |
| 429 | if wireType == 4 { |
| 430 | return fmt.Errorf("proto: KeylessGetCertificateResponse: wiretype end group for non-group") |
| 431 | } |
| 432 | if fieldNum <= 0 { |
| 433 | return fmt.Errorf("proto: KeylessGetCertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 434 | } |
| 435 | switch fieldNum { |
| 436 | case 1: |
| 437 | if wireType != 2 { |
| 438 | return fmt.Errorf("proto: wrong wireType = %d for field Certificates", wireType) |
| 439 | } |
| 440 | var byteLen int |
| 441 | for shift := uint(0); ; shift += 7 { |
| 442 | if shift >= 64 { |
| 443 | return protohelpers.ErrIntOverflow |
| 444 | } |
| 445 | if iNdEx >= l { |
| 446 | return io.ErrUnexpectedEOF |
| 447 | } |
| 448 | b := dAtA[iNdEx] |
| 449 | iNdEx++ |
| 450 | byteLen |= int(b&0x7F) << shift |
| 451 | if b < 0x80 { |
| 452 | break |
| 453 | } |
| 454 | } |
| 455 | if byteLen < 0 { |
| 456 | return protohelpers.ErrInvalidLength |
| 457 | } |
| 458 | postIndex := iNdEx + byteLen |
| 459 | if postIndex < 0 { |
| 460 | return protohelpers.ErrInvalidLength |
| 461 | } |
| 462 | if postIndex > l { |
| 463 | return io.ErrUnexpectedEOF |
| 464 | } |
| 465 | m.Certificates = append(m.Certificates, make([]byte, postIndex-iNdEx)) |
| 466 | copy(m.Certificates[len(m.Certificates)-1], dAtA[iNdEx:postIndex]) |
| 467 | iNdEx = postIndex |
| 468 | default: |
| 469 | iNdEx = preIndex |
| 470 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 471 | if err != nil { |
| 472 | return err |
| 473 | } |
| 474 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 475 | return protohelpers.ErrInvalidLength |
| 476 | } |
| 477 | if (iNdEx + skippy) > l { |
| 478 | return io.ErrUnexpectedEOF |
| 479 | } |
| 480 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 481 | iNdEx += skippy |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | if iNdEx > l { |
| 486 | return io.ErrUnexpectedEOF |
| 487 | } |
| 488 | return nil |
| 489 | } |
| 490 | func (m *KeylessSignRequest) UnmarshalVT(dAtA []byte) error { |
| 491 | l := len(dAtA) |
| 492 | iNdEx := 0 |
| 493 | for iNdEx < l { |
| 494 | preIndex := iNdEx |
| 495 | var wire uint64 |
| 496 | for shift := uint(0); ; shift += 7 { |
| 497 | if shift >= 64 { |
| 498 | return protohelpers.ErrIntOverflow |
| 499 | } |
| 500 | if iNdEx >= l { |
| 501 | return io.ErrUnexpectedEOF |
| 502 | } |
| 503 | b := dAtA[iNdEx] |
| 504 | iNdEx++ |
| 505 | wire |= uint64(b&0x7F) << shift |
| 506 | if b < 0x80 { |
| 507 | break |
| 508 | } |
| 509 | } |
| 510 | fieldNum := int32(wire >> 3) |
| 511 | wireType := int(wire & 0x7) |
| 512 | if wireType == 4 { |
| 513 | return fmt.Errorf("proto: KeylessSignRequest: wiretype end group for non-group") |
| 514 | } |
| 515 | if fieldNum <= 0 { |
| 516 | return fmt.Errorf("proto: KeylessSignRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 517 | } |
| 518 | switch fieldNum { |
| 519 | case 1: |
| 520 | if wireType != 2 { |
| 521 | return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) |
| 522 | } |
| 523 | var msglen int |
| 524 | for shift := uint(0); ; shift += 7 { |
| 525 | if shift >= 64 { |
| 526 | return protohelpers.ErrIntOverflow |
| 527 | } |
| 528 | if iNdEx >= l { |
| 529 | return io.ErrUnexpectedEOF |
| 530 | } |
| 531 | b := dAtA[iNdEx] |
| 532 | iNdEx++ |
| 533 | msglen |= int(b&0x7F) << shift |
| 534 | if b < 0x80 { |
| 535 | break |
| 536 | } |
| 537 | } |
| 538 | if msglen < 0 { |
| 539 | return protohelpers.ErrInvalidLength |
| 540 | } |
| 541 | postIndex := iNdEx + msglen |
| 542 | if postIndex < 0 { |
| 543 | return protohelpers.ErrInvalidLength |
| 544 | } |
| 545 | if postIndex > l { |
| 546 | return io.ErrUnexpectedEOF |
| 547 | } |
| 548 | if m.Proof == nil { |
| 549 | m.Proof = &ProofOfWork{} |
| 550 | } |
| 551 | if err := m.Proof.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 552 | return err |
| 553 | } |
| 554 | iNdEx = postIndex |
| 555 | case 2: |
| 556 | if wireType != 2 { |
| 557 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 558 | } |
| 559 | var stringLen uint64 |
| 560 | for shift := uint(0); ; shift += 7 { |
| 561 | if shift >= 64 { |
| 562 | return protohelpers.ErrIntOverflow |
| 563 | } |
| 564 | if iNdEx >= l { |
| 565 | return io.ErrUnexpectedEOF |
| 566 | } |
| 567 | b := dAtA[iNdEx] |
| 568 | iNdEx++ |
| 569 | stringLen |= uint64(b&0x7F) << shift |
| 570 | if b < 0x80 { |
| 571 | break |
| 572 | } |
| 573 | } |
| 574 | intStringLen := int(stringLen) |
| 575 | if intStringLen < 0 { |
| 576 | return protohelpers.ErrInvalidLength |
| 577 | } |
| 578 | postIndex := iNdEx + intStringLen |
| 579 | if postIndex < 0 { |
| 580 | return protohelpers.ErrInvalidLength |
| 581 | } |
| 582 | if postIndex > l { |
| 583 | return io.ErrUnexpectedEOF |
| 584 | } |
| 585 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 586 | iNdEx = postIndex |
| 587 | case 3: |
| 588 | if wireType != 2 { |
| 589 | return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) |
| 590 | } |
| 591 | var byteLen int |
| 592 | for shift := uint(0); ; shift += 7 { |
| 593 | if shift >= 64 { |
| 594 | return protohelpers.ErrIntOverflow |
| 595 | } |
| 596 | if iNdEx >= l { |
| 597 | return io.ErrUnexpectedEOF |
| 598 | } |
| 599 | b := dAtA[iNdEx] |
| 600 | iNdEx++ |
| 601 | byteLen |= int(b&0x7F) << shift |
| 602 | if b < 0x80 { |
| 603 | break |
| 604 | } |
| 605 | } |
| 606 | if byteLen < 0 { |
| 607 | return protohelpers.ErrInvalidLength |
| 608 | } |
| 609 | postIndex := iNdEx + byteLen |
| 610 | if postIndex < 0 { |
| 611 | return protohelpers.ErrInvalidLength |
| 612 | } |
| 613 | if postIndex > l { |
| 614 | return io.ErrUnexpectedEOF |
| 615 | } |
| 616 | m.Digest = append(m.Digest[:0], dAtA[iNdEx:postIndex]...) |
| 617 | if m.Digest == nil { |
| 618 | m.Digest = []byte{} |
| 619 | } |
| 620 | iNdEx = postIndex |
| 621 | case 4: |
| 622 | if wireType != 0 { |
| 623 | return fmt.Errorf("proto: wrong wireType = %d for field Algo", wireType) |
| 624 | } |
| 625 | m.Algo = 0 |
| 626 | for shift := uint(0); ; shift += 7 { |
| 627 | if shift >= 64 { |
| 628 | return protohelpers.ErrIntOverflow |
| 629 | } |
| 630 | if iNdEx >= l { |
| 631 | return io.ErrUnexpectedEOF |
| 632 | } |
| 633 | b := dAtA[iNdEx] |
| 634 | iNdEx++ |
| 635 | m.Algo |= KeylessSignRequest_HashAlgorithm(b&0x7F) << shift |
| 636 | if b < 0x80 { |
| 637 | break |
| 638 | } |
| 639 | } |
| 640 | default: |
| 641 | iNdEx = preIndex |
| 642 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 643 | if err != nil { |
| 644 | return err |
| 645 | } |
| 646 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 647 | return protohelpers.ErrInvalidLength |
| 648 | } |
| 649 | if (iNdEx + skippy) > l { |
| 650 | return io.ErrUnexpectedEOF |
| 651 | } |
| 652 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 653 | iNdEx += skippy |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | if iNdEx > l { |
| 658 | return io.ErrUnexpectedEOF |
| 659 | } |
| 660 | return nil |
| 661 | } |
| 662 | func (m *KeylessSignResponse) UnmarshalVT(dAtA []byte) error { |
| 663 | l := len(dAtA) |
| 664 | iNdEx := 0 |
| 665 | for iNdEx < l { |
| 666 | preIndex := iNdEx |
| 667 | var wire uint64 |
| 668 | for shift := uint(0); ; shift += 7 { |
| 669 | if shift >= 64 { |
| 670 | return protohelpers.ErrIntOverflow |
| 671 | } |
| 672 | if iNdEx >= l { |
| 673 | return io.ErrUnexpectedEOF |
| 674 | } |
| 675 | b := dAtA[iNdEx] |
| 676 | iNdEx++ |
| 677 | wire |= uint64(b&0x7F) << shift |
| 678 | if b < 0x80 { |
| 679 | break |
| 680 | } |
| 681 | } |
| 682 | fieldNum := int32(wire >> 3) |
| 683 | wireType := int(wire & 0x7) |
| 684 | if wireType == 4 { |
| 685 | return fmt.Errorf("proto: KeylessSignResponse: wiretype end group for non-group") |
| 686 | } |
| 687 | if fieldNum <= 0 { |
| 688 | return fmt.Errorf("proto: KeylessSignResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 689 | } |
| 690 | switch fieldNum { |
| 691 | case 1: |
| 692 | if wireType != 2 { |
| 693 | return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) |
| 694 | } |
| 695 | var byteLen int |
| 696 | for shift := uint(0); ; shift += 7 { |
| 697 | if shift >= 64 { |
| 698 | return protohelpers.ErrIntOverflow |
| 699 | } |
| 700 | if iNdEx >= l { |
| 701 | return io.ErrUnexpectedEOF |
| 702 | } |
| 703 | b := dAtA[iNdEx] |
| 704 | iNdEx++ |
| 705 | byteLen |= int(b&0x7F) << shift |
| 706 | if b < 0x80 { |
| 707 | break |
| 708 | } |
| 709 | } |
| 710 | if byteLen < 0 { |
| 711 | return protohelpers.ErrInvalidLength |
| 712 | } |
| 713 | postIndex := iNdEx + byteLen |
| 714 | if postIndex < 0 { |
| 715 | return protohelpers.ErrInvalidLength |
| 716 | } |
| 717 | if postIndex > l { |
| 718 | return io.ErrUnexpectedEOF |
| 719 | } |
| 720 | m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) |
| 721 | if m.Signature == nil { |
| 722 | m.Signature = []byte{} |
| 723 | } |
| 724 | iNdEx = postIndex |
| 725 | default: |
| 726 | iNdEx = preIndex |
| 727 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 728 | if err != nil { |
| 729 | return err |
| 730 | } |
| 731 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 732 | return protohelpers.ErrInvalidLength |
| 733 | } |
| 734 | if (iNdEx + skippy) > l { |
| 735 | return io.ErrUnexpectedEOF |
| 736 | } |
| 737 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 738 | iNdEx += skippy |
| 739 | } |
| 740 | } |
| 741 | |
| 742 | if iNdEx > l { |
| 743 | return io.ErrUnexpectedEOF |
| 744 | } |
| 745 | return nil |
| 746 | } |