commit
bdf90641a9
5 changed files with 26 additions and 11 deletions
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -89,7 +89,7 @@ jobs:
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
|
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
msrv: [1.56.1] # 2021 edition requires 1.56
|
msrv: [1.57.0] # base64 0.21 requires 1.57
|
||||||
name: ubuntu / ${{ matrix.msrv }}
|
name: ubuntu / ${{ matrix.msrv }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
|
||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -122,6 +122,10 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest]
|
os: [macos-latest, windows-latest]
|
||||||
steps:
|
steps:
|
||||||
|
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
- run: vcpkg install openssl:x64-windows-static-md
|
||||||
|
if: runner.os == 'Windows'
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
|
||||||
15
Cargo.lock
generated
15
Cargo.lock
generated
|
|
@ -85,6 +85,12 @@ version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64"
|
||||||
|
version = "0.21.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
|
|
@ -162,7 +168,7 @@ version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "34dd14c63662e0206599796cd5e1ad0268ab2b9d19b868d6050d688eba2bbf98"
|
checksum = "34dd14c63662e0206599796cd5e1ad0268ab2b9d19b868d6050d688eba2bbf98"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -371,7 +377,7 @@ dependencies = [
|
||||||
name = "imap"
|
name = "imap"
|
||||||
version = "3.0.0-alpha.9"
|
version = "3.0.0-alpha.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.21.0",
|
||||||
"bufstream",
|
"bufstream",
|
||||||
"chrono",
|
"chrono",
|
||||||
"encoding",
|
"encoding",
|
||||||
|
|
@ -382,6 +388,7 @@ dependencies = [
|
||||||
"mime",
|
"mime",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"nom",
|
"nom",
|
||||||
|
"openssl",
|
||||||
"ouroboros",
|
"ouroboros",
|
||||||
"regex",
|
"regex",
|
||||||
"rustls-connector",
|
"rustls-connector",
|
||||||
|
|
@ -427,7 +434,7 @@ version = "0.10.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2eabca5e0b4d0e98e7f2243fb5b7520b6af2b65d8f87bcc86f2c75185a6ff243"
|
checksum = "2eabca5e0b4d0e98e7f2243fb5b7520b6af2b65d8f87bcc86f2c75185a6ff243"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"email-encoding",
|
"email-encoding",
|
||||||
"email_address",
|
"email_address",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
|
|
@ -791,7 +798,7 @@ version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
|
checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ regex = "1.0"
|
||||||
bufstream = "0.1.3"
|
bufstream = "0.1.3"
|
||||||
imap-proto = "0.16.1"
|
imap-proto = "0.16.1"
|
||||||
nom = { version = "7.1.0", default-features = false }
|
nom = { version = "7.1.0", default-features = false }
|
||||||
base64 = "0.13"
|
base64 = "0.21"
|
||||||
chrono = { version = "0.4", default-features = false, features = ["std"]}
|
chrono = { version = "0.4", default-features = false, features = ["std"]}
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
ouroboros = "0.15.0"
|
ouroboros = "0.15.0"
|
||||||
|
|
@ -40,6 +40,7 @@ structopt = "0.3"
|
||||||
encoding = "0.2.32"
|
encoding = "0.2.32"
|
||||||
failure = "0.1.8"
|
failure = "0.1.8"
|
||||||
mime = "0.3.4"
|
mime = "0.3.4"
|
||||||
|
openssl = "0.10.35"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "basic"
|
name = "basic"
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue