Skip to content

Commit 89471a3

Browse files
mikewestDevtools-frontend LUCI CQ
authored andcommitted
[SRI Message Signatures] Render the signature base when relevant.
If a signature-mismatch issue is rendered, ensure that the signature base is displayed as well to give developers half a chance of diagnosing their error. This is the devtools side of a two-sided patch: 1. (Chromium) https://crrev.com/c/6354969 2. (Devtools) https://crrev.com/c/6357210 [You are here] Bug: 381044049 Change-Id: Ie163e8e83824aed33eb4d6ccc61319a688c25267 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6357210 Reviewed-by: Simon Zünd <[email protected]> Reviewed-by: Danil Somsikov <[email protected]> Commit-Queue: Mike West <[email protected]>
1 parent 854cadc commit 89471a3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

front_end/models/issues_manager/SRIMessageSignatureIssue.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export class SRIMessageSignatureIssue extends Issue {
114114
constructor(issueDetails: Protocol.Audits.SRIMessageSignatureIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
115115
super(
116116
{
117-
code: getIssueCode(issueDetails),
117+
// Append the signature base to the enum's code in order to prevent
118+
// distinct error details from coalescing in the issues panel.
119+
code: getIssueCode(issueDetails) + issueDetails.signatureBase,
118120
umaCode: [
119121
Protocol.Audits.InspectorIssueCode.SRIMessageSignatureIssue,
120122
issueDetails.error,
@@ -144,6 +146,9 @@ export class SRIMessageSignatureIssue extends Issue {
144146
if (!description) {
145147
return null;
146148
}
149+
if (this.#issueDetails.signatureBase !== '') {
150+
description.substitutions = new Map([['PLACEHOLDER_signatureBase', () => this.#issueDetails.signatureBase]]);
151+
}
147152
return resolveLazyDescription(description);
148153
}
149154

front_end/models/issues_manager/descriptions/sriValidationFailedSignatureMismatch.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
The public key specified in the [`signature-input`](signatureInputHeader)
44
header's [`keyid` parameter](signatureParameters) does not match the signature
55
specified in the [`signature`](signatureHeader) header. Verification failed.
6+
7+
The following is the signature base over which the verification attempt was made:
8+
9+
```
10+
{PLACEHOLDER_signatureBase}
11+
```

0 commit comments

Comments
 (0)