ISSUE-41: Clean up algorithm normalization and support checks

Clean up algorithm normalization and support checks

State:
CLOSED
Product:
design for Web Crypto API
Raised by:
Richard Barnes
Opened on:
2013-04-01
Description:
SUMMARY:

We should move checks on algorithm support to the operations (out of the normalization) and clean up language about "registered" algorithms.


DETAILS:

The "encrypt" method and others need to verify two things about algorithm identifiers:
(1) That the algorithm is supported by the UA
(2) That the algorithm supports the requested operation

Currently, (1) is done twice, once by algorithm normalization rules and once by the operation itself, and (2) is done in in the operation.

In the algorithm normalization rules:
"""
If name does not contain a recognized algorithm name, throw an InvalidAlgorithmError exception and return from this algorithm.
"""

In encrypt():
"""
If normalizedAlgorithm does not describe a registered algorithm that supports the encrypt operation, throw a NotSupportedError and terminate the algorithm.
"""

Two problems here:

First, checking support is not properly a part of algorithm normalization. Whether an algorithm is supported by a UA is a separate question from whether its AlgorithmIdentifier is in a normal form.

Second, the check on registration status in the operation is unnecessary. The algorithm normalization rules already check that an algorithm is "recognized" by the UA, so the only thing that needs to be checked here is the algorithms support for the operation. UAs may also support unregistered algorithms, for experimentation or for early deployment while specification update is in process. Part of this support is knowing which operations are supported for those algorithms.


PROPOSAL:

Remove the following step from the algorithm normalization rules:
"""
If name does not contain a recognized algorithm name, throw an InvalidAlgorithmError exception and return from this algorithm.
"""

Make the following change to encrypt, and corresponding changes to decrypt/sign/verify/digest:
OLD:
"""
If normalizedAlgorithm does not describe a registered algorithm that supports the encrypt operation, throw a NotSupportedError and terminate the algorithm.
"""

NEW:
"""
If normalizedAlgorithm does not describe a recognized algorithm, throw an AlgorithmNotSupportedError exception and terminate the algorithm.

If normalizedAlgorithm does not describe an algorithm that supports encryption, throw an OperationNotSupportedError exception and terminate the algorithm.
"""
Related Actions Items:
No related actions
Related emails:
  1. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from rbarnes@bbn.com on 2013-04-05)
  2. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from sleevi@google.com on 2013-04-05)
  3. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from rbarnes@bbn.com on 2013-04-05)
  4. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from sleevi@google.com on 2013-04-05)
  5. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from rbarnes@bbn.com on 2013-04-04)
  6. Re: crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from sleevi@google.com on 2013-04-03)
  7. crypto-ISSUE-41: Clean up algorithm normalization and support checks [design for Web Crypto API] (from sysbot+tracker@w3.org on 2013-04-01)

Related notes:

[rigo]: proposed text : "If normalizedAlgorithm does not describe an algorithm that supports the encrypt operation, throw a NotSupportedError and terminate the algorithm."

14 Nov 2013, 04:33:49

[rigo]: agreement on the proposed text from bug tracker

14 Nov 2013, 04:35:41

Display change log ATOM feed


Chair, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 41.html,v 1.1 2017/02/13 16:16:52 ted Exp $