ISSUE-46: Optional algorithm parameters must have default values
Optional algorithm parameters must have default values
- State:
- CLOSED
- Product:
- crypto for Web Crypto API
- Raised by:
- Richard Barnes
- Opened on:
- 2013-06-05
- Description:
- In the current editor's draft, several algorithm parameters are marked as optional [1], but there is no default value specified. In most cases, it is obvious enough; many should be set to an empty byte string / ArrayBufferView, for example. However, the specification should state these values to avoid ambiguity, or make them non-optional. I'll address the current parameters in three groups:
First, optional attributes that should be set to the empty ArrayBufferView:
RsaOaepParams.label -> Empty ArrayBufferView
AesGcmParams.additionalData -> Empty ArrayBufferView
ConcatParams.publicInfo -> Empty ArrayBufferView
ConcatParams.privateInfo -> Empty ArrayBufferView
Pbkdf2Params.password -> Empty ArrayBufferView
Second, one optional attribute that should be made non-optional:
AesGcmParams.iv -> Make non-optional
Third, one optional attribute that could either be made non-optional or provided with a safe default:
AesGcmParams.tagLength -> 128 or make non-optional
On the last question, my personal preference would be to keep it optional set the default at 128, since it seems developer-hostile to require this to be specified every time. Going slightly OT, it seems like the same approach could be taken with AesCtrParams.length, making it optional and setting the default equal to 32 (the value that GCM uses).
[1] Technically "nullable" in the WebIDL jargon. But having a null value is functionally equivalent to not having a value specified. - Related Actions Items:
- ACTION-128 on Richard Barnes to Update proposal for auto-iv proposal - due 2013-11-21, open
- Related emails:
- W3C Web Crypto WG - take away from 10th of Feb call (from Virginie.GALINDO@gemalto.com on 2014-02-13)
- Re: ISSUE-44 and ISSUE-46 (from sleevi@google.com on 2014-02-12)
- ISSUE-44 and ISSUE-46 (from rlb@ipv.sx on 2014-02-12)
- W3C Web Crypto WG - progressing on ISSUE-46 (and ACTION-128) (from Virginie.GALINDO@gemalto.com on 2014-01-09)
- crypto-ISSUE-46: Optional algorithm parameters must have default values [crypto for Web Crypto API] (from sysbot+tracker@w3.org on 2013-06-05)
Related notes:
No additional notes.
Display change log