Skip to content

Commit

Permalink
[PM-9499] fix passkey-rs and sdk not returning cbor encoded attestati…
Browse files Browse the repository at this point in the history
…on object (#875)

## 🎟️ Tracking

<!-- Paste the link to the Jira or GitHub issue or otherwise describe /
point to where this change is coming from. -->

## 📔 Objective

Updates to the latest passkey-rs version and now correctly returns
`attestation_object`

## 📸 Screenshots

<!-- Required for any UI changes; delete if not applicable. Use fixed
width images for better display. -->

## ⏰ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
  team

## 🦮 Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
  issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or
concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or
indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes
  • Loading branch information
coroiu authored Jul 8, 2024
1 parent 552e626 commit ad5fed3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 34 deletions.
36 changes: 6 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ getrandom = { version = ">=0.2.9, <0.3", features = ["js"] }
hmac = ">=0.12.1, <0.13"
log = ">=0.4.18, <0.5"
p256 = { version = ">=0.13.2, <0.14", optional = true }
passkey = { git = "https://github.com/bitwarden/passkey-rs", rev = "c48c2ddfd6b884b2d754432576c66cb2b1985a3a", optional = true }
passkey = { git = "https://github.com/bitwarden/passkey-rs", rev = "ae08e2cb7dd3d44d915caed395c0cdc56b50fa27", optional = true }
rand = ">=0.8.5, <0.9"
reqwest = { version = ">=0.12.5, <0.13", features = [
"http2",
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-fido/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ coset = { version = "0.3.7" }
itertools = "0.13.0"
log = ">=0.4.18, <0.5"
p256 = { version = ">=0.13.2, <0.14" }
passkey = { git = "https://github.com/bitwarden/passkey-rs", rev = "c48c2ddfd6b884b2d754432576c66cb2b1985a3a" }
passkey = { git = "https://github.com/bitwarden/passkey-rs", rev = "ae08e2cb7dd3d44d915caed395c0cdc56b50fa27" }
reqwest = { version = ">=0.12.5, <0.13", default-features = false }
schemars = { version = "0.8.21", features = ["uuid1", "chrono"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion crates/bitwarden-fido/src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl<'a> Fido2Authenticator<'a> {
Err(e) => return Err(MakeCredentialError::Other(format!("{e:?}"))),
};

let attestation_object = response.as_bytes().to_vec();
let authenticator_data = response.auth_data.to_vec();
let attested_credential_data = response
.auth_data
Expand All @@ -179,7 +180,7 @@ impl<'a> Fido2Authenticator<'a> {

Ok(MakeCredentialResult {
authenticator_data,
attested_credential_data: attested_credential_data.into_iter().collect(),
attestation_object,
credential_id,
})
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-fido/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub struct MakeCredentialRequest {
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
pub struct MakeCredentialResult {
pub authenticator_data: Vec<u8>,
pub attested_credential_data: Vec<u8>,
pub attestation_object: Vec<u8>,
pub credential_id: Vec<u8>,
}

Expand Down

0 comments on commit ad5fed3

Please sign in to comment.