W3C home > Mailing lists > Public > public-webcrypto@w3.org > July 2014

Re: Spec for CryptoKey.algorithm and CryptoKey.usages doesn't really make sense

From: Ryan Sleevi <sleevi@google.com>
Date: Mon, 14 Jul 2014 13:44:06 -0700
Message-ID: <CACvaWvZcHUwY=+0cAq=-4NmUTnX56hBP==YPYBVp6T7-9Pr6KA@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-webcrypto@w3.org" <public-webcrypto@w3.org>
On Mon, Jul 14, 2014 at 1:21 PM, Domenic Denicola <
domenic@domenicdenicola.com> wrote:

>  (I cannot seem to post to the list, as I am not a working group member,
> FYI.)
>  I would not give up on 2 just yet. I agree that it is not obvious how
> this should be done, and that other specs aren't helping. But as a first
> stab, you could store [[algorithm]] and [[algorithm_exposed]] both as JS
> objects, and say that structured clone only clones [[algorithm]]. Even
> though [[algorithm]] is a JS object, it should be safe to touch from the
> spec at all times, since users never get access to it.
>  It's true that modifications to the global Object and Object prototype
> would affect it, but I don't think they could break anything, as long as
> the spec does nothing more than getting a predefined set of own-property
> values. (Getting *arbitrary* properties is dangerous, since that falls
> through to Object.prototype, but if the object is guaranteed to have an own
> .hash property as a result of the structured clone, then `var hash =
> obj.hash`, or its spec equivalent, should be safe.)
>  If you can let us know what general approach you think would be good, I
> at least am happy to

Considering that the whole point of [[algorithm]] is to make it easier for
the Web Crypto spec to define it's processing algorithms in terms of
invoking getters on [[algorithm]]. If [[algorithm]] contains a JS object, I
do not see how we can (safely) invoke the Getter at any point during a
promises' asynchronous execution in a way that is undetectable, which I
consider an essential property for the Promise code (and, more generally,
to the concept of the immutability of [[algorithm]] from the POV of script

That's why I don't see it being possible for [[algorithm]] to sanely hold a
JS object.
Received on Monday, 14 July 2014 20:44:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:17:23 UTC