{"record":{"id":"2fafe6ced0d6818a","repo":"can1357/oh-my-pi","slug":"unsupported-rpm-signature-type-signaturetype-o","errorCode":null,"errorMessage":"Unsupported RPM signature type ${signatureType}; only header signatures are supported","messagePattern":"Unsupported RPM signature type (.+?); only header signatures are supported","errorType":"validation","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rpm.ts","lineNumber":253,"sourceCode":"\t\t\treturn lzmaAloneDecompress(payload, maxOutput);\n\t\tcase \"none\":\n\t\t\tif (!sniffCpio(payload))\n\t\t\t\tthrow new ArchiveError(`RPM package '${identity}' has an invalid uncompressed CPIO payload`);\n\t\t\treturn payload;\n\t\tdefault:\n\t\t\tthrow new ArchiveError(`RPM package '${identity}' uses unsupported payload compressor '${method}'`);\n\t}\n}\n\nasync function readRpmArchive(source: ByteSource, options: FormatReadOptions): Promise<ArchiveIndexEntry[]> {\n\tconst initial = await readExact(source, 0, RPM_LEAD_SIZE + RPM_HEADER_INTRO_SIZE, \"lead and signature header\");\n\tif (!sniffRpm(initial)) throw new ArchiveError(\"Invalid RPM package: bad lead magic\");\n\tconst major = initial[4]!;\n\tconst packageType = (initial[6]! << 8) | initial[7]!;\n\tif (major < 3 || packageType > 1) throw new ArchiveError(\"Unsupported RPM package lead version or type\");\n\tconst signatureType = (initial[78]! << 8) | initial[79]!;\n\tif (signatureType !== RPM_SIGNATURE_TYPE_HEADER) {\n\t\tthrow new ArchiveError(`Unsupported RPM signature type ${signatureType}; only header signatures are supported`);\n\t}\n\tconst leadNameEnd = initial.subarray(10, 76).indexOf(0);\n\tconst leadNameBytes = initial.subarray(10, leadNameEnd < 0 ? 76 : 10 + leadNameEnd);\n\tlet leadName = \"unknown package\";\n\ttry {\n\t\tconst decoded = new TextDecoder(\"utf-8\", { fatal: true }).decode(leadNameBytes);\n\t\tif (decoded) leadName = decoded;\n\t} catch {}\n\n\tconst signatureIntro = parseHeaderIntro(initial.subarray(RPM_LEAD_SIZE), options, \"signature\");\n\tconst signatureEnd = RPM_LEAD_SIZE + signatureIntro.totalSize;\n\tconst mainHeaderOffset = align(signatureEnd, 8);\n\tconst signatureBodyAndPadding = await readExact(\n\t\tsource,\n\t\tRPM_LEAD_SIZE + RPM_HEADER_INTRO_SIZE,\n\t\tmainHeaderOffset,\n\t\t\"signature header\",\n\t);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rpm.ts#L235-L271","documentation":"The lead's signature type field (big-endian u16 at offsets 78-79) is not 5 (RPMSIG_HEADERSIG). Only header-style signatures carry the parseable header structure this reader needs; legacy signature types (1-4) are rejected with the offending value in the message.","triggerScenarios":"Reading an RPM whose lead declares a pre-header signature format (signatureType != 5), e.g. packages signed/stored with the old PGP/GPG non-header signature styles from very old rpm releases.","commonSituations":"Encountering museum-grade RPMs from pre-RPM 3 distributions, or files repacked by nonstandard tooling that wrote an obsolete signature type.","solutions":["Re-download the package from a current repository — virtually all modern RPMs use signature type 5.","Re-sign or repack the package with a modern rpm version (rpm --resign / rpmbuild) to convert to a header signature.","If the file is genuinely ancient, extract it on a legacy rpm installation or via rpm2cpio in a container with an old rpm.","Verify the artifact is not hand-modified; a wrong signatureType value suggests corruption or custom rewriting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function rpmSignatureType(path: string): Promise<number | null> {\n  const b = new Uint8Array(await Bun.file(path).slice(78, 80).arrayBuffer());\n  if (b.length < 2) return null;\n  return (b[0]! << 8) | b[1]!;\n}\n// require === 5 before reading","typeGuard":"function hasHeaderSignatureType(lead: Uint8Array): boolean {\n  return ((lead[78] ?? 0) << 8 | (lead[79] ?? 0)) === 5;\n}","tryCatchPattern":"try {\n  return await readRpm(path);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes('signature type')) {\n    throw new Error('RPM uses a legacy signature type; re-sign/repack with modern rpm');\n  }\n  throw err;\n}","preventionTips":["Source packages from current repositories (modern rpm always writes signature type 5).","Re-sign legacy packages with rpm --resign before processing.","Treat unexpected signatureType values as corruption and quarantine the file."],"tags":["rpm","signature","unsupported-format","archive"],"backgroundTag":"unsupported-archive-version","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}