Skip to content

Commit 70ed8f1

Browse files
authored
Allow padded authentication tokens (#305)
I honestly couldn't tell you why `NO_PAD` was chosen. It seems to have happened somewhat arbitrarily when the `base64` major upgrade that introduced the distinction landed in #253. Time to fix that. Fixes #299.
1 parent 6fe22ed commit 70ed8f1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "imap"
3-
version = "3.0.0-alpha.14"
3+
version = "3.0.0-alpha.15"
44
authors = ["Jon Gjengset <jon@thesquareplanet.com>",
55
"Matt McCoy <mattnenterprise@yahoo.com>"]
66
documentation = "https://docs.rs/imap/"

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<T: Read + Write> Client<T> {
501501
let data =
502502
ok_or_unauth_client_err!(parse_authenticate_response(line_str), self);
503503
ok_or_unauth_client_err!(
504-
general_purpose::STANDARD_NO_PAD
504+
general_purpose::STANDARD
505505
.decode(data)
506506
.map_err(|e| Error::Parse(ParseError::Authentication(
507507
data.to_string(),
@@ -512,7 +512,7 @@ impl<T: Read + Write> Client<T> {
512512
};
513513

514514
let raw_response = &authenticator.process(&challenge);
515-
let auth_response = general_purpose::STANDARD_NO_PAD.encode(raw_response);
515+
let auth_response = general_purpose::STANDARD.encode(raw_response);
516516
ok_or_unauth_client_err!(
517517
self.write_line(auth_response.into_bytes().as_slice()),
518518
self

0 commit comments

Comments
 (0)