Properly handle DST transitions in cron jobs (fixes #2366)
This commit is contained in:
@@ -4,25 +4,26 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use aes_gcm_siv::{
|
||||
AeadInPlace, Aes256GcmSiv, KeyInit, Nonce,
|
||||
aead::{Aead, generic_array::GenericArray},
|
||||
};
|
||||
use aes_gcm_siv::{AeadInPlace, Aes256GcmSiv, KeyInit, Nonce, aead::Aead};
|
||||
use store::blake3;
|
||||
|
||||
pub struct SymmetricEncrypt {
|
||||
aes: Aes256GcmSiv,
|
||||
}
|
||||
|
||||
//TODO: Remove allow deprecated when aes-gcm is updated
|
||||
#[allow(deprecated)]
|
||||
impl SymmetricEncrypt {
|
||||
pub const ENCRYPT_TAG_LEN: usize = 16;
|
||||
pub const NONCE_LEN: usize = 12;
|
||||
|
||||
pub fn new(key: &[u8], context: &str) -> Self {
|
||||
SymmetricEncrypt {
|
||||
aes: Aes256GcmSiv::new(&GenericArray::clone_from_slice(
|
||||
&blake3::derive_key(context, key)[..],
|
||||
)),
|
||||
aes: Aes256GcmSiv::new(
|
||||
&sha1::digest::generic_array::GenericArray::clone_from_slice(
|
||||
&blake3::derive_key(context, key)[..],
|
||||
),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user