From 62e7536ddb2eaa3bf746136af943fd04b189d442 Mon Sep 17 00:00:00 2001 From: David Mulder Date: Wed, 10 Apr 2024 08:45:04 -0600 Subject: [PATCH 1/3] Fix the msextensions build get_legacy_kid wasn't implemented for ms_oapxbc. Signed-off-by: David Mulder --- src/crypto/ms_oapxbc.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crypto/ms_oapxbc.rs b/src/crypto/ms_oapxbc.rs index 27c216c..0282bf1 100644 --- a/src/crypto/ms_oapxbc.rs +++ b/src/crypto/ms_oapxbc.rs @@ -330,6 +330,10 @@ impl JwsSigner for MsOapxbcSessionKeyHs256 { JwsSigner::get_kid(&self.hmac_key) } + fn get_legacy_kid(&self) -> &str { + JwsSigner::get_kid(&self.hmac_key) + } + fn update_header(&self, header: &mut ProtectedHeader) -> Result<(), JwtError> { let ctx = general_purpose::STANDARD.encode(self.nonce); header.ctx = Some(ctx); From c91475dfe27fa57186d26b538ebac76e76949edd Mon Sep 17 00:00:00 2001 From: David Mulder Date: Wed, 10 Apr 2024 08:50:14 -0600 Subject: [PATCH 2/3] Check that `cargo test` works with msextensions on Signed-off-by: David Mulder --- .github/workflows/rust_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust_test.yml b/.github/workflows/rust_test.yml index 8b0c76d..39be351 100644 --- a/.github/workflows/rust_test.yml +++ b/.github/workflows/rust_test.yml @@ -22,4 +22,5 @@ jobs: - name: Cargo test run: cargo test - + - name: Cargo test with MS Extensions + run: cargo test --features msextensions From 16de5464e6990356f36393ebc3acb27840533770 Mon Sep 17 00:00:00 2001 From: David Mulder Date: Wed, 10 Apr 2024 09:03:52 -0600 Subject: [PATCH 3/3] Revert breaking set_kid change When sending a Windows Hello request, it's necessary to set a very specific kid value, otherwise the request is rejected. Signed-off-by: David Mulder --- src/jws.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jws.rs b/src/jws.rs index f26c68c..0f255d8 100644 --- a/src/jws.rs +++ b/src/jws.rs @@ -54,7 +54,7 @@ impl JwsBuilder { self } - #[cfg(test)] + /// Set the kid (required for Windows Hello/MS Extensions) pub fn set_kid(mut self, kid: Option<&str>) -> Self { self.header.kid = kid.map(|s| s.to_string()); self