From 53947013ef46e04d2e8822bac5ca803033c80a9f Mon Sep 17 00:00:00 2001 From: darkseid Date: Thu, 5 Sep 2024 09:32:04 +0530 Subject: [PATCH] Derive Eq, Hash and PartialEq for DigestBytes With the above traits a certificate and its DigestBytes can be stored in a HashMap. --- openssl/src/hash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openssl/src/hash.rs b/openssl/src/hash.rs index b25eded94..807823dac 100644 --- a/openssl/src/hash.rs +++ b/openssl/src/hash.rs @@ -373,7 +373,7 @@ impl Drop for Hasher { /// /// This type derefs to a byte slice - it exists to avoid allocating memory to /// store the digest data. -#[derive(Copy)] +#[derive(Copy, Eq, Hash, PartialEq)] pub struct DigestBytes { pub(crate) buf: [u8; ffi::EVP_MAX_MD_SIZE as usize], pub(crate) len: usize,