Read a manifest within the protocol ceiling.
(path: &Path)
| 203 | |
| 204 | /// Read a manifest within the protocol ceiling. |
| 205 | pub fn read_manifest(path: &Path) -> Result<Vec<u8>, EvidenceError> { |
| 206 | let file = std::fs::File::open(path)?; |
| 207 | let mut bytes = Vec::new(); |
| 208 | file.take(MANIFEST_LIMIT + 1).read_to_end(&mut bytes)?; |
| 209 | if bytes.len() as u64 > MANIFEST_LIMIT { |
| 210 | return Err(EvidenceError::ManifestTooLarge); |
| 211 | } |
| 212 | Ok(bytes) |
| 213 | } |
| 214 | |
| 215 | /// Read and replay a manifest file. Relative artifact roots resolve against the |
| 216 | /// manifest's parent directory. |
no test coverage detected