summaryrefslogtreecommitdiff
path: root/src/kms/envelope.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-10-14 20:32:26 -0400
committerAaron Hill <aa1ronham@gmail.com>2018-10-17 21:21:04 -0400
commit56961b62187d55a62539a7443a289b373cbb5144 (patch)
treed994cda80134e614406564c348e4592f94fc8695 /src/kms/envelope.rs
parent1f09d2797c4061e2f15146af061a24a71c1e10af (diff)
downloadroughenough-56961b62187d55a62539a7443a289b373cbb5144.zip
Run rustfmt
Diffstat (limited to 'src/kms/envelope.rs')
-rw-r--r--src/kms/envelope.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kms/envelope.rs b/src/kms/envelope.rs
index 1f6d615..da75961 100644
--- a/src/kms/envelope.rs
+++ b/src/kms/envelope.rs
@@ -73,7 +73,6 @@ fn vec_zero_filled(len: usize) -> Vec<u8> {
pub struct EnvelopeEncryption;
impl EnvelopeEncryption {
-
/// Decrypt a seed previously encrypted with `encrypt_seed()`
pub fn decrypt_seed(kms: &KmsProvider, ciphertext_blob: &[u8]) -> Result<Vec<u8>, KmsError> {
if ciphertext_blob.len() < MIN_PAYLOAD_SIZE {
@@ -107,7 +106,13 @@ impl EnvelopeEncryption {
// Decrypt the seed value using the DEK
let dek_open_key = OpeningKey::new(&AES_256_GCM, &dek)?;
- match open_in_place(&dek_open_key, &nonce, AD, IN_PREFIX_LEN, &mut encrypted_seed) {
+ match open_in_place(
+ &dek_open_key,
+ &nonce,
+ AD,
+ IN_PREFIX_LEN,
+ &mut encrypted_seed,
+ ) {
Ok(plaintext_seed) => Ok(plaintext_seed.to_vec()),
Err(_) => Err(KmsError::OperationFailed(
"failed to decrypt plaintext seed".to_string(),