Skip to content

Commit a3ebe1d

Browse files
authored
Merge pull request #2 from gbryant-arm/gbryant/base64-0.21
Bump base64 to 0.21
2 parents a200435 + ca3e353 commit a3ebe1d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77

88
[dependencies]
99
anyhow = "1"
10-
base64 = { version = "0.13.0", default-features = false }
10+
base64 = { version = "0.21.0", default-features = false }
1111
err-derive = "0.2"
1212
log = "0.4.13"
1313
reqwest = { version = "0.11", default-features = false, features = ["blocking", "multipart"] }

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! information on licensing and copyright.
1111
1212
use anyhow::{anyhow, Result as AnyhowResult};
13-
use base64;
13+
use base64::{Engine, engine::general_purpose::STANDARD as b64_engine};
1414
use err_derive::Error;
1515
use log::{error, info};
1616
use std::collections::HashMap;
@@ -74,8 +74,8 @@ pub fn complete_proxy_attestation_nitro(
7474
) -> AnyhowResult<Vec<u8>> {
7575
let url = format!("http://{:}/proxy/v1/Nitro/{:}", proxy_attestation_server_url, challenge_id);
7676
let mut form_fields: HashMap<String, String> = HashMap::new();
77-
form_fields.insert("token".to_string(), base64::encode(att_doc));
78-
form_fields.insert("csr".to_string(), base64::encode(csr));
77+
form_fields.insert("token".to_string(), b64_engine.encode(att_doc));
78+
form_fields.insert("csr".to_string(), b64_engine.encode(csr));
7979

8080
let response = http::post_form(url, &form_fields)
8181
.map_err(|err| ProxyAttestationClientError::HttpError(err))?;
@@ -93,8 +93,8 @@ pub fn complete_proxy_attestation_linux(
9393
) -> AnyhowResult<Vec<u8>> {
9494
let url = format!("http://{:}/proxy/v1/PSA/{:}", proxy_attestation_server_url, challenge_id);
9595
let mut form_fields: HashMap<String, String> = HashMap::new();
96-
form_fields.insert("token".to_string(), base64::encode(token));
97-
form_fields.insert("csr".to_string(), base64::encode(csr));
96+
form_fields.insert("token".to_string(), b64_engine.encode(token));
97+
form_fields.insert("csr".to_string(), b64_engine.encode(csr));
9898

9999
let response = http::post_form(url, &form_fields)
100100
.map_err(|err| ProxyAttestationClientError::HttpError(err))?;

0 commit comments

Comments
 (0)