openwallet-foundation-labs / identity-credential

Apache License 2.0
161 stars 82 forks source link

VerificationHelper: Fix BLEIdent when using Negotiated Handover. #589

Closed davidz25 closed 5 months ago

davidz25 commented 5 months ago

At while ago (PR #434) we introduced the concept of warmed-up transports when using Negotiated Handover to speed up presentations. Unfortunately this introduced a bug where we didn't set the right BLEIdent on the GATT Server when using mdoc BLE central client mode. This caused a problem with some mdoc implementations which fails if the BLEIdent value isn't what they expect.

Our own mdoc implementation will only warn if the BLEIdent read from the GATT server isn't what is expects. This behavior has existed for a while but it originally used to error out. Implementations using an old version of our code thus may not currently work with our current VerificationHelper if they're using Negotiated Handover.

Fix this by setting the BLEIdent on a warmed-up connection right after receiving Handover Select. Tested this fix against an implementation known to fail if the BLEIdent isn't it should be.

Test: Manually tested.