-
Notifications
You must be signed in to change notification settings - Fork 20
Authenticity checks #3
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
Comments
Clarification: the "proof region" is signed. The only piece of information that isn't signed with LD signatures is the signature value itself (as that would be circular). Everything else is signed. This code (from the JavaScript implementation) separately canonizes both the information in the "proof region" ( const c14nProofOptions = await this.canonize(proof, options);
const canonizeOptions = Object.assign({}, options, {skipExpansion: true});
const c14nDocument = await this.canonize(expanded, canonizeOptions);
return {
data: this._sha256(c14nProofOptions).getBytes() +
this._sha256(c14nDocument).getBytes(),
encoding: 'binary'
}; This is according to the LD signatures specification's "Create Verify Hash Algorithm", where the "canonicalized options document" refers to the "proof" information and the "canonicalized document" refers to everything else. https://w3c-dvcg.github.io/ld-signatures/#create-verify-hash-algorithm
Next you said:
Yes, Then, a final additional check should be made (for VC verification) that the So, in all, you've got a proof that looks something like this: "proof": {
"type": "SomeLdSignatureScheme",
"proofPurpose": "credentialIssuance",
"creator": "did:v1:nym:1234#somekey",
"jws": "..."
} When you dereference the {
"id": "did:v1:nym:1234#somekey",
"type": "SomeKeyType",
"controller": "did:v1:nym:1234",
"publicKeyBase58": "..."
} When you dereference the controller ID you get: {
"id": "did:v1:nym:1234",
...,
"credentialIssuance": [{
"type": "SomeCredentialIssuanceCryptoSuite",
"publicKey": [{
/* the key you're looking for must be in here, i.e. the same one as above! */
"id": "did:v1:nym:1234#somekey",
"type": "SomeKeyType",
"controller": "did:v1:nym:1234",
"publicKeyBase58": "..."
}
}]
}],
...
} We need to update the LD signature/proof spec(s) to make this clear. |
Ah, the signed part of So with that clarification, it's consistent with my recollection of our discussion (e.g. I want to keep this issue open. I'll take a stab at some edits after mulling it over. |
Right ... so the only "proof nodes" that are removed are any that were signed previously (typically by other parties), to enable "set" or multisignatures over the same data. In other words, any proof someone else attached won't be signed by you, but any proof you attach will be signed by you. Hopefully that makes sense. |
There has been some fairly significant re-work and finalization of the algorithms used in the specification since this issue was raised. There is now text that details how adding proofs and verifying proofs works (in general):
These general algorithms are then further refined in each cryptosuite specification:
... which contain enough detail now to specify exactly what is signed, and in what order. I believe this issue is addressed now, and am marking it with a pending 7 day close. Please let us know if you feel that the issue isn't addressed now, what we can do further to address the issue, and (ideally) a corresponding PR that would address your concern. |
There is already an issue in the spec (Issue 1) tracking authenticity checks through bidirectional links. I discussed this with @dlongley at TPAC and realized some of my assumptions carried over from earlier VC drafts.
creator
is in the unsignedproof
region, and (I think) an earlier version of the VC data model mentioned (something around the "Entity Profile"?) mentioned thatcreator
should be checked against a property onissuer
.The idea that the
creator
key material can be checked against some property of theissuer
referenced in the signed content is appealing. We enforce that as part of Open Badges verification, but it's not clear where this stands from an LD-proofs perspective.The text was updated successfully, but these errors were encountered: