{"record":{"id":"74951d0ac4693a5e","repo":"slackhq/nebula","slug":"errmissingdetails","errorCode":"ErrMissingDetails","errorMessage":"certificate did not contain details","messagePattern":"certificate did not contain details","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cert/errors.go","lineNumber":37,"sourceCode":"\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":19,"sourceCodeEnd":53,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/cert/errors.go#L19-L53","documentation":"ErrMissingDetails is returned by Fingerprint (and exercised in certificateV2 JSON marshalling tests) when the certificate's rawDetails field is empty. A certificate without its details blob has nothing to fingerprint or serialize, so the accessor fails rather than returning a meaningless empty value.","triggerScenarios":"Calling Fingerprint() on a certificateV2 whose rawDetails is empty — typically a certificate constructed programmatically (or via unmarshalling) without ever having details set.","commonSituations":"Building a certificate in tests or tooling and forgetting to set details; unmarshalling a truncated/invalid certificate; JSON-marshalling a partially initialized certificateV2.","solutions":["Ensure the certificate's details are set (via the constructor/unmarshal path) before calling Fingerprint or MarshalJSON","Validate the certificate source data — truncated input yields empty rawDetails","In tests, marshal the details first (details.Marshal()) so rawDetails is populated"],"exampleFix":"// before\nc := &certificateV2{} // rawDetails never set\nfp, err := c.Fingerprint()\n// after\nrd, err := nc.details.Marshal()\nnc.rawDetails = rd\nfp, err := nc.Fingerprint()","handlingStrategy":"validation","validationCode":"if len(c.rawDetails) == 0 {\n    return fmt.Errorf(\"certificate has no details; cannot fingerprint\")\n}","typeGuard":"func hasDetails(c interface{ Marshal() ([]byte, error) }) bool {\n    _, err := c.Marshal()\n    return err == nil\n}","tryCatchPattern":"fp, err := c.Fingerprint()\nif errors.Is(err, cert.ErrMissingDetails) {\n    // rehydrate certificate from full encoded bytes before use\n}","preventionTips":["Construct certificates via library constructors, not bare struct literals","Re-parse certificates from their full encoded form instead of hand-assembling","When unmarshalling, verify details were present in the source bytes"],"tags":["certificate","fingerprint","uninitialized"],"backgroundTag":"missing-certificate-details","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"}