summaryrefslogtreecommitdiff
path: root/src/types.rs
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-07-17 09:45:23 +0200
committerpennae <github@quasiparticle.net>2022-07-17 17:24:24 +0200
commitc1451924d88d146c7dc00c01d8c5f248978001b2 (patch)
treea9649df4c3e700724fef23fd20a8bb2154aa5472 /src/types.rs
parentd4ed52e48eb52566dab91080eb25d8979fbb7d3e (diff)
downloadminor-skulk-c1451924d88d146c7dc00c01d8c5f248978001b2.tar.gz
minor-skulk-c1451924d88d146c7dc00c01d8c5f248978001b2.tar.xz
minor-skulk-c1451924d88d146c7dc00c01d8c5f248978001b2.zip
don't use SecretBytes in HawkKey/SecretKey
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/types.rs b/src/types.rs
index c27b288..aca74cf 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -1,4 +1,3 @@
-use crate::crypto::SecretBytes;
use chrono::{DateTime, Utc};
use password_hash::{rand_core::OsRng, Output, SaltString};
use rand::RngCore;
@@ -163,11 +162,8 @@ macro_rules! bytea_types {
//
bytea_types! {
- #[derive(Clone, Debug, PartialEq, Eq)]
- struct HawkKey(SecretBytes<32>) as hawk_key {
- fn decode(v) -> _ { v.0.0.as_ref() }
- fn encode(v) -> _ { SecretBytes(v) }
- }
+ #[simple_array]
+ struct HawkKey([u8; 32]) as hawk_key;
#[simple_array]
struct SessionID([u8; 32]) as session_id;
@@ -196,11 +192,8 @@ bytea_types! {
#[simple_array]
struct AvatarID([u8; 16]) as avatar_id;
- #[derive(Clone, Debug, PartialEq, Eq)]
- struct SecretKey(SecretBytes<32>) as secret_key {
- fn decode(v) -> _ { v.0.0.as_ref() }
- fn encode(v) -> _ { SecretBytes(v) }
- }
+ #[simple_array]
+ struct SecretKey([u8; 32]) as secret_key;
#[derive(Clone, Debug, PartialEq, Eq)]
struct VerifyHash(Output) as verify_hash {