From 54e97d35c1c669c951cd14faa3b249ab80a8dee6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 22 Nov 2021 13:25:47 +0100 Subject: [PATCH] fix u2f context instantiation don't use the appid for the origin if an origin was specified Signed-off-by: Wolfgang Bumiller --- proxmox-tfa/src/api/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxmox-tfa/src/api/mod.rs b/proxmox-tfa/src/api/mod.rs index 884130ce..e0084b93 100644 --- a/proxmox-tfa/src/api/mod.rs +++ b/proxmox-tfa/src/api/mod.rs @@ -76,8 +76,12 @@ pub struct TfaConfig { /// Helper to get a u2f instance from a u2f config, or `None` if there isn't one configured. fn get_u2f(u2f: &Option) -> Option { - u2f.as_ref() - .map(|cfg| u2f::U2f::new(cfg.appid.clone(), cfg.appid.clone())) + u2f.as_ref().map(|cfg| { + u2f::U2f::new( + cfg.appid.clone(), + cfg.origin.clone().unwrap_or_else(|| cfg.appid.clone()), + ) + }) } /// Helper to get a u2f instance from a u2f config.