fabaccess-bffh/bffhd/authentication/fabfire/mod.rs

25 lines
781 B
Rust
Raw Normal View History

2022-03-16 19:29:36 +01:00
mod server;
pub use server::FabFire;
use rsasl::mechname::Mechname;
2022-10-05 17:28:47 +02:00
use rsasl::registry::{Mechanism, MECHANISMS, Side};
2022-03-16 19:29:36 +01:00
const MECHNAME: &'static Mechname = &Mechname::const_new_unchecked(b"X-FABFIRE");
#[linkme::distributed_slice(MECHANISMS)]
2022-10-05 17:28:47 +02:00
pub static FABFIRE: Mechanism =
Mechanism::build(MECHNAME, 300, None, Some(FabFire::new_server), Side::Client);
2022-03-16 19:29:36 +01:00
use std::marker::PhantomData;
2022-10-05 17:28:47 +02:00
use rsasl::property::SizedProperty;
2022-03-16 19:29:36 +01:00
// All Property types must implement Debug.
#[derive(Debug)]
// The `PhantomData` in the constructor is only used so external crates can't construct this type.
pub struct FabFireCardKey(PhantomData<()>);
2022-10-05 17:28:47 +02:00
impl SizedProperty<'_> for FabFireCardKey {
type Value = [u8; 16];
const DESCRIPTION: &'static str = "A AES128 key for a FabFire card";
2022-03-16 19:29:36 +01:00
}