{"record":{"id":"5a04071ed55dc47a","repo":"slackhq/nebula","slug":"unsupported-curve-s","errorCode":null,"errorMessage":"unsupported curve: %s","messagePattern":"unsupported curve: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pki.go","lineNumber":260,"sourceCode":"// When fips140Enforced is true (FIPS 140-only mode), non-approved algorithms\n// (Curve25519 and ChaChaPoly) are rejected with an error. Callers pass\n// fips140.Enforced() for fips140Enforced.\nfunc newCipherSuite(curve cert.Curve, pkcs11backed bool, cipher string, fips140Enforced bool) (noise.CipherSuite, error) {\n\tvar dhFunc noise.DHFunc\n\tswitch curve {\n\tcase cert.Curve_CURVE25519:\n\t\tif fips140Enforced {\n\t\t\treturn nil, errors.New(\"pki: use of Curve25519 is not allowed in FIPS 140-only mode\")\n\t\t}\n\t\tdhFunc = noise.DH25519\n\tcase cert.Curve_P256:\n\t\tif pkcs11backed {\n\t\t\tdhFunc = noiseutil.DHP256PKCS11\n\t\t} else {\n\t\t\tdhFunc = noiseutil.DHP256\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported curve: %s\", curve)\n\t}\n\n\tif cipher == \"chachapoly\" {\n\t\tif fips140Enforced {\n\t\t\treturn nil, errors.New(\"pki: use of ChaChaPoly is not allowed in FIPS 140-only mode\")\n\t\t}\n\t\treturn noise.NewCipherSuite(dhFunc, noise.CipherChaChaPoly, noise.HashSHA256), nil\n\t}\n\treturn noise.NewCipherSuite(dhFunc, noiseutil.CipherAESGCM, noise.HashSHA256), nil\n}\n\nfunc (cs *CertState) String() string {\n\tb, err := cs.MarshalJSON()\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"error marshaling certificate state: %v\", err)\n\t}\n\treturn string(b)\n}","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/pki.go#L242-L278","documentation":"newCipherSuite maps a configured curve name (plus cipher and pkcs11backed flag) to Noise DH functions. If the curve string is not one of the supported values (e.g. 25519 or P256), it returns this error naming the unsupported curve.","triggerScenarios":"Configuring nebula with a `curve` value in the config file (or calling newCipherSuite directly, e.g. in TestNewCipherSuiteUnsupportedCurve) with a name outside the supported set such as \"secp256r1\", \"p384\", or a typo like \"p25519\".","commonSituations":"Copy-pasted config from another VPN tool using different curve naming; manual edits introducing typos; attempts to use P-384/other curves which this library doesn't implement; leftover config from older nebula versions with different accepted values.","solutions":["Set `curve` in the config to a supported value: \"25519\" or \"P256\".","Check for typos/case — the match is on exact strings like \"P256\", not \"p256\" or \"secp256k1\".","If P-384 or another curve is needed, that is not supported; stay with the supported curves.","If the cert is P-256 but config says 25519 (or vice versa), align `curve` with the certificate's curve."],"exampleFix":"# before\npki:\n  curve: secp256r1\n# after\npki:\n  curve: P256","handlingStrategy":"validation","validationCode":"var validCurves = map[string]bool{\"25519\": true, \"P256\": true}\nfunc validateCurve(curve string) error {\n  if !validCurves[curve] {\n    return fmt.Errorf(\"curve %q not supported; use 25519 or P256\", curve)\n  }\n  return nil\n}\n// call before loading full config\nif err := validateCurve(cfg.PKI.Curve); err != nil { log.Fatal(err) }","typeGuard":"func curveSupported(c string) bool { return c == \"25519\" || c == \"P256\" }","tryCatchPattern":"cs, err := newCipherSuite(curve, cipher, fipsEnforced, pkcs11backed)\nif err != nil {\n  if strings.Contains(err.Error(), \"unsupported curve\") {\n    return fmt.Errorf(\"config pki.curve must be 25519 or P256 (got %s): %w\", curve, err)\n  }\n  return err\n}","preventionTips":["Validate the whole config with `nebula -configtest` (or equivalent) before launch.","Use only documented curve strings: 25519 or P256, exact case.","Keep `curve` consistent with the certificate's actual curve.","Lint config templates so external naming conventions (secp256r1 etc.) never leak in."],"tags":["config","curve","noise","validation"],"backgroundTag":"unsupported-curve-config","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"}