{"record":{"id":"1be0ad333b346969","repo":"slackhq/nebula","slug":"errnopayload","errorCode":"ErrNoPayload","errorMessage":"provided payload was empty","messagePattern":"provided payload was empty","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cert/errors.go","lineNumber":35,"sourceCode":"\tErrInvalidPublicKey           = errors.New(\"invalid public key\")\n\tErrInvalidPrivateKey          = errors.New(\"invalid private key\")\n\tErrPublicPrivateCurveMismatch = errors.New(\"public key does not match private key curve\")\n\tErrPublicPrivateKeyMismatch   = errors.New(\"public key and private key are not a pair\")\n\tErrPrivateKeyEncrypted        = errors.New(\"private key must be decrypted\")\n\tErrCaNotFound                 = errors.New(\"could not find ca for the certificate\")\n\tErrUnknownVersion             = errors.New(\"certificate version unrecognized\")\n\tErrCertPubkeyPresent          = errors.New(\"certificate has unexpected pubkey present\")\n\tErrCurveMismatch              = errors.New(\"certificate curve does not match CA\")\n\n\tErrInvalidPEMBlock                   = errors.New(\"input did not contain a valid PEM encoded block\")\n\tErrInvalidPEMCertificateBanner       = errors.New(\"bytes did not contain a proper certificate banner\")\n\tErrInvalidPEMX25519PublicKeyBanner   = errors.New(\"bytes did not contain a proper X25519 public key banner\")\n\tErrInvalidPEMX25519PrivateKeyBanner  = errors.New(\"bytes did not contain a proper X25519 private key banner\")\n\tErrInvalidPEMEd25519PublicKeyBanner  = errors.New(\"bytes did not contain a proper Ed25519 public key banner\")\n\tErrInvalidPEMEd25519PrivateKeyBanner = errors.New(\"bytes did not contain a proper Ed25519 private key banner\")\n\n\tErrNoPeerStaticKey = errors.New(\"no peer static key was present\")\n\tErrNoPayload       = errors.New(\"provided payload was empty\")\n\n\tErrMissingDetails  = errors.New(\"certificate did not contain details\")\n\tErrEmptySignature  = errors.New(\"empty signature\")\n\tErrEmptyRawDetails = errors.New(\"empty rawDetails not allowed\")\n)\n\ntype ErrInvalidCertificateProperties struct {\n\tstr string\n}\n\nfunc NewErrInvalidCertificateProperties(format string, a ...any) error {\n\treturn &ErrInvalidCertificateProperties{fmt.Sprintf(format, a...)}\n}\n\nfunc (e *ErrInvalidCertificateProperties) Error() string {\n\treturn e.str\n}\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/cert/errors.go#L17-L53","documentation":"ErrNoPayload is returned by Recombine when the rawCertBytes argument is nil. The raw certificate bytes are the payload being recombined; an empty payload gives Recombine nothing to work with, so it fails immediately.","triggerScenarios":"Calling cert.Recombine(version, nil, publicKey, curve) — the raw certificate byte slice is nil, e.g. when upstream marshalling failed silently or the handshake frame had no cert field.","commonSituations":"Handshake message received without the certificate payload; a previous Marshal/MarshalForHandshakes error swallowed and nil propagated; peer sending an empty certificate frame.","solutions":["Verify rawCertBytes is non-nil before calling Recombine","Check that the earlier Marshal/MarshalForHandshakes call succeeded and its output was stored","Log/handle empty handshake certificate payloads on the wire before recombining"],"exampleFix":"// before\ncert, err := Recombine(v, raw, pub, curve) // raw == nil\n// after\nif len(raw) == 0 {\n    return nil, fmt.Errorf(\"empty certificate payload\")\n}\ncert, err := Recombine(v, raw, pub, curve)","handlingStrategy":"validation","validationCode":"if len(rawCertBytes) == 0 {\n    return fmt.Errorf(\"empty certificate payload; cannot Recombine\")\n}","typeGuard":"func hasPayload(b []byte) bool { return len(b) > 0 }","tryCatchPattern":"c, err := cert.Recombine(v, raw, pub, curve)\nif errors.Is(err, cert.ErrNoPayload) {\n    // drop/handle empty cert frame from peer\n}","preventionTips":["Check the error return of Marshal/MarshalForHandshakes before using their output","Reject handshake frames lacking a certificate payload before processing","Add a nil/empty guard where handshake bytes are unpacked"],"tags":["handshake","payload","nil-argument"],"backgroundTag":"missing-certificate-payload","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}