Change base64 generator to match updates
This commit is contained in:
parent
212105ca4d
commit
f85878c89a
|
@ -71,6 +71,7 @@ mod tests {
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
use base64::{engine::general_purpose, Engine as _};
|
||||||
use chrono::{Duration, Utc};
|
use chrono::{Duration, Utc};
|
||||||
use julianday::JulianDay;
|
use julianday::JulianDay;
|
||||||
use lox_library::{
|
use lox_library::{
|
||||||
|
@ -292,7 +293,7 @@ mod tests {
|
||||||
rng.fill_bytes(&mut cert);
|
rng.fill_bytes(&mut cert);
|
||||||
let infostr: String = format!(
|
let infostr: String = format!(
|
||||||
"obfs4 cert={}, iat-mode=0",
|
"obfs4 cert={}, iat-mode=0",
|
||||||
base64::encode_config(cert, base64::STANDARD_NO_PAD)
|
general_purpose::STANDARD_NO_PAD.encode(cert)
|
||||||
);
|
);
|
||||||
res.info[..infostr.len()].copy_from_slice(infostr.as_bytes());
|
res.info[..infostr.len()].copy_from_slice(infostr.as_bytes());
|
||||||
res
|
res
|
||||||
|
|
|
@ -13,6 +13,7 @@ use super::CMZ_B_TABLE;
|
||||||
use aes_gcm::aead;
|
use aes_gcm::aead;
|
||||||
use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead};
|
use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead};
|
||||||
use aes_gcm::Aes128Gcm;
|
use aes_gcm::Aes128Gcm;
|
||||||
|
use base64::{engine::general_purpose, Engine as _};
|
||||||
use curve25519_dalek::ristretto::CompressedRistretto;
|
use curve25519_dalek::ristretto::CompressedRistretto;
|
||||||
use curve25519_dalek::ristretto::RistrettoBasepointTable;
|
use curve25519_dalek::ristretto::RistrettoBasepointTable;
|
||||||
use curve25519_dalek::scalar::Scalar;
|
use curve25519_dalek::scalar::Scalar;
|
||||||
|
@ -170,6 +171,7 @@ impl BridgeLine {
|
||||||
(bridges, None)
|
(bridges, None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a random BridgeLine for testing
|
/// Create a random BridgeLine for testing
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn random() -> Self {
|
pub fn random() -> Self {
|
||||||
|
@ -197,7 +199,7 @@ impl BridgeLine {
|
||||||
rng.fill_bytes(&mut cert);
|
rng.fill_bytes(&mut cert);
|
||||||
let infostr: String = format!(
|
let infostr: String = format!(
|
||||||
"obfs4 cert={}, iat-mode=0",
|
"obfs4 cert={}, iat-mode=0",
|
||||||
base64::encode_config(cert, base64::STANDARD_NO_PAD)
|
general_purpose::STANDARD_NO_PAD.encode(cert)
|
||||||
);
|
);
|
||||||
res.info[..infostr.len()].copy_from_slice(infostr.as_bytes());
|
res.info[..infostr.len()].copy_from_slice(infostr.as_bytes());
|
||||||
res
|
res
|
||||||
|
|
Loading…
Reference in New Issue