From 09f482686364d605f8edc0e7efd998ed6a323af3 Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 1 Dec 2024 12:34:04 +0100 Subject: [PATCH] Clean up --- web-shove/src/lib.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/web-shove/src/lib.rs b/web-shove/src/lib.rs index a30094b..61b5563 100644 --- a/web-shove/src/lib.rs +++ b/web-shove/src/lib.rs @@ -1,16 +1,7 @@ -use std::{array::TryFromSliceError, rc::Rc}; - use aes_gcm::{ - aead::{heapless, AeadMut, AeadMutInPlace}, + aead::{heapless, AeadMutInPlace}, KeyInit, }; -use rand::prelude::*; -use ring::{ - aead::BoundKey, - agreement::{self, EphemeralPrivateKey}, - rand::SecureRandom, -}; -use thiserror::Error; const KEY_INFO: &[u8; 13] = b"WebPush: info"; const CONTENT_ENCODING_KEY_INFO: &[u8] = b"Content-Encoding: aes128gcm\0"; @@ -106,7 +97,7 @@ fn create_content_encoding_header( const { assert!( PUBLIC_KEY_LENGTH <= u8::MAX as usize, - "Public key can not be longer than 255 because the length field is a u8" + "Public key can not be longer than 255 because the length field is only one byte long" ); } header[SALT_LENGTH + RECORD_SIZE_LENGTH] = PUBLIC_KEY_LENGTH as u8; -- 2.51.2