{"record":{"id":"cec77e0c29ff56ec","repo":"openai/codex","slug":"flag-name-must-be-a-64-character-hex-sha-256-dig","errorCode":null,"errorMessage":"{flag_name} must be a 64-character hex SHA-256 digest","messagePattern":"(.+?) must be a 64-character hex SHA-256 digest","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-transport/src/transport/auth.rs","lineNumber":428,"sourceCode":"    })?;\n    let trimmed = raw.trim();\n    if trimmed.is_empty() {\n        return Err(io::Error::new(\n            ErrorKind::InvalidInput,\n            format!(\"websocket auth secret {} must not be empty\", path.display()),\n        ));\n    }\n    Ok(trimmed.to_string())\n}\n\nfn absolute_path_arg(flag_name: &str, path: PathBuf) -> anyhow::Result<AbsolutePathBuf> {\n    AbsolutePathBuf::try_from(path).with_context(|| format!(\"{flag_name} must be an absolute path\"))\n}\n\nfn sha256_digest_arg(flag_name: &str, value: &str) -> anyhow::Result<[u8; 32]> {\n    let trimmed = value.trim();\n    if trimmed.len() != 64 {\n        anyhow::bail!(\"{flag_name} must be a 64-character hex SHA-256 digest\");\n    }\n\n    let mut digest = [0u8; 32];\n    for (index, pair) in trimmed.as_bytes().chunks_exact(2).enumerate() {\n        let high = hex_nibble(flag_name, pair[0])?;\n        let low = hex_nibble(flag_name, pair[1])?;\n        digest[index] = (high << 4) | low;\n    }\n    Ok(digest)\n}\n\nfn hex_nibble(flag_name: &str, byte: u8) -> anyhow::Result<u8> {\n    match byte {\n        b'0'..=b'9' => Ok(byte - b'0'),\n        b'a'..=b'f' => Ok(byte - b'a' + 10),\n        b'A'..=b'F' => Ok(byte - b'A' + 10),\n        _ => anyhow::bail!(\"{flag_name} must be a 64-character hex SHA-256 digest\"),\n    }","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-transport/src/transport/auth.rs#L410-L446","documentation":"Validation error in sha256_digest_arg: the value passed to --ws-token-sha256, after trimming, is not exactly 64 hexadecimal characters (the size of a SHA-256 digest). The flag expects the hex encoding of the 32-byte digest of the capability token.","triggerScenarios":"Thrown at codex-rs/app-server-transport/src/transport/auth.rs:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the digest with e.g. `sha256sum token.txt | cut -d' ' -f1` and pass the 64-char lowercase hex string.","Check for accidental quotes, whitespace, or a base64 digest being passed instead of hex."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}