[WebCrypto] Change return type of SubtleCrypto.verify to match spec [chromium/src : main]

38 views
Skip to first unread message

Nate Chapin (Gerrit)

unread,
May 11, 2026, 5:14:12 PM (8 days ago) May 11
to Hubert Chao, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jbroma...@chromium.org, jmedle...@chromium.org
Attention needed from Hubert Chao

Nate Chapin voted and added 1 comment

Votes added by Nate Chapin

Code-Review+1

1 comment

File third_party/blink/renderer/modules/crypto/subtle_crypto.idl
Line 55, Patchset 2 (Latest): Promise<boolean> verify(
Nate Chapin . unresolved

Hrm, is there a semantic difference between rejecting this promise and resolving it with `false`? `Promise<boolean>` always seems weird to me.

(Not asking for a spec change, just curious)

Open in Gerrit

Related details

Attention is currently required from:
  • Hubert Chao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4e2de8b139dd80a4d04979c23a5ba2dcc28423c4
Gerrit-Change-Number: 7833601
Gerrit-PatchSet: 2
Gerrit-Owner: Hubert Chao <hc...@chromium.org>
Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Hubert Chao <hc...@chromium.org>
Gerrit-Comment-Date: Mon, 11 May 2026 21:14:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Hubert Chao (Gerrit)

unread,
May 11, 2026, 5:54:21 PM (7 days ago) May 11
to Nate Chapin, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jbroma...@chromium.org, jmedle...@chromium.org

Hubert Chao added 1 comment

File third_party/blink/renderer/modules/crypto/subtle_crypto.idl
Line 55, Patchset 2 (Latest): Promise<boolean> verify(
Nate Chapin . resolved

Hrm, is there a semantic difference between rejecting this promise and resolving it with `false`? `Promise<boolean>` always seems weird to me.

(Not asking for a spec change, just curious)

Hubert Chao

Hrm, is there a semantic difference between rejecting this promise and resolving it with `false`? `Promise<boolean>` always seems weird to me.

A rejected promise = "the parameters for running the crypto are set up wrong"

resolved promise with false = "we ran the crypto without error, but the signature doesn't match the data"

https://www.w3.org/TR/webcrypto-2/#SubtleCrypto-method-verify

Why exactly its that way, I don't entirely know the history behind it. I believe it has something to do with the entire API being async (which I believe happened because "crypto is expensive lets make it async, but I haven't actually looked into the spec history to verify that).

davidben@ has a lot of complaints about the design of this API, in case you're curious. https://github.com/w3c/webcrypto/issues/167#issuecomment-3806830422

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4e2de8b139dd80a4d04979c23a5ba2dcc28423c4
    Gerrit-Change-Number: 7833601
    Gerrit-PatchSet: 2
    Gerrit-Owner: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Comment-Date: Mon, 11 May 2026 21:54:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nate Chapin <jap...@chromium.org>
    satisfied_requirement
    open
    diffy

    Hubert Chao (Gerrit)

    unread,
    May 11, 2026, 5:54:24 PM (7 days ago) May 11
    to Nate Chapin, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jbroma...@chromium.org, jmedle...@chromium.org

    Hubert Chao voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4e2de8b139dd80a4d04979c23a5ba2dcc28423c4
    Gerrit-Change-Number: 7833601
    Gerrit-PatchSet: 2
    Gerrit-Owner: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Comment-Date: Mon, 11 May 2026 21:54:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    May 11, 2026, 5:59:01 PM (7 days ago) May 11
    to Hubert Chao, Nate Chapin, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jbroma...@chromium.org, jmedle...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    [WebCrypto] Change return type of SubtleCrypto.verify to match spec

    Change return type of SubtleCrypto.verify away from Promise<any> to
    Promise<boolean>, as described by the spec
    https://w3c.github.io/webcrypto/#subtlecrypto-interface
    Change-Id: I4e2de8b139dd80a4d04979c23a5ba2dcc28423c4
    Bug: 507066144
    Commit-Queue: Hubert Chao <hc...@chromium.org>
    Reviewed-by: Nate Chapin <jap...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1628838}
    Files:
    • M third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules_test.cc
    • M third_party/blink/renderer/modules/crypto/crypto_result_impl.cc
    • M third_party/blink/renderer/modules/crypto/subtle_crypto.cc
    • M third_party/blink/renderer/modules/crypto/subtle_crypto.h
    • M third_party/blink/renderer/modules/crypto/subtle_crypto.idl
    Change size: S
    Delta: 5 files changed, 18 insertions(+), 18 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Nate Chapin
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4e2de8b139dd80a4d04979c23a5ba2dcc28423c4
    Gerrit-Change-Number: 7833601
    Gerrit-PatchSet: 3
    Gerrit-Owner: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
    Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages