From 55e9bf6e2b527aa9441649e8371a06594ae74f63 Mon Sep 17 00:00:00 2001 From: Kai Jan Kriegel Date: Fri, 3 Feb 2023 21:35:53 +0100 Subject: [PATCH] check the configured space urn and not a hardcoded one --- bffhd/authentication/fabfire_bin/server.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bffhd/authentication/fabfire_bin/server.rs b/bffhd/authentication/fabfire_bin/server.rs index db563ce..4000513 100644 --- a/bffhd/authentication/fabfire_bin/server.rs +++ b/bffhd/authentication/fabfire_bin/server.rs @@ -16,6 +16,7 @@ use std::io::Write; use std::sync::Arc; use crate::authentication::fabfire::FabFireCardKey; +use crate::CONFIG; enum FabFireError { ParseError, @@ -128,13 +129,20 @@ const MAGIC: &'static str = "FABACCESS\0DESFIRE\01.0\0"; impl FabFire { pub fn new_server(_sasl: &SASLConfig) -> Result, SASLError> { + let space = if let Some(space) = CONFIG.get().map(|c| c.spacename.as_str()) { + space + } else { + tracing::error!("No space configured"); + "generic" + }; + Ok(Box::new(Self { step: Step::New, card_info: None, key_info: None, auth_info: None, app_id: 0x464142, - local_urn: "urn:fabaccess:lab:innovisionlab".to_string(), + local_urn: "urn:fabaccess:lab:{space}".into(), desfire: Desfire { card: None, session_key: None,