1010//! information on licensing and copyright.
1111
1212use anyhow:: { anyhow, Result as AnyhowResult } ;
13- use base64;
13+ use base64:: { Engine , engine :: general_purpose :: STANDARD as b64_engine } ;
1414use err_derive:: Error ;
1515use log:: { error, info} ;
1616use 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