{"record":{"id":"72343129e4651142","repo":"BigPizzaV3/CodexPlusPlus","slug":"manifest-sig","errorCode":null,"errorMessage":"manifest.sig 超过大小限制","messagePattern":"manifest\\.sig 超过大小限制","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":166,"sourceCode":"        .iter()\n        .find(|name| files.contains_key(**name))\n        .map(|name| (*name).to_string())\n        .context(\"主题包必须包含一个背景图片\")?;\n    if [\"background.webp\", \"background.jpg\", \"background.png\"]\n        .iter()\n        .filter(|name| files.contains_key(**name))\n        .count()\n        != 1\n    {\n        bail!(\"主题包必须且只能包含一个背景图片\");\n    }\n    let image_bytes = files.remove(&image_name).expect(\"image was checked above\");\n    validate_image_content(&image_name, &image_bytes)?;\n    let license_bytes = files.remove(\"LICENSE.txt\");\n    let signature = files.remove(\"manifest.sig\");\n    if let Some(signature) = signature {\n        if signature.len() > SIGNATURE_LIMIT {\n            bail!(\"manifest.sig 超过大小限制\");\n        }\n    }\n    if !files.is_empty() {\n        bail!(\"主题包包含未处理文件\");\n    }\n\n    let manifest: DreamSkinPackageManifest = parse_json(&manifest_bytes, \"manifest.json\")?;\n    validate_manifest(&manifest, platform)?;\n    let theme: Value = parse_json(&theme_bytes, \"theme.json\")?;\n    validate_theme(&theme, &manifest, &image_name)?;\n    let css = String::from_utf8(css_bytes).context(\"theme.css 不是有效 UTF-8\")?;\n    validate_safe_css(&css)?;\n    validate_manifest_files(\n        &manifest,\n        &manifest_bytes,\n        &theme_bytes,\n        css.as_bytes(),\n        &image_name,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_package.rs#L148-L184","documentation":"If the package includes a manifest.sig signature file, its length is checked against SIGNATURE_LIMIT; anything larger is rejected. The signature is optional, so this only fires when manifest.sig exists but is oversized — usually indicating a corrupted or bogus signature blob.","triggerScenarios":"validate_and_read_package reads a manifest.sig entry whose byte length exceeds SIGNATURE_LIMIT (checked after per-file limits already passed).","commonSituations":"Corrupted or concatenated signature file from a bad build script; wrong file placed at manifest.sig; signature file polluted with extra text/line endings.","solutions":["Regenerate manifest.sig with the official signing tool so it's a compact signature blob","Check the file isn't corrupted or containing extra data (hexdump its size vs expected signature length)","Remove manifest.sig if the package is unsigned (signature is optional)","Rebuild the package from a clean source tree"],"exampleFix":"// before: manifest.sig = 8 KiB of garbage\n// after\nsign_tool manifest.json > manifest.sig   # compact valid signature","handlingStrategy":"validation","validationCode":"const SIGNATURE_LIMIT: usize = 4096;\nif let Some(sig) = files.get(\"manifest.sig\") {\n    if sig.len() > SIGNATURE_LIMIT {\n        return Err(SignatureTooLarge(sig.len()));\n    }\n}","typeGuard":null,"tryCatchPattern":"match validate_and_read_package(&bytes, platform) {\n    Err(e) if e.to_string().contains(\"manifest.sig\") => {\n        Err(UserFacingError::InvalidSignatureFile)\n    }\n    other => other,\n}","preventionTips":["Generate manifest.sig only with the official signing tool","Verify signature file size right after signing (should be a few hundred bytes)","Exclude signature files from builds that aren't signed"],"tags":["validation","signature","size-limit"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}