From 7d682fdf18b6e86dec492a904ecef3ea9d09b512 Mon Sep 17 00:00:00 2001 From: foxt Date: Wed, 18 Dec 2024 20:46:43 +0000 Subject: [PATCH] bump @types/node --- package-lock.json | 42 +++++++++++++++++++++++++--------- package.json | 2 +- src/auth/iCSRPAuthenticator.ts | 4 ++-- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2e45c5..623c85e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "icloudjs", - "version": "1.5.0", + "version": "1.6.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "icloudjs", - "version": "1.5.0", + "version": "1.6.1", "license": "MIT", "dependencies": { "@foxt/js-srp": "^0.0.3-patch2", @@ -15,7 +15,7 @@ "tough-cookie": "^4.0.0" }, "devDependencies": { - "@types/node": "^18.6.4", + "@types/node": "^20.17.10", "@types/node-fetch": "^2.6.2", "@types/tough-cookie": "^4.0.2", "@typescript-eslint/eslint-plugin": "^5.43.0", @@ -193,10 +193,14 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.4.tgz", - "integrity": "sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==", - "dev": true + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/node-fetch": { "version": "2.6.2", @@ -2318,6 +2322,13 @@ "node": ">=4.2.0" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -2556,10 +2567,13 @@ "dev": true }, "@types/node": { - "version": "18.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.4.tgz", - "integrity": "sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==", - "dev": true + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } }, "@types/node-fetch": { "version": "2.6.2", @@ -4071,6 +4085,12 @@ "dev": true, "peer": true }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index 42c2b32..1634e73 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "keytar": "^7.9.0" }, "devDependencies": { - "@types/node": "^18.6.4", + "@types/node": "^20.17.10", "@types/node-fetch": "^2.6.2", "@types/tough-cookie": "^4.0.2", "@typescript-eslint/eslint-plugin": "^5.43.0", diff --git a/src/auth/iCSRPAuthenticator.ts b/src/auth/iCSRPAuthenticator.ts index 63c8890..711a5ad 100644 --- a/src/auth/iCSRPAuthenticator.ts +++ b/src/auth/iCSRPAuthenticator.ts @@ -35,9 +35,9 @@ export class GSASRPAuthenticator { private async derivePassword(protocol: "s2k" | "s2k_fo", password: string, salt: Uint8Array, iterations: number) { - let passHash = new Uint8Array(await util.hash(srp.h, stringToU8Array(password))); + let passHash = new Uint8Array(await util.hash(srp.h, stringToU8Array(password).buffer as ArrayBuffer)); if (protocol == "s2k_fo") - passHash = stringToU8Array(util.toHex(passHash)); + passHash = stringToU8Array(util.toHex(passHash)) as Uint8Array; const imported = await crypto.subtle.importKey(