[Bug 25436] New: Handling of CryptoOperationData needs to be defined

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25436

            Bug ID: 25436
           Summary: Handling of CryptoOperationData needs to be defined
           Product: Web Cryptography
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Web Cryptography API Document
          Assignee: sleevi@google.com
          Reporter: bzbarsky@mit.edu
                CC: public-webcrypto@w3.org

As far as I can tell, nothing actually defines the handling of
CryptoOperationData arguments.

For example, looking at
https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-SubtleCrypto-method-encrypt
it just says:

  Let ciphertext be the result of performing the encrypt operation
  specified by normalizedAlgorithm using algorithm and key and with
  data as plaintext.

but nothing ever defines the type of "plaintext" here.  I assume it's meant to
be some sort of byte array, right?

If so, the following need to be clearly defined:

1)  How do extract a byte array from an ArrayBufferView.  Presumably this is a
matter of looking at the underlying buffer and taking byteLength bytes starting
at byteOffset.  And presumably this uses the canonical getters for those
properties, not whatever is on the prototype (so the [[ViewedArrayBuffer]],
[[ByteLength]], and [[ByteOffset]] internal slots of the object).  Note that at
least one implementor just used all the bytes of the underlying ArrayBuffer
instead, so this clearly does need defining.

2) The exact point when the snapshot of the data is taken.  This matters,
because the data is not immutable.  Presumably there's some sort of data copy
before step 3 of
https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-SubtleCrypto-method-encrypt
for example?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 24 April 2014 01:56:01 UTC