Skip to content

Commit bdf9064

Browse files
authored
Merge pull request #253 from jonhoo/base64-bump
Bump base64 dependency
2 parents e6ca65d + 846a681 commit bdf9064

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
9090
strategy:
9191
matrix:
92-
msrv: [1.56.1] # 2021 edition requires 1.56
92+
msrv: [1.57.0] # base64 0.21 requires 1.57
9393
name: ubuntu / ${{ matrix.msrv }}
9494
steps:
9595
- uses: actions/checkout@v3

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ jobs:
122122
matrix:
123123
os: [macos-latest, windows-latest]
124124
steps:
125+
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
126+
if: runner.os == 'Windows'
127+
- run: vcpkg install openssl:x64-windows-static-md
128+
if: runner.os == 'Windows'
125129
- uses: actions/checkout@v3
126130
with:
127131
submodules: true

Cargo.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ regex = "1.0"
2626
bufstream = "0.1.3"
2727
imap-proto = "0.16.1"
2828
nom = { version = "7.1.0", default-features = false }
29-
base64 = "0.13"
29+
base64 = "0.21"
3030
chrono = { version = "0.4", default-features = false, features = ["std"]}
3131
lazy_static = "1.4"
3232
ouroboros = "0.15.0"
@@ -40,6 +40,7 @@ structopt = "0.3"
4040
encoding = "0.2.32"
4141
failure = "0.1.8"
4242
mime = "0.3.4"
43+
openssl = "0.10.35"
4344

4445
[[example]]
4546
name = "basic"

src/client.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use base64::{engine::general_purpose, Engine as _};
12
use bufstream::BufStream;
23
use chrono::{DateTime, FixedOffset};
34
use imap_proto::Response;
@@ -471,16 +472,18 @@ impl<T: Read + Write> Client<T> {
471472
let data =
472473
ok_or_unauth_client_err!(parse_authenticate_response(line_str), self);
473474
ok_or_unauth_client_err!(
474-
base64::decode(data).map_err(|e| Error::Parse(ParseError::Authentication(
475-
data.to_string(),
476-
Some(e)
477-
))),
475+
general_purpose::STANDARD_NO_PAD
476+
.decode(data)
477+
.map_err(|e| Error::Parse(ParseError::Authentication(
478+
data.to_string(),
479+
Some(e)
480+
))),
478481
self
479482
)
480483
};
481484

482485
let raw_response = &authenticator.process(&challenge);
483-
let auth_response = base64::encode(raw_response);
486+
let auth_response = general_purpose::STANDARD_NO_PAD.encode(raw_response);
484487
ok_or_unauth_client_err!(
485488
self.write_line(auth_response.into_bytes().as_slice()),
486489
self

0 commit comments

Comments
 (0)