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

Add missing response hash pseudoheader #162

Merged
merged 5 commits into from
Jul 24, 2023

Conversation

nathanosdev
Copy link
Member

The :ic-cert-status pseudoheader is missing from the response hash calculation for the response verification spec.

@nathanosdev nathanosdev requested a review from a team as a code owner May 24, 2023 12:54
@nathanosdev nathanosdev self-assigned this May 24, 2023
@netlify
Copy link

netlify bot commented May 24, 2023

Deploy Preview for ic-interface-spec ready!

Name Link
🔨 Latest commit dc4685a
🔍 Latest deploy log https://app.netlify.com/sites/ic-interface-spec/deploys/64be536d1bc26b00087cc9ca
😎 Deploy Preview https://deploy-preview-162--ic-interface-spec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nathanosdev
Copy link
Member Author

Sorry @Dfinity-Bjoern I didn't notice that you already approved and I just pushed again a suggestion from @robin-kunzler. When you get a chance, could you confirm you're okay with the additional commit?

@@ -372,7 +375,7 @@ The steps for response verification are as follows:

## Response Verification Version Assertion

Canisters can report the versions of response verification that they support using public metadata in the [system state tree](https://internetcomputer.org/docs/current/references/ic-interface-spec/#state-tree-canister-information). This metadata will be read by the HTTP Gateway using a [read_state request](https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-read-state). This metadata is a comma-delimited string of versions under the key "supported_certificate_versions”, for example: "1,2". This is treated as an optional, additional layer of security for canisters supporting multiple versions. If the metadata has not been added, then the HTTP Gateway will allow for whatever version the canister has responded with.
Canisters can report the versions of response verification that they support using public metadata in the [system state tree](https://internetcomputer.org/docs/current/references/ic-interface-spec/#state-tree-canister-information). This metadata will be read by the HTTP Gateway using a [read_state request](https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-read-state). This metadata is a comma-delimited string of versions under the key "supported_certificate_versions”, for example: "1,2". This is treated as an optional, additional layer of security for canisters supporting multiple versions. If the metadata has not been added (i.e. the lookup of this metadata in the `read_state` response returns `Absent`), then the HTTP Gateway will allow for whatever version the canister has responded with.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lookup of this metadata in the read_state response returns Absent

Note that this is not possible given the current replica implementation that produces responses for which the lookup of a non-existent path yields Unknown. @derlerd-dfinity

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mraszyk : Thanks! I suggested this change to make it explicit that a proof of absence is needed. IIUC TT-183 is currently in blocked status exactly for this reason.

@mraszyk mraszyk marked this pull request as draft June 19, 2023 19:29
@nathanosdev nathanosdev marked this pull request as ready for review July 24, 2023 10:33
@nathanosdev nathanosdev merged commit 2b80d94 into master Jul 24, 2023
5 checks passed
@nathanosdev nathanosdev deleted the nathan/add-missing-response-hash-pseudoheader branch July 24, 2023 10:36
@@ -372,7 +375,7 @@ The steps for response verification are as follows:

## Response Verification Version Assertion

Canisters can report the versions of response verification that they support using public metadata in the [system state tree](https://internetcomputer.org/docs/current/references/ic-interface-spec/#state-tree-canister-information). This metadata will be read by the HTTP Gateway using a [read_state request](https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-read-state). This metadata is a comma-delimited string of versions under the key "supported_certificate_versions”, for example: "1,2". This is treated as an optional, additional layer of security for canisters supporting multiple versions. If the metadata has not been added, then the HTTP Gateway will allow for whatever version the canister has responded with.
Canisters can report the versions of response verification that they support using public metadata in the [system state tree](https://internetcomputer.org/docs/current/references/ic-interface-spec/#state-tree-canister-information). This metadata will be read by the HTTP Gateway using a [read_state request](https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-read-state). This metadata is a comma-delimited string of versions under the key "supported_certificate_versions”, for example: "1,2". This is treated as an optional, additional layer of security for canisters supporting multiple versions. If the metadata has not been added (i.e. the lookup of this metadata in the `read_state` response returns `Absent`), then the HTTP Gateway will allow for whatever version the canister has responded with.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathanosdev Note that the read_state request can also fail with an HTTP error if the canister defines the corresponding custom section as "private".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in this PR: #211

@mraszyk mraszyk mentioned this pull request Jul 31, 2023
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 this pull request may close these issues.

4 participants