Address base64 deprecations

This commit is contained in:
Jon Gjengset 2023-01-21 14:50:25 -08:00
parent 3ac33ef7f3
commit 3198ddaf15

View file

@ -1,3 +1,4 @@
use base64::{engine::general_purpose, Engine as _};
use bufstream::BufStream; use bufstream::BufStream;
use chrono::{DateTime, FixedOffset}; use chrono::{DateTime, FixedOffset};
use imap_proto::Response; use imap_proto::Response;
@ -471,16 +472,18 @@ impl<T: Read + Write> Client<T> {
let data = let data =
ok_or_unauth_client_err!(parse_authenticate_response(line_str), self); ok_or_unauth_client_err!(parse_authenticate_response(line_str), self);
ok_or_unauth_client_err!( ok_or_unauth_client_err!(
base64::decode(data).map_err(|e| Error::Parse(ParseError::Authentication( general_purpose::STANDARD_NO_PAD
data.to_string(), .decode(data)
Some(e) .map_err(|e| Error::Parse(ParseError::Authentication(
))), data.to_string(),
Some(e)
))),
self self
) )
}; };
let raw_response = &authenticator.process(&challenge); let raw_response = &authenticator.process(&challenge);
let auth_response = base64::encode(raw_response); let auth_response = general_purpose::STANDARD_NO_PAD.encode(raw_response);
ok_or_unauth_client_err!( ok_or_unauth_client_err!(
self.write_line(auth_response.into_bytes().as_slice()), self.write_line(auth_response.into_bytes().as_slice()),
self self