Skip to content

Commit

Permalink
Merge pull request #274 from awslabs/dependabot/cargo/base64-0.21.2
Browse files Browse the repository at this point in the history
Bump base64 from 0.13.1 to 0.21.2
  • Loading branch information
cbgbt authored Sep 1, 2023
2 parents 82c2539 + f0650f1 commit b0d5408
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
10 changes: 2 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ aws-sdk-ebs = "0.28"
aws-sdk-ec2 = "0.28"
aws-smithy-http = "0.55"
aws-types = "0.55"
base64 = "0.13"
base64 = "0.21"
bytes = "1"
env_logger = "0.10"
futures = "0.3"
Expand Down
4 changes: 3 additions & 1 deletion src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Download Amazon EBS snapshots.
use crate::block_device::get_block_device_size;
use async_trait::async_trait;
use aws_sdk_ebs::Client as EbsClient;
use base64::engine::general_purpose::STANDARD as base64_engine;
use base64::Engine as _;
use futures::stream::{self, StreamExt};
use indicatif::ProgressBar;
use log::debug;
Expand Down Expand Up @@ -317,7 +319,7 @@ impl SnapshotDownloader {
let mut block_digest = Sha256::new();
block_digest.update(&block_data);
let hash_bytes = block_digest.finalize();
let block_hash = base64::encode(hash_bytes);
let block_hash = base64_engine.encode(hash_bytes);

ensure!(
block_hash == expected_hash,
Expand Down
6 changes: 4 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use crate::block_device::get_block_device_size;
use aws_sdk_ebs::primitives::ByteStream;
use aws_sdk_ebs::types::{ChecksumAggregationMethod, ChecksumAlgorithm};
use aws_sdk_ebs::Client as EbsClient;
use base64::engine::general_purpose::STANDARD as base64_engine;
use base64::Engine as _;
use bytes::BytesMut;
use futures::stream::{self, StreamExt};
use indicatif::ProgressBar;
Expand Down Expand Up @@ -229,7 +231,7 @@ impl SnapshotUploader {
full_digest.update(&hash_bytes);
}

let full_hash = base64::encode(full_digest.finalize());
let full_hash = base64_engine.encode(full_digest.finalize());

self.complete_snapshot(&snapshot_id, changed_blocks_count, &full_hash)
.await?;
Expand Down Expand Up @@ -362,7 +364,7 @@ impl SnapshotUploader {
let mut block_digest = Sha256::new();
block_digest.update(&block);
let hash_bytes = block_digest.finalize();
let block_hash = base64::encode(hash_bytes);
let block_hash = base64_engine.encode(hash_bytes);

let snapshot_id = &context.snapshot_id;
let block_index = context.block_index;
Expand Down

0 comments on commit b0d5408

Please sign in to comment.