From 1b8cfb2f200f3de2f6f11daa6f582c009748c6dd Mon Sep 17 00:00:00 2001 From: microshine Date: Sat, 18 Apr 2020 22:51:51 +0300 Subject: [PATCH] fix hmac generate length param assignment --- package-lock.json | 75 ++++++++++++++++++------------------------ package.json | 14 ++++---- src/mechs/hmac/hmac.ts | 1 + 3 files changed, 40 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75f52cf..4901d98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -129,9 +129,9 @@ } }, "@peculiar/asn1-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.0.5.tgz", - "integrity": "sha512-rzzorGYnQNmVHleLvC8gJSbbdNYtg+EB9s075dHvwpxs10teXHYnRmTWhCVuWjbSVSofwdm7IYPtMTWTbcNUWA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.1.2.tgz", + "integrity": "sha512-ntQ4UnUFgdjs0tfWR6YmEQm/x0glV4OFus/RjxLkaJUKfu/R7VilefBntyUO3MoKWdlCgib30KN+JpCY1HqU2A==", "requires": { "asn1js": "^2.0.26", "tslib": "^1.11.1" @@ -146,24 +146,13 @@ } }, "@peculiar/webcrypto-test": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@peculiar/webcrypto-test/-/webcrypto-test-1.0.1.tgz", - "integrity": "sha512-0ScgGSff7wk2tsqZ1uUDqJW7kk1wcSKNlWKhzHdd7ZBhdYH7uFj8tuZ4cLzmjyagVhM4mcpXoplDGggf7ag49w==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@peculiar/webcrypto-test/-/webcrypto-test-1.0.3.tgz", + "integrity": "sha512-O6P4EFS09rLLxdorbwD1agjUNKKYjQ2NuQNNH0nPOBFbqhN5ki6vieaA/WC+ekIfkVvRptxzIBpSpedJrqoWoA==", "dev": true, "requires": { "pvtsutils": "^1.0.10", "tslib": "^1.11.1" - }, - "dependencies": { - "pvtsutils": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.0.10.tgz", - "integrity": "sha512-8ZKQcxnZKTn+fpDh7wL4yKax5fdl3UJzT8Jv49djZpB/dzPxacyN1Sez90b6YLdOmvIr9vaySJ5gw4aUA1EdSw==", - "dev": true, - "requires": { - "tslib": "^1.10.0" - } - } } }, "@types/color-name": { @@ -191,31 +180,31 @@ "dev": true }, "@types/node": { - "version": "12.12.34", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz", - "integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==", + "version": "12.12.36", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.36.tgz", + "integrity": "sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.26.0.tgz", - "integrity": "sha512-4yUnLv40bzfzsXcTAtZyTjbiGUXMrcIJcIMioI22tSOyAxpdXiZ4r7YQUU8Jj6XXrLz9d5aMHPQf5JFR7h27Nw==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.28.0.tgz", + "integrity": "sha512-w0Ugcq2iatloEabQP56BRWJowliXUP5Wv6f9fKzjJmDW81hOTBxRoJ4LoEOxRpz9gcY51Libytd2ba3yLmSOfg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.26.0", + "@typescript-eslint/experimental-utils": "2.28.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "tsutils": "^3.17.1" } }, "@typescript-eslint/experimental-utils": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz", - "integrity": "sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.28.0.tgz", + "integrity": "sha512-4SL9OWjvFbHumM/Zh/ZeEjUFxrYKtdCi7At4GyKTbQlrj1HcphIDXlje4Uu4cY+qzszR5NdVin4CCm6AXCjd6w==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.26.0", + "@typescript-eslint/typescript-estree": "2.28.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, @@ -232,21 +221,21 @@ } }, "@typescript-eslint/parser": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.26.0.tgz", - "integrity": "sha512-+Xj5fucDtdKEVGSh9353wcnseMRkPpEAOY96EEenN7kJVrLqy/EVwtIh3mxcUz8lsFXW1mT5nN5vvEam/a5HiQ==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.28.0.tgz", + "integrity": "sha512-RqPybRDquui9d+K86lL7iPqH6Dfp9461oyqvlXMNtap+PyqYbkY5dB7LawQjDzot99fqzvS0ZLZdfe+1Bt3Jgw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.26.0", - "@typescript-eslint/typescript-estree": "2.26.0", + "@typescript-eslint/experimental-utils": "2.28.0", + "@typescript-eslint/typescript-estree": "2.28.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz", - "integrity": "sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.28.0.tgz", + "integrity": "sha512-HDr8MP9wfwkiuqzRVkuM3BeDrOC4cKbO5a6BymZBHUt5y/2pL0BXD6I/C/ceq2IZoHWhcASk+5/zo+dwgu9V8Q==", "dev": true, "requires": { "debug": "^4.1.1", @@ -3047,9 +3036,9 @@ } }, "rollup": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.3.3.tgz", - "integrity": "sha512-uJ9VNWk80mb4wDCSfd1AyHoSc9TrWbkZtnO6wbsMTp9muSWkT26Dvc99MX1yGCOTvUN1Skw/KpFzKdUDuZKTXA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.6.1.tgz", + "integrity": "sha512-1RhFDRJeg027YjBO6+JxmVWkEZY0ASztHhoEUEWxOwkh4mjO58TFD6Uo7T7Y3FbmDpRTfKhM5NVxJyimCn0Elg==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -3749,11 +3738,11 @@ } }, "webcrypto-core": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.0.19.tgz", - "integrity": "sha512-6XHExtfMJrpkFDh9MiJ/y7ptX0dfZi0ogxFyelqxMu1eFowxivHfIp6DKzT+ZjU66xTuNfJkfkUk1bIB3tEOgA==", + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.0.20.tgz", + "integrity": "sha512-bVLusJAHfTS47hZrVTUKVuXFDgI5dD9Cwmpv4fNnDc5HzqMLlil0M0ngAeVV/+BHkUvs0IVH7NUpU1RLxOHHjQ==", "requires": { - "@peculiar/asn1-schema": "^1.0.5", + "@peculiar/asn1-schema": "^1.1.2", "@peculiar/json-schema": "^1.1.10", "asn1js": "^2.0.26", "pvtsutils": "^1.0.10", diff --git a/package.json b/package.json index e6fed75..98943a1 100644 --- a/package.json +++ b/package.json @@ -49,28 +49,28 @@ "homepage": "https://github.com/PeculiarVentures/webcrypto#readme", "banner": "// Copyright (c) 2020, Peculiar Ventures, All rights reserved.", "devDependencies": { - "@peculiar/webcrypto-test": "^1.0.1", + "@peculiar/webcrypto-test": "^1.0.3", "@types/mocha": "^7.0.2", - "@types/node": "^12.12.34", - "@typescript-eslint/eslint-plugin": "^2.26.0", - "@typescript-eslint/parser": "^2.26.0", + "@types/node": "^12.12.36", + "@typescript-eslint/eslint-plugin": "^2.28.0", + "@typescript-eslint/parser": "^2.28.0", "coveralls": "^3.0.11", "eslint": "^6.8.0", "eslint-plugin-import": "^2.20.2", "mocha": "^7.1.1", "nyc": "^14.1.1", "rimraf": "^3.0.2", - "rollup": "^2.3.3", + "rollup": "^2.6.1", "rollup-plugin-typescript2": "^0.26.0", "ts-node": "^8.8.2", "typescript": "^3.8.3" }, "dependencies": { - "@peculiar/asn1-schema": "^1.0.5", + "@peculiar/asn1-schema": "^1.1.2", "@peculiar/json-schema": "^1.1.10", "pvtsutils": "^1.0.10", "tslib": "^1.11.1", - "webcrypto-core": "^1.0.19-next.0" + "webcrypto-core": "^1.0.20" }, "nyc": { "extension": [ diff --git a/src/mechs/hmac/hmac.ts b/src/mechs/hmac/hmac.ts index 4f14730..40de998 100644 --- a/src/mechs/hmac/hmac.ts +++ b/src/mechs/hmac/hmac.ts @@ -11,6 +11,7 @@ export class HmacProvider extends core.HmacProvider { const key = new HmacCryptoKey(); key.algorithm = { ...algorithm as any, + length, name: this.name, }; key.extractable = extractable;