mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 14:36:15 -05:00
1 parent
5767c252b7
commit
47776d54d9
70 files changed
+5161
-313
No files matched your search
@@ -0,0 +1,14 @@
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::bail;
|
||||
|
||||
pub fn verify_checksum(path: &str, expected: &str) -> anyhow::Result<()> {
|
||||
let file = Path::new(&path);
|
||||
let checksum = sha256::try_digest(&file)?;
|
||||
|
||||
if checksum != expected {
|
||||
bail!("Checksum mismatch, expected: {}, actual: {}", expected, checksum);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user