Skip to content
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

Wrong logic for reverse engagement when the curve type for the EReader doesn't match the curve type for the EDevice #455

Open
nicklaswj opened this issue Jan 24, 2024 · 0 comments

Comments

@nicklaswj
Copy link

Currently the function com.android.identity.android.mdoc.deviceretrieval.DeviceRetrievalHelper.ensureSessionEncryption assumes that if it's a reverse engagement, then it received a SessionData message without checking and returns early.
However this logic is wrong in the case where the EReader chose a initial curve type different from the EDevice curve type.

Draft ISO 18013-7, section A.7 Session Encryption point 2 specifies that if the EDevice key curve type in DeviceEngagement message is different from the EReader curve type in ReaderEngagementMessage, then the EReader should generate a new key-pair with the same curve as the EDevice key and send a SessionEstablishment message with the new public key and the request. Otherwise it should send a SessionData message with only the request.

I'm preparing a PR to fix this behavior.

nicklaswj pushed a commit to nicklaswj/identity-credential that referenced this issue Jan 24, 2024
In the context of reverse engagement, check whether the EReader sent a SessionEstablisment
message or a SessionData message. If the EReader sent a SessionEstablishment message, use the
public key in the message instead of the initial public key in the ReaderEngagement message.
nicklaswj pushed a commit to nicklaswj/identity-credential that referenced this issue Feb 1, 2024
In the context of reverse engagement, check whether the EReader sent a SessionEstablisment
message or a SessionData message. If the EReader sent a SessionEstablishment message, use the
public key in the message instead of the initial public key in the ReaderEngagement message.

Signed-off-by: Nicklas Warming Jacobsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant