Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base64 to version 0.21.0 #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Cargo.lock
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
anyhow = "1"
base64 = { version = "0.13.0", default-features = false }
base64 = { version = "0.21.0", default-features = false }
err-derive = "0.2"
log = "0.4.13"
reqwest = { version = "0.11", default-features = false, features = ["blocking", "multipart"] }
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! information on licensing and copyright.

use anyhow::{anyhow, Result as AnyhowResult};
use base64;
use base64::{engine::general_purpose, Engine as _};
use err_derive::Error;
use log::{error, info};
use std::collections::HashMap;
Expand Down Expand Up @@ -74,8 +74,8 @@ pub fn complete_proxy_attestation_nitro(
) -> AnyhowResult<Vec<u8>> {
let url = format!("http://{:}/proxy/v1/Nitro/{:}", proxy_attestation_server_url, challenge_id);
let mut form_fields: HashMap<String, String> = HashMap::new();
form_fields.insert("token".to_string(), base64::encode(att_doc));
form_fields.insert("csr".to_string(), base64::encode(csr));
form_fields.insert("token".to_string(), general_purpose::STANDARD.encode(att_doc));
form_fields.insert("csr".to_string(), general_purpose::STANDARD.encode(csr));

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

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