summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/hashed_reader.rs3
-rw-r--r--openpgp/src/parse/mpis.rs15
-rw-r--r--openpgp/src/parse/packet_parser_builder.rs11
-rw-r--r--openpgp/src/parse/packet_pile_parser.rs9
-rw-r--r--openpgp/src/parse/parse.rs64
-rw-r--r--openpgp/src/parse/stream.rs31
6 files changed, 62 insertions, 71 deletions
diff --git a/openpgp/src/parse/hashed_reader.rs b/openpgp/src/parse/hashed_reader.rs
index 764451c0..6e4f646b 100644
--- a/openpgp/src/parse/hashed_reader.rs
+++ b/openpgp/src/parse/hashed_reader.rs
@@ -228,7 +228,6 @@ mod test {
use super::*;
use buffered_reader::BufferedReader;
- use buffered_reader::BufferedReaderGeneric;
#[test]
fn hash_test_1() {
@@ -265,7 +264,7 @@ mod test {
for test in tests.iter() {
let reader
- = BufferedReaderGeneric::with_cookie(
+ = buffered_reader::Generic::with_cookie(
test.data, None, Default::default());
let mut reader
= HashedReader::new(reader, HashesFor::MDC,
diff --git a/openpgp/src/parse/mpis.rs b/openpgp/src/parse/mpis.rs
index 49a92d9b..182fb918 100644
--- a/openpgp/src/parse/mpis.rs
+++ b/openpgp/src/parse/mpis.rs
@@ -11,7 +11,6 @@ use {
use constants::Curve;
use crypto::mpis::{self, MPI};
use parse::{
- BufferedReaderGeneric,
PacketHeaderParser,
Cookie,
};
@@ -30,7 +29,7 @@ impl mpis::PublicKey {
use std::io::Cursor;
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut php = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse(algo, &mut php)
@@ -154,7 +153,7 @@ impl mpis::SecretKey {
use nettle::hash::insecure_do_not_use::Sha1;
// read mpis
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut php = PacketHeaderParser::new_naked(Box::new(bio));
let mpis = Self::parse(algo, &mut php)?;
@@ -191,7 +190,7 @@ impl mpis::SecretKey {
use std::io::Cursor;
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut php = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse(algo, &mut php)
@@ -287,7 +286,7 @@ impl mpis::Ciphertext {
use std::io::Cursor;
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut php = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse(algo, &mut php)
@@ -367,7 +366,7 @@ impl mpis::Signature {
use std::io::Cursor;
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut php = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse(algo, &mut php)
@@ -463,7 +462,7 @@ fn mpis_parse_test() {
{
let buf = b"\x00\x01\x01\x00\x02\x02".to_vec();
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut parser = PacketHeaderParser::new_naked(Box::new(bio));
let mpis = mpis::PublicKey::parse(RSAEncryptSign, &mut parser).unwrap();
@@ -487,7 +486,7 @@ fn mpis_parse_test() {
{
let buf = b"\x00\x02\x02".to_vec();
let cur = Cursor::new(buf);
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
cur, None, Cookie::default());
let mut parser = PacketHeaderParser::new_naked(Box::new(bio));
let mpis = mpis::Ciphertext::parse(RSAEncryptSign, &mut parser)
diff --git a/openpgp/src/parse/packet_parser_builder.rs b/openpgp/src/parse/packet_parser_builder.rs
index cc4591cd..6a66d3c8 100644
--- a/openpgp/src/parse/packet_parser_builder.rs
+++ b/openpgp/src/parse/packet_parser_builder.rs
@@ -2,9 +2,6 @@ use std::io;
use std::path::Path;
use buffered_reader::BufferedReader;
-use buffered_reader::BufferedReaderGeneric;
-use buffered_reader::BufferedReaderMemory;
-use buffered_reader::BufferedReaderFile;
use Result;
use parse::PacketParserResult;
@@ -49,7 +46,7 @@ impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a> {
/// in a `std::io::Read` object.
fn from_reader<R: io::Read + 'a>(reader: R) -> Result<Self> {
PacketParserBuilder::from_buffered_reader(
- Box::new(BufferedReaderGeneric::with_cookie(
+ Box::new(buffered_reader::Generic::with_cookie(
reader, None, Cookie::default())))
}
@@ -57,14 +54,14 @@ impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a> {
/// in the file named `path`.
fn from_file<P: AsRef<Path>>(path: P) -> Result<Self> {
PacketParserBuilder::from_buffered_reader(
- Box::new(BufferedReaderFile::with_cookie(path, Cookie::default())?))
+ Box::new(buffered_reader::File::with_cookie(path, Cookie::default())?))
}
/// Creates a `PacketParserBuilder` for an OpenPGP message stored
/// in the specified buffer.
fn from_bytes(bytes: &'a [u8]) -> Result<PacketParserBuilder> {
PacketParserBuilder::from_buffered_reader(
- Box::new(BufferedReaderMemory::with_cookie(
+ Box::new(buffered_reader::Memory::with_cookie(
bytes, Cookie::default())))
}
}
@@ -165,7 +162,7 @@ impl<'a> PacketParserBuilder<'a> {
};
if dearmor {
- self.bio = Box::new(BufferedReaderGeneric::with_cookie(
+ self.bio = Box::new(buffered_reader::Generic::with_cookie(
armor::Reader::from_buffered_reader(self.bio, None),
None,
Default::default()));
diff --git a/openpgp/src/parse/packet_pile_parser.rs b/openpgp/src/parse/packet_pile_parser.rs
index 064b4174..d531727b 100644
--- a/openpgp/src/parse/packet_pile_parser.rs
+++ b/openpgp/src/parse/packet_pile_parser.rs
@@ -14,8 +14,7 @@ use parse::{
Parse,
Cookie
};
-use buffered_reader::{BufferedReader, BufferedReaderGeneric,
- BufferedReaderMemory, BufferedReaderFile};
+use buffered_reader::BufferedReader;
#[cfg(test)]
#[allow(unused_macros)]
@@ -108,7 +107,7 @@ impl<'a> Parse<'a, PacketPileParser<'a>> for PacketPileParser<'a> {
/// in the `io::Read` object.
fn from_reader<R: io::Read + 'a>(reader: R)
-> Result<PacketPileParser<'a>> {
- let bio = Box::new(BufferedReaderGeneric::with_cookie(
+ let bio = Box::new(buffered_reader::Generic::with_cookie(
reader, None, Cookie::default()));
PacketPileParser::from_buffered_reader(bio)
}
@@ -118,14 +117,14 @@ impl<'a> Parse<'a, PacketPileParser<'a>> for PacketPileParser<'a> {
fn from_file<P: AsRef<Path>>(path: P)
-> Result<PacketPileParser<'a>> {
PacketPileParser::from_buffered_reader(
- Box::new(BufferedReaderFile::with_cookie(path, Cookie::default())?))
+ Box::new(buffered_reader::File::with_cookie(path, Cookie::default())?))
}
/// Creates a `PacketPileParser` to parse the OpenPGP message stored
/// in the provided buffer.
fn from_bytes(data: &'a [u8])
-> Result<PacketPileParser<'a>> {
- let bio = Box::new(BufferedReaderMemory::with_cookie(
+ let bio = Box::new(buffered_reader::Memory::with_cookie(
data, Cookie::default()));
PacketPileParser::from_buffered_reader(bio)
}
diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs
index 3c159673..54eeab0a 100644
--- a/openpgp/src/parse/parse.rs
+++ b/openpgp/src/parse/parse.rs
@@ -156,10 +156,10 @@ const MAX_RECURSION_DEPTH : u8 = 16;
// This struct is not exposed to the user. Instead, when a header has
// been successfully parsed, a `PacketParser` is returned.
pub(crate) struct PacketHeaderParser<'a> {
- // The reader stack wrapped in a BufferedReaderDup so that if
+ // The reader stack wrapped in a buffered_reader::Dup so that if
// there is a parse error, we can abort and still return an
// Unknown packet.
- reader: BufferedReaderDup<'a, Cookie>,
+ reader: buffered_reader::Dup<'a, Cookie>,
// The current packet's header.
header: Header,
@@ -248,7 +248,7 @@ impl<'a> PacketHeaderParser<'a> {
None
};
PacketHeaderParser {
- reader: BufferedReaderDup::with_cookie(inner, cookie),
+ reader: buffered_reader::Dup::with_cookie(inner, cookie),
header: header,
header_bytes: header_bytes.clone(),
path: path,
@@ -293,7 +293,7 @@ impl<'a> PacketHeaderParser<'a> {
self.field("body", body.len());
}
- // This is a BufferedReaderDup, so this always has an
+ // This is a buffered_reader::Dup, so this always has an
// inner.
let mut inner = Box::new(self.reader).into_inner().unwrap();
@@ -301,14 +301,14 @@ impl<'a> PacketHeaderParser<'a> {
let mut data = Vec::with_capacity(total_out + body.len());
// We know that the inner reader must have at least
// `total_out` bytes buffered, otherwise we could never
- // have read that much from the `BufferedReaderDup`.
+ // have read that much from the `buffered_reader::Dup`.
data.extend_from_slice(&inner.buffer()[..total_out]);
data.extend(body);
self.map.as_mut().unwrap().finalize(data);
inner
} else {
- // This is a BufferedReaderDup, so this always has an
+ // This is a buffered_reader::Dup, so this always has an
// inner.
Box::new(self.reader).into_inner().unwrap()
};
@@ -406,7 +406,7 @@ pub(crate) struct Cookie {
// underlying `BufferedReader`) has no level.
//
// Before parsing a top-level packet, we may push a
- // `BufferedReaderLimitor` in front of the external
+ // `buffered_reader::Limitor` in front of the external
// `BufferedReader`. Such `BufferedReader`s are assigned a level
// of 0.
//
@@ -420,7 +420,7 @@ pub(crate) struct Cookie {
// parser.
//
// When the parser encounters the `CompressedData`'s first child,
- // say, a `Literal` packet, it pushes a `BufferedReaderLimitor` on
+ // say, a `Literal` packet, it pushes a `buffered_reader::Limitor` on
// the `BufferedReader` stack with a level of 1. Then, a
// `PacketParser` for the `Literal` data packet is created with a
// recursion depth of 1.
@@ -773,7 +773,7 @@ impl S2K {
impl<'a> Parse<'a, S2K> for S2K {
/// Reads an S2K from `reader`.
fn from_reader<R: 'a + Read>(reader: R) -> Result<Self> {
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
let mut parser = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse(&mut parser)
@@ -882,7 +882,7 @@ impl<'a> Parse<'a, Header> for Header {
/// [Section 4.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-4.2
fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>
{
- let mut reader = BufferedReaderGeneric::with_cookie(
+ let mut reader = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
Header::parse(&mut reader)
}
@@ -909,14 +909,14 @@ impl Unknown {
#[cfg(test)]
pub(crate) fn to_unknown_packet<R: Read>(reader: R) -> Result<Unknown>
{
- let mut reader = BufferedReaderGeneric::with_cookie(
+ let mut reader = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
let header = Header::parse(&mut reader)?;
let reader : Box<BufferedReader<Cookie>>
= match header.length {
BodyLength::Full(len) =>
- Box::new(BufferedReaderLimitor::with_cookie(
+ Box::new(buffered_reader::Limitor::with_cookie(
Box::new(reader), len as u64, Cookie::default())),
BodyLength::Partial(len) =>
Box::new(BufferedReaderPartialBodyFilter::with_cookie(
@@ -945,7 +945,7 @@ impl Signature {
// field, not the ctb. Also, any length encoding information has
// been removed.
pub(crate) fn parse_naked(value: &[u8]) -> Result<Packet> {
- let bio = BufferedReaderMemory::with_cookie(
+ let bio = buffered_reader::Memory::with_cookie(
value, Cookie::default());
let parser = PacketHeaderParser::new_naked(Box::new(bio));
@@ -1010,7 +1010,7 @@ impl Signature {
let recursion_depth = pp.recursion_depth();
// We know that the top reader is not a HashedReader (it's
- // a BufferedReaderDup). So, start with it's child.
+ // a buffered_reader::Dup). So, start with it's child.
let mut r = (&mut pp.reader).get_mut();
while let Some(tmp) = r {
{
@@ -1064,7 +1064,7 @@ impl Signature {
}
/// Returns whether the data appears to be a signature (no promises).
- fn plausible(bio: &mut BufferedReaderDup<Cookie>, header: &Header) -> Result<()> {
+ fn plausible(bio: &mut buffered_reader::Dup<Cookie>, header: &Header) -> Result<()> {
// The absolute minimum size for the header is 11 bytes (this
// doesn't include the signature MPIs).
@@ -1290,7 +1290,7 @@ impl OnePassSig {
// reader. Since the top reader is the HashedReader, this
// discards any following packets. To prevent this, we push a
// Limitor on the reader stack.
- let mut reader = BufferedReaderLimitor::with_cookie(
+ let mut reader = buffered_reader::Limitor::with_cookie(
Box::new(reader), 0, Cookie::default());
reader.cookie_mut().level = Some(recursion_depth);
@@ -1499,7 +1499,7 @@ impl Key {
}
/// Returns whether the data appears to be a key (no promises).
- fn plausible(bio: &mut BufferedReaderDup<Cookie>, header: &Header) -> Result<()> {
+ fn plausible(bio: &mut buffered_reader::Dup<Cookie>, header: &Header) -> Result<()> {
// The packet's header is 6 bytes.
if let BodyLength::Full(len) = header.length {
if len < 6 {
@@ -1791,15 +1791,15 @@ impl CompressedData {
},
#[cfg(feature = "compression-deflate")]
CompressionAlgorithm::Zip =>
- Box::new(BufferedReaderDeflate::with_cookie(
+ Box::new(buffered_reader::Deflate::with_cookie(
reader, Cookie::new(recursion_depth))),
#[cfg(feature = "compression-deflate")]
CompressionAlgorithm::Zlib =>
- Box::new(BufferedReaderZlib::with_cookie(
+ Box::new(buffered_reader::Zlib::with_cookie(
reader, Cookie::new(recursion_depth))),
#[cfg(feature = "compression-bzip2")]
CompressionAlgorithm::BZip2 =>
- Box::new(BufferedReaderBzip::with_cookie(
+ Box::new(buffered_reader::Bzip::with_cookie(
reader, Cookie::new(recursion_depth))),
_ => unreachable!(), // Validated above.
};
@@ -2309,7 +2309,7 @@ impl MPI {
impl<'a> Parse<'a, MPI> for MPI {
// Reads an MPI from `reader`.
fn from_reader<R: io::Read>(reader: R) -> Result<Self> {
- let bio = BufferedReaderGeneric::with_cookie(
+ let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
let mut parser = PacketHeaderParser::new_naked(Box::new(bio));
Self::parse("(none)", &mut parser)
@@ -2725,13 +2725,13 @@ impl <'a> PacketParser<'a> {
}
/// Returns the reader stack, replacing it with a
- /// `BufferedReaderEOF` reader.
+ /// `buffered_reader::EOF` reader.
///
/// This function may only be called when the `PacketParser` is in
/// State::Body.
fn take_reader(&mut self) -> Box<BufferedReader<Cookie> + 'a> {
self.set_reader(
- Box::new(BufferedReaderEOF::with_cookie(Default::default())))
+ Box::new(buffered_reader::EOF::with_cookie(Default::default())))
}
/// Replaces the reader stack.
@@ -2842,7 +2842,7 @@ impl <'a> PacketParser<'a> {
///
/// Currently, we only try to recover the most interesting
/// packets.
- fn plausible(mut bio: &mut BufferedReaderDup<Cookie>, header: &Header) -> Result<()> {
+ fn plausible(mut bio: &mut buffered_reader::Dup<Cookie>, header: &Header) -> Result<()> {
let bad = Err(
Error::MalformedPacket("Can't make an educated case".into()).into());
@@ -2917,7 +2917,7 @@ impl <'a> PacketParser<'a> {
// which would cause the headers to be hashed. If so, we
// extract the hash context.
- let mut bio = BufferedReaderDup::with_cookie(bio, Cookie::default());
+ let mut bio = buffered_reader::Dup::with_cookie(bio, Cookie::default());
let mut header;
// Read the header.
@@ -2975,7 +2975,7 @@ impl <'a> PacketParser<'a> {
let tag = header.ctb.tag;
- // A BufferedReaderDup always has an inner.
+ // A buffered_reader::Dup always has an inner.
let mut bio = Box::new(bio).into_inner().unwrap();
// Disable hashing for literal packets, Literal::parse will
@@ -2998,7 +2998,7 @@ impl <'a> PacketParser<'a> {
BodyLength::Full(len) => {
t!("Pushing a limitor ({} bytes), level: {}.",
len, recursion_depth);
- Box::new(BufferedReaderLimitor::with_cookie(
+ Box::new(buffered_reader::Limitor::with_cookie(
bio, len as u64,
Cookie::new(recursion_depth)))
},
@@ -3135,7 +3135,7 @@ impl <'a> PacketParser<'a> {
let (mut fake_eof, mut reader) = buffered_reader_stack_pop(
mem::replace(&mut self.reader,
- Box::new(BufferedReaderEOF::with_cookie(
+ Box::new(buffered_reader::EOF::with_cookie(
Default::default()))),
self.recursion_depth())?;
// At this point, next() has to point to a non-container
@@ -3663,18 +3663,18 @@ impl<'a> PacketParser<'a> {
// be careful to not read any further. Unfortunately,
// our decompressor buffers the data. To stop the
// decompressor from buffering the MDC packet, we use
- // a BufferedReaderReserve. Note: we do this
+ // a buffered_reader::Reserve. Note: we do this
// unconditionally, since it doesn't otherwise
// interfere with parsing.
// An MDC consists of a 1-byte CTB, a 1-byte length
// encoding, and a 20-byte hash.
- let mut reader = BufferedReaderReserve::with_cookie(
+ let mut reader = buffered_reader::Reserve::with_cookie(
Box::new(reader), 1 + 1 + 20,
Cookie::new(self.recursion_depth()));
reader.cookie_mut().fake_eof = true;
- t!("Pushing BufferedReaderReserve, level: {}.",
+ t!("Pushing buffered_reader::Reserve, level: {}.",
self.recursion_depth());
// Consume the header. This shouldn't fail, because
@@ -3834,7 +3834,7 @@ mod test {
// messages include compressed data packets, and some are
// signed. But what makes these particularly complex is the
// use of an indeterminate length encoding, which checks the
- // BufferedReaderReserve hack.
+ // buffered_reader::Reserve hack.
DecryptTest {
filename: "seip/msg-compression-not-signed-password-123.pgp",
algo: SymmetricAlgorithm::AES128,
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 62a0fce9..a89d61a3 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -14,10 +14,7 @@ use std::collections::HashMap;
use std::io::{self, Read};
use std::path::Path;
-use buffered_reader::{
- BufferedReader, BufferedReaderGeneric, BufferedReaderMemory,
- BufferedReaderFile,
-};
+use buffered_reader::BufferedReader;
use {
Error,
Fingerprint,
@@ -192,7 +189,7 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
where R: io::Read + 'a
{
Verifier::from_buffered_reader(
- Box::new(BufferedReaderGeneric::with_cookie(reader, None,
+ Box::new(buffered_reader::Generic::with_cookie(reader, None,
Default::default())),
helper)
}
@@ -202,7 +199,7 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
where P: AsRef<Path>
{
Verifier::from_buffered_reader(
- Box::new(BufferedReaderFile::with_cookie(path,
+ Box::new(buffered_reader::File::with_cookie(path,
Default::default())?),
helper)
}
@@ -210,7 +207,7 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
/// Creates a `Verifier` from the given buffer.
pub fn from_bytes(bytes: &'a [u8], helper: H) -> Result<Verifier<'a, H>> {
Verifier::from_buffered_reader(
- Box::new(BufferedReaderMemory::with_cookie(bytes,
+ Box::new(buffered_reader::Memory::with_cookie(bytes,
Default::default())),
helper)
}
@@ -693,9 +690,9 @@ impl DetachedVerifier {
where R: io::Read + 'a, S: io::Read + 's, H: VerificationHelper
{
Self::from_buffered_reader(
- Box::new(BufferedReaderGeneric::with_cookie(signature_reader, None,
+ Box::new(buffered_reader::Generic::with_cookie(signature_reader, None,
Default::default())),
- Box::new(BufferedReaderGeneric::new(reader, None)),
+ Box::new(buffered_reader::Generic::new(reader, None)),
helper)
}
@@ -706,9 +703,9 @@ impl DetachedVerifier {
where P: AsRef<Path>, S: AsRef<Path>, H: VerificationHelper
{
Self::from_buffered_reader(
- Box::new(BufferedReaderFile::with_cookie(signature_path,
+ Box::new(buffered_reader::File::with_cookie(signature_path,
Default::default())?),
- Box::new(BufferedReaderFile::open(path)?),
+ Box::new(buffered_reader::File::open(path)?),
helper)
}
@@ -719,9 +716,9 @@ impl DetachedVerifier {
where H: VerificationHelper
{
Self::from_buffered_reader(
- Box::new(BufferedReaderMemory::with_cookie(signature_bytes,
+ Box::new(buffered_reader::Memory::with_cookie(signature_bytes,
Default::default())),
- Box::new(BufferedReaderMemory::new(bytes)),
+ Box::new(buffered_reader::Memory::new(bytes)),
helper)
}
@@ -734,7 +731,7 @@ impl DetachedVerifier {
where H: VerificationHelper
{
Verifier::from_buffered_reader(
- Box::new(BufferedReaderGeneric::with_cookie(
+ Box::new(buffered_reader::Generic::with_cookie(
Transformer::new(signature_bio, reader)?,
None, Default::default())),
helper)
@@ -904,7 +901,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
where R: io::Read + 'a
{
Decryptor::from_buffered_reader(
- Box::new(BufferedReaderGeneric::with_cookie(reader, None,
+ Box::new(buffered_reader::Generic::with_cookie(reader, None,
Default::default())),
helper)
}
@@ -914,7 +911,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
where P: AsRef<Path>
{
Decryptor::from_buffered_reader(
- Box::new(BufferedReaderFile::with_cookie(path,
+ Box::new(buffered_reader::File::with_cookie(path,
Default::default())?),
helper)
}
@@ -922,7 +919,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
/// Creates a `Decryptor` from the given buffer.
pub fn from_bytes(bytes: &'a [u8], helper: H) -> Result<Decryptor<'a, H>> {
Decryptor::from_buffered_reader(
- Box::new(BufferedReaderMemory::with_cookie(bytes,
+ Box::new(buffered_reader::Memory::with_cookie(bytes,
Default::default())),
helper)
}