summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-06-22 15:41:09 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-06-25 11:40:33 +0200
commit081886b7c2a92b9f51c3a2f483ff34360c892508 (patch)
tree42573b8594b18d97488a593516ad6dd5a818adf2 /tool
parentc0e4617c1a7080f11b4407dce942a3bc730291b3 (diff)
openpgp: Generalize `hash_file`.
- Instead of giving it a path, just give it a reader. Adjust call site.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/sqv.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/src/sqv.rs b/tool/src/sqv.rs
index 234581e2..052ed00f 100644
--- a/tool/src/sqv.rs
+++ b/tool/src/sqv.rs
@@ -10,6 +10,7 @@ extern crate time;
extern crate openpgp;
use std::process::exit;
+use std::fs::File;
use clap::{App, Arg, AppSettings};
@@ -169,7 +170,7 @@ fn real_main() -> Result<(), failure::Error> {
let file = matches.value_of_os("file").unwrap();
let hash_algos : Vec<HashAlgorithm>
= sigs.iter().map(|&(ref sig, _, _)| sig.hash_algo).collect();
- let hashes = openpgp::hash_file(file, &hash_algos[..])?;
+ let hashes = openpgp::hash_file(File::open(file)?, &hash_algos[..])?;
// Find the keys.
for filename in matches.values_of_os("keyring")