jdx/mise · error

no signature found to verify

Error message

no signature found to verify

What it means

After parsing the trusted keys, `verify_detached` parses the detached signature blob and bails with "no signature found to verify" if it contains no recognizable signature packets. Without at least one signature there is nothing to check against the downloaded file.

Solutions

  1. Re-download the .sig file and confirm it contains '-----BEGIN PGP SIGNATURE-----' before verifying.
  2. Verify you're passing the signature file, not the checksums file or the artifact itself.
  3. Check the URL/asset naming for the signature — upstream may have renamed it in a new release.
  4. Check disk space/transfer completeness if the file may have been truncated.

Example fix

// before
let sig = std::fs::read_to_string("node.tar.xz.sig")?; // could be an error page
verify_detached(&keys, &sig, &data)?;
// after
let sig = std::fs::read_to_string("node.tar.xz.sig")?;
eyre::ensure!(sig.contains("BEGIN PGP SIGNATURE"), "downloaded .sig is not a signature");
verify_detached(&keys, &sig, &data)?;
Defensive patterns

Strategy: validation

Validate before calling

fn has_detached_signature(blob: &str) -> bool {
    blob.contains("-----BEGIN PGP SIGNATURE-----")
}
// call before verify_detached
assert!(has_detached_signature(&signature), ".sig file empty or not a signature — re-download");

Try / catch

match verify_detached(&keys, &sig, &data) {
    Err(e) if e.to_string().contains("no signature found") => {
        eprintln!("signature file invalid; re-fetching");
        let sig = re_download_signature(&asset_url)?;
        verify_detached(&keys, &sig, &data)
    }
    other => other,
}

Prevention

When it happens

Trigger: Calling verify_detached (via verify_node/verify_swift/verify_swift_bytes) with a .sig file that is empty, truncated, an HTML/text error page, or contains no OpenPGP signature packets.

Common situations: Download of the .sig file failed and saved an error page; upstream removed/renamed the signature asset; mixing up the checksum file with the signature file; a partial download cut off mid-file.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/680fc3cd9f7df2f9. Report an issue: GitHub.

Appendix: source

Thrown at src/gpg.rs:45

/// `public_keys_asc` is one or more ASCII-armored public key blocks (a trusted keyring bundled
/// with mise). `open_data` returns a fresh reader over the signed content each time it is called,
/// so the content can be streamed (and, if necessary, re-read for another candidate key) without
/// buffering large files in memory.
///
/// Verification succeeds if any signature validates against any of the trusted keys or their
/// subkeys, mirroring `gpg --verify` against an imported keyring.
fn verify_detached<R, F>(public_keys_asc: &str, signature: &[u8], open_data: F) -> Result<()>
where
    R: Read,
    F: Fn() -> Result<R>,
{
    let keys = parse_public_keys(public_keys_asc)?;
    if keys.is_empty() {
        bail!("no trusted public keys available for verification");
    }
    let signatures = parse_signatures(signature)?;
    if signatures.is_empty() {
        bail!("no signature found to verify");
    }

    // Fast path: only try keys whose id/fingerprint matches the signature's issuer, so the signed
    // content is hashed at most once in the common case.
    for sig in &signatures {
        if verify_against_keys(sig, &keys, &open_data, true)? {
            return Ok(());
        }
    }
    // Fallback: try every trusted key, but only for signatures that carried no usable issuer
    // hint. A signature that named an issuer we don't trust is genuinely unverifiable, so skip it
    // rather than re-hashing the (potentially large) content against every key.
    for sig in signatures.iter().filter(|sig| !has_issuer(&sig.signature)) {
        if verify_against_keys(sig, &keys, &open_data, false)? {
            return Ok(());
        }
    }
    bail!("signature does not match any trusted public key");

View on GitHub (pinned to 533346cc37)