{"record":{"id":"6cb0de20122ae0de","repo":"jdx/mise","slug":"unknown-checksum-algorithm","errorCode":null,"errorMessage":"Unknown checksum algorithm: {}","messagePattern":"Unknown checksum algorithm: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hash.rs","lineNumber":130,"sourceCode":"        \"sha224\" => file_hash_prog::<Sha224>(path, pr)?,\n        \"sha384\" => file_hash_prog::<Sha384>(path, pr)?,\n        \"sha1\" => {\n            if use_external_hasher && file::which(\"sha1sum\").is_some() {\n                let out = cmd!(\"sha1sum\", path).read()?;\n                out.split_whitespace().next().unwrap().to_string()\n            } else {\n                file_hash_prog::<Sha1>(path, pr)?\n            }\n        }\n        \"md5\" => {\n            if use_external_hasher && file::which(\"md5sum\").is_some() {\n                let out = cmd!(\"md5sum\", path).read()?;\n                out.split_whitespace().next().unwrap().to_string()\n            } else {\n                file_hash_prog::<Md5>(path, pr)?\n            }\n        }\n        _ => bail!(\"Unknown checksum algorithm: {}\", algo),\n    };\n    let checksum = checksum.to_lowercase();\n    if actual != checksum {\n        bail!(\n            \"Checksum mismatch for file {}:\\nExpected: {algo}:{checksum}\\nActual:   {algo}:{actual}\",\n            display_path(path)\n        );\n    }\n    Ok(())\n}\n\npub(crate) fn parse_shasums(text: &str) -> HashMap<String, String> {\n    text.lines()\n        .filter_map(|l| {\n            let mut parts = l.split_whitespace();\n            let hash = parts.next()?;\n            let name = parts.next()?;\n            // Strip coreutils binary-mode marker (e.g. \"<hash> *file.tar.gz\").","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/hash.rs#L112-L148","documentation":"mise verifies downloaded tool archives in ensure_checksum (src/hash.rs), which implements exactly blake3, sha512, sha384, sha256, sha224, sha1, and md5 (match arms at src/hash.rs:101-129). The bail at src/hash.rs:130 fires when the algorithm component of a checksum spec matches none of these arms, so verification aborts before any bytes are hashed.","triggerScenarios":"A checksum spec whose algorithm prefix is unrecognized reaches ensure_checksum: \"crc32:...\", \"sha3-256:...\", or \"blake2b:...\" in mise.toml, a custom backend (http:, s3:, github:) checksum field, an aqua/ubi registry entry, or a lockfile; a typo such as \"sha-256:\"; or a value written by a newer mise release that added an algorithm this build predates.","commonSituations":"Hand-authoring tool metadata and copying a blake2/crc32/sha3 digest from a release page; scripts that generate checksums with b2sum or cksum; an older pinned mise reading registry entries that started using a newer algorithm.","solutions":["Rewrite the checksum with a supported algorithm: recompute with sha256sum and store it as \"sha256:<hex>\" (blake3, sha512, sha384, sha256, sha224, sha1, md5 all work; write prefixes lowercase, matching the match arms).","Fix prefix typos: \"sha-256\" -> \"sha256\", \"sha 256\" -> \"sha256\".","Update mise (mise upgrade) in case the algorithm is supported in a newer release.","If the spec comes from the mise/aqua/ubi registry rather than your own config, open an issue or PR against that registry entry."],"exampleFix":"# before (mise.toml / backend checksum)\nchecksum = \"sha3-256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n\n# after\nchecksum = \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\"blake3\", \"sha512\", \"sha384\", \"sha256\", \"sha224\", \"sha1\", \"md5\"];\n\nfn checksum_spec_is_supported(spec: &str) -> bool {\n    match spec.split_once(':') {\n        Some((algo, hex)) => !hex.is_empty() && SUPPORTED.contains(&algo.to_ascii_lowercase().as_str()),\n        None => false,\n    }\n}\n\n// gate before mise install / mise lock touches the spec\nassert!(checksum_spec_is_supported(&spec), \"unsupported algorithm in checksum spec: {spec}\");","typeGuard":null,"tryCatchPattern":"When an install call returns Err, match the message for \"Unknown checksum algorithm\" first: it is deterministic, so retrying cannot help. Surface the rejected prefix and the supported list to the user instead of falling back to skipping verification.","preventionTips":["Standardize on sha256 when authoring checksum specs.","Lint checksum fields in CI with a regex like ^(blake3|sha512|sha384|sha256|sha224|sha1|md5):[0-9a-fA-F]+$.","Never generate specs with b2sum, cksum, or crc32 for mise-managed tools."],"tags":["checksum","hash","config","registry","validation"],"backgroundTag":"unsupported-checksum-algorithm","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}