"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "extensions/crypto/00_crypto.js" between
deno-1.12.0.tar.gz and deno-1.12.1.tar.gz

About: Deno is is a simple, modern and secure runtime for JavaScript and TypeScript that uses the V8 JavaScript engine and is built in Rust.

00_crypto.js  (deno-1.12.0):00_crypto.js  (deno-1.12.1)
skipping to change at line 446 skipping to change at line 446
signature = webidl.converters.BufferSource(signature, { signature = webidl.converters.BufferSource(signature, {
prefix, prefix,
context: "Argument 3", context: "Argument 3",
}); });
data = webidl.converters.BufferSource(data, { data = webidl.converters.BufferSource(data, {
prefix, prefix,
context: "Argument 4", context: "Argument 4",
}); });
// 2. // 2.
if (ArrayBuffer.isView(signature)) { if (ArrayBufferIsView(signature)) {
signature = new Uint8Array( signature = new Uint8Array(
signature.buffer, signature.buffer,
signature.byteOffset, signature.byteOffset,
signature.byteLength, signature.byteLength,
); );
} else { } else {
signature = new Uint8Array(signature); signature = new Uint8Array(signature);
} }
signature = signature.slice(); signature = TypedArrayPrototypeSlice(signature);
// 3. // 3.
if (ArrayBuffer.isView(data)) { if (ArrayBufferIsView(data)) {
data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength); data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
} else { } else {
data = new Uint8Array(data); data = new Uint8Array(data);
} }
data = data.slice(); data = TypedArrayPrototypeSlice(data);
const normalizedAlgorithm = normalizeAlgorithm(algorithm, "verify"); const normalizedAlgorithm = normalizeAlgorithm(algorithm, "verify");
const handle = key[_handle]; const handle = key[_handle];
const keyData = KEY_STORE.get(handle); const keyData = WeakMapPrototypeGet(KEY_STORE, handle);
if (normalizedAlgorithm.name !== key[_algorithm].name) { if (normalizedAlgorithm.name !== key[_algorithm].name) {
throw new DOMException( throw new DOMException(
"Verifying algorithm doesn't match key algorithm.", "Verifying algorithm doesn't match key algorithm.",
"InvalidAccessError", "InvalidAccessError",
); );
} }
if (!key[_usages].includes("verify")) { if (!ArrayPrototypeIncludes(key[_usages], "verify")) {
throw new DOMException( throw new DOMException(
"Key does not support the 'verify' operation.", "Key does not support the 'verify' operation.",
"InvalidAccessError", "InvalidAccessError",
); );
} }
switch (normalizedAlgorithm.name) { switch (normalizedAlgorithm.name) {
case "RSASSA-PKCS1-v1_5": { case "RSASSA-PKCS1-v1_5": {
if (key[_type] !== "public") { if (key[_type] !== "public") {
throw new DOMException( throw new DOMException(
skipping to change at line 779 skipping to change at line 779
const prefix = "Failed to execute 'getRandomValues' on 'Crypto'"; const prefix = "Failed to execute 'getRandomValues' on 'Crypto'";
webidl.requiredArguments(arguments.length, 1, { prefix }); webidl.requiredArguments(arguments.length, 1, { prefix });
arrayBufferView = webidl.converters.ArrayBufferView(arrayBufferView, { arrayBufferView = webidl.converters.ArrayBufferView(arrayBufferView, {
prefix, prefix,
context: "Argument 1", context: "Argument 1",
}); });
if ( if (
!( !(
arrayBufferView instanceof Int8Array || arrayBufferView instanceof Int8Array ||
arrayBufferView instanceof Uint8Array || arrayBufferView instanceof Uint8Array ||
arrayBufferView instanceof Uint8ClampedArray ||
arrayBufferView instanceof Int16Array || arrayBufferView instanceof Int16Array ||
arrayBufferView instanceof Uint16Array || arrayBufferView instanceof Uint16Array ||
arrayBufferView instanceof Int32Array || arrayBufferView instanceof Int32Array ||
arrayBufferView instanceof Uint32Array || arrayBufferView instanceof Uint32Array ||
arrayBufferView instanceof Uint8ClampedArray arrayBufferView instanceof BigInt64Array ||
arrayBufferView instanceof BigUint64Array
) )
) { ) {
throw new DOMException( throw new DOMException(
"The provided ArrayBufferView is not an integer array type", "The provided ArrayBufferView is not an integer array type",
"TypeMismatchError", "TypeMismatchError",
); );
} }
const ui8 = new Uint8Array( const ui8 = new Uint8Array(
arrayBufferView.buffer, arrayBufferView.buffer,
arrayBufferView.byteOffset, arrayBufferView.byteOffset,
 End of changes. 8 change blocks. 
7 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)