Verify makeAttachmentPointer
and encryptAttachment
arguments
The underlying `crypto.subtle.encrypt` API requires it.
This commit is contained in:
parent
8218e308cd
commit
32911002d4
2 changed files with 18 additions and 0 deletions
|
@ -87,6 +87,13 @@
|
|||
},
|
||||
|
||||
encryptAttachment: function(plaintext, keys, iv) {
|
||||
if (!(plaintext instanceof ArrayBuffer) && !ArrayBuffer.isView(plaintext)) {
|
||||
throw new TypeError(
|
||||
'`plaintext` must be an `ArrayBuffer` or `ArrayBufferView`; got: ' +
|
||||
typeof plaintext
|
||||
);
|
||||
}
|
||||
|
||||
if (keys.byteLength != 64) {
|
||||
throw new Error("Got invalid length attachment keys");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue