Skip to content

Commit 721e519

Browse files
committed
Update to base64 0.21
1 parent 9027047 commit 721e519

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ runtime-tokio = ["tokio", "async-native-tls?/runtime-tokio"]
2727
[dependencies]
2828
imap-proto = "0.16.1"
2929
nom = "7.0"
30-
base64 = "0.13"
30+
base64 = "0.21"
3131
chrono = { version = "0.4", default-features = false, features = ["std"] }
3232
pin-utils = "0.1.0-alpha.4"
3333
futures = "0.3.15"

src/client.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use async_std::net::{TcpStream, ToSocketAddrs};
1616
use async_channel::{self as channel, bounded};
1717
#[cfg(feature = "runtime-async-std")]
1818
use async_std::io::{Read, Write, WriteExt};
19+
use base64::Engine as _;
1920
use extensions::id::{format_identification, parse_id};
2021
use extensions::quota::parse_get_quota_root;
2122
use futures::{io, Stream, StreamExt};
@@ -340,16 +341,20 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Client<T> {
340341
Response::Continue { information, .. } => {
341342
let challenge = if let Some(text) = information {
342343
ok_or_unauth_client_err!(
343-
base64::decode(text.as_ref()).map_err(|e| Error::Parse(
344-
ParseError::Authentication((*text).to_string(), Some(e))
345-
)),
344+
base64::engine::general_purpose::STANDARD
345+
.decode(text.as_ref())
346+
.map_err(|e| Error::Parse(ParseError::Authentication(
347+
(*text).to_string(),
348+
Some(e)
349+
))),
346350
self
347351
)
348352
} else {
349353
Vec::new()
350354
};
351355
let raw_response = &mut authenticator.process(&challenge);
352-
let auth_response = base64::encode(raw_response);
356+
let auth_response =
357+
base64::engine::general_purpose::STANDARD.encode(raw_response);
353358

354359
ok_or_unauth_client_err!(
355360
self.conn.run_command_untagged(&auth_response).await,

0 commit comments

Comments
 (0)