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

Typestate Connection sends an empty string for it's publickey controller in the Invitee Request message #877

Closed
gmulhearn-anonyome opened this issue Jun 8, 2023 · 0 comments · Fixed by #878
Assignees

Comments

@gmulhearn-anonyome
Copy link
Contributor

gmulhearn-anonyome commented Jun 8, 2023

As an Invitee using the Connection typestate API, the connection Request message you send appears to have an empty string "" as the DIDDoc's publickey's controller. e.g. payload received by aca-py;

{'@id': '11a296a7-d195-4914-83d4-923efaae7486', '@type': 'https://didcomm.org/connections/1.0/request', 'connection': {'DID': 'JNjWQxSjtKwwZLFM6ESwEN', 'DIDDoc': {'@context': 'https://w3id.org/did/v1', 'authentication': [{'publicKey': '#1', 'type': 'Ed25519SignatureAuthentication2018'}], 'id': 'JNjWQxSjtKwwZLFM6ESwEN', 'publicKey': [{'controller': '', 'id': '#1', 'publicKeyBase58': 'AUFRY1kY9mgTBYtGyUDuQpMGxUVeQH6TbbHsXaSbCv3r', 'type': 'Ed25519VerificationKey2018'}], 'service': [{'id': 'did:example:123456789abcdefghi;indy', 'priority': 0, 'recipientKeys': ['AUFRY1kY9mgTBYtGyUDuQpMGxUVeQH6TbbHsXaSbCv3r'], 'routingKeys': [], 'serviceEndpoint': 'https://283f-116-255-6-98.ngrok-free.app/receive/420', 'type': 'IndyAgent'}]}}, 'label': 'GM Mobile Android', '~thread': {'thid': '5a205e98-87af-4eb4-91c1-c3c9e8f79bf5'}, '~timing': {'out_time': '2023-06-08T03:32:03.393Z'}}

ACA-py 0.8.1 attempts to process the controller as a DID of some variety, and fails on the empty string value. This prevents aries_vcx from connecting with ACA-py agents (at least as an Invitee).

I believe the bug comes from these lines of invitee/mod.rs;

        let mut did_doc = AriesDidDoc::default();
        did_doc.set_service_endpoint(service_endpoint);
        did_doc.set_routing_keys(routing_keys);
        did_doc.set_recipient_keys(recipient_keys);
        did_doc.id = self.pairwise_info.pw_did.to_string();

where set_recipient_keys is responsible for creating those publicKey entries, and it sets the controller to self.id (i.e. the did_doc.id). But did_doc.id is "" until that last line. The fix should just be to put did_doc.id = self.parwise_info.pwdid.to_string() before setting keys.

I'll jump on this now. Just writing a ticket for audit trail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant