-
Notifications
You must be signed in to change notification settings - Fork 12
NFC Device Engagement support #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
…ession Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
(instead of negotiated handover)
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
presentation is broken - at some point, we broke the presentation flow in isomdl, even for QR.
6cb8344 to
826bac1
Compare
I accidentally wiped over this commit, my bad! Co-authored-by: Tiago Nascimento <tiago.nascimento@spruceid.com>
Handover gets serialized to CBOR and used in shared secret derivation per 18013-5.
Now, you hit a todo!() if you try to use negotiated handover. Not perfect, but nicer than having a broken implementation.
| // Stub out the real NdefUpdateDriver until we have negotiated handover finished. | ||
| #[derive(Debug, Clone)] | ||
| struct NdefUpdateDriver; | ||
| impl NdefUpdateDriver { | ||
| pub fn new() -> Self { | ||
| Self | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to leave the bones for adding back negotiated handover, because it was almost finished before the pivot to static handover for simplicity. We want to support negotiated handover in the future, so it's nice to have the main structure for when we bring it back.
| pub fn get_carrier_info(&mut self) -> Option<Box<NegotiatedCarrierInfo>> { | ||
| if matches!(&self.state, ndef_handover::HandoverState::Done(_)) { | ||
| let mut state = ndef_handover::HandoverState::Init; | ||
| std::mem::swap(&mut self.state, &mut state); | ||
| let ndef_handover::HandoverState::Done(carrier_info) = state else { | ||
| // Guaranteed unreachable | ||
| return None; | ||
| }; | ||
| Some(carrier_info) | ||
| } else { | ||
| None | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is written awkwardly to support the negotiated handover state machine, once that gets brought back.
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
…gagement-refactor
This pull request introduces a static NFC handover implementation, adds BLE advertisement parsing, and refactors the device engagement module to better organize NFC-related functionality. The most significant changes are the addition of new modules for NFC APDU and BLE handling, the implementation of an APDU handover driver, and dependency updates.
NFC Handover and APDU Handling:
src/definitions/device_engagement/nfc/apdu.rs.src/definitions/device_engagement/nfc/apdu_handover.rs.BLE Advertisement Parsing:
src/definitions/device_engagement/nfc/ble.rs.Module Organization and Refactoring:
error,nfc, andnfc_optionsinsrc/definitions/device_engagement.rs, and reorganized imports accordingly. [1] [2]src/definitions/device_engagement/nfc/mod.rs. Also re-exported key types for external usage.Dependency Updates:
timecrate from version0.3.20to0.3.35and added thendef-rscrate as a new dependency inCargo.toml. [1] [2]Minor Improvements:
BleOptionsstructDefaultto simplify instantiation insrc/definitions/device_engagement.rs.