fix hmac generate length param assignment

This commit is contained in:
microshine 2020-04-18 22:51:51 +03:00
parent 67004b9093
commit 1b8cfb2f20
3 changed files with 40 additions and 50 deletions

75
package-lock.json generated
View File

@ -129,9 +129,9 @@
} }
}, },
"@peculiar/asn1-schema": { "@peculiar/asn1-schema": {
"version": "1.0.5", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.1.2.tgz",
"integrity": "sha512-rzzorGYnQNmVHleLvC8gJSbbdNYtg+EB9s075dHvwpxs10teXHYnRmTWhCVuWjbSVSofwdm7IYPtMTWTbcNUWA==", "integrity": "sha512-ntQ4UnUFgdjs0tfWR6YmEQm/x0glV4OFus/RjxLkaJUKfu/R7VilefBntyUO3MoKWdlCgib30KN+JpCY1HqU2A==",
"requires": { "requires": {
"asn1js": "^2.0.26", "asn1js": "^2.0.26",
"tslib": "^1.11.1" "tslib": "^1.11.1"
@ -146,24 +146,13 @@
} }
}, },
"@peculiar/webcrypto-test": { "@peculiar/webcrypto-test": {
"version": "1.0.1", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@peculiar/webcrypto-test/-/webcrypto-test-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@peculiar/webcrypto-test/-/webcrypto-test-1.0.3.tgz",
"integrity": "sha512-0ScgGSff7wk2tsqZ1uUDqJW7kk1wcSKNlWKhzHdd7ZBhdYH7uFj8tuZ4cLzmjyagVhM4mcpXoplDGggf7ag49w==", "integrity": "sha512-O6P4EFS09rLLxdorbwD1agjUNKKYjQ2NuQNNH0nPOBFbqhN5ki6vieaA/WC+ekIfkVvRptxzIBpSpedJrqoWoA==",
"dev": true, "dev": true,
"requires": { "requires": {
"pvtsutils": "^1.0.10", "pvtsutils": "^1.0.10",
"tslib": "^1.11.1" "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": { "@types/color-name": {
@ -191,31 +180,31 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "12.12.34", "version": "12.12.36",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.36.tgz",
"integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==", "integrity": "sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ==",
"dev": true "dev": true
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "2.26.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.26.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.28.0.tgz",
"integrity": "sha512-4yUnLv40bzfzsXcTAtZyTjbiGUXMrcIJcIMioI22tSOyAxpdXiZ4r7YQUU8Jj6XXrLz9d5aMHPQf5JFR7h27Nw==", "integrity": "sha512-w0Ugcq2iatloEabQP56BRWJowliXUP5Wv6f9fKzjJmDW81hOTBxRoJ4LoEOxRpz9gcY51Libytd2ba3yLmSOfg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "2.26.0", "@typescript-eslint/experimental-utils": "2.28.0",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0", "regexpp": "^3.0.0",
"tsutils": "^3.17.1" "tsutils": "^3.17.1"
} }
}, },
"@typescript-eslint/experimental-utils": { "@typescript-eslint/experimental-utils": {
"version": "2.26.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.28.0.tgz",
"integrity": "sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ==", "integrity": "sha512-4SL9OWjvFbHumM/Zh/ZeEjUFxrYKtdCi7At4GyKTbQlrj1HcphIDXlje4Uu4cY+qzszR5NdVin4CCm6AXCjd6w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/json-schema": "^7.0.3", "@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-scope": "^5.0.0",
"eslint-utils": "^2.0.0" "eslint-utils": "^2.0.0"
}, },
@ -232,21 +221,21 @@
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "2.26.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.26.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.28.0.tgz",
"integrity": "sha512-+Xj5fucDtdKEVGSh9353wcnseMRkPpEAOY96EEenN7kJVrLqy/EVwtIh3mxcUz8lsFXW1mT5nN5vvEam/a5HiQ==", "integrity": "sha512-RqPybRDquui9d+K86lL7iPqH6Dfp9461oyqvlXMNtap+PyqYbkY5dB7LawQjDzot99fqzvS0ZLZdfe+1Bt3Jgw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-visitor-keys": "^1.0.0", "@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.26.0", "@typescript-eslint/experimental-utils": "2.28.0",
"@typescript-eslint/typescript-estree": "2.26.0", "@typescript-eslint/typescript-estree": "2.28.0",
"eslint-visitor-keys": "^1.1.0" "eslint-visitor-keys": "^1.1.0"
} }
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "2.26.0", "version": "2.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.28.0.tgz",
"integrity": "sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg==", "integrity": "sha512-HDr8MP9wfwkiuqzRVkuM3BeDrOC4cKbO5a6BymZBHUt5y/2pL0BXD6I/C/ceq2IZoHWhcASk+5/zo+dwgu9V8Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"debug": "^4.1.1", "debug": "^4.1.1",
@ -3047,9 +3036,9 @@
} }
}, },
"rollup": { "rollup": {
"version": "2.3.3", "version": "2.6.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.3.3.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.6.1.tgz",
"integrity": "sha512-uJ9VNWk80mb4wDCSfd1AyHoSc9TrWbkZtnO6wbsMTp9muSWkT26Dvc99MX1yGCOTvUN1Skw/KpFzKdUDuZKTXA==", "integrity": "sha512-1RhFDRJeg027YjBO6+JxmVWkEZY0ASztHhoEUEWxOwkh4mjO58TFD6Uo7T7Y3FbmDpRTfKhM5NVxJyimCn0Elg==",
"dev": true, "dev": true,
"requires": { "requires": {
"fsevents": "~2.1.2" "fsevents": "~2.1.2"
@ -3749,11 +3738,11 @@
} }
}, },
"webcrypto-core": { "webcrypto-core": {
"version": "1.0.19", "version": "1.0.20",
"resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.0.19.tgz", "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.0.20.tgz",
"integrity": "sha512-6XHExtfMJrpkFDh9MiJ/y7ptX0dfZi0ogxFyelqxMu1eFowxivHfIp6DKzT+ZjU66xTuNfJkfkUk1bIB3tEOgA==", "integrity": "sha512-bVLusJAHfTS47hZrVTUKVuXFDgI5dD9Cwmpv4fNnDc5HzqMLlil0M0ngAeVV/+BHkUvs0IVH7NUpU1RLxOHHjQ==",
"requires": { "requires": {
"@peculiar/asn1-schema": "^1.0.5", "@peculiar/asn1-schema": "^1.1.2",
"@peculiar/json-schema": "^1.1.10", "@peculiar/json-schema": "^1.1.10",
"asn1js": "^2.0.26", "asn1js": "^2.0.26",
"pvtsutils": "^1.0.10", "pvtsutils": "^1.0.10",

View File

@ -49,28 +49,28 @@
"homepage": "https://github.com/PeculiarVentures/webcrypto#readme", "homepage": "https://github.com/PeculiarVentures/webcrypto#readme",
"banner": "// Copyright (c) 2020, Peculiar Ventures, All rights reserved.", "banner": "// Copyright (c) 2020, Peculiar Ventures, All rights reserved.",
"devDependencies": { "devDependencies": {
"@peculiar/webcrypto-test": "^1.0.1", "@peculiar/webcrypto-test": "^1.0.3",
"@types/mocha": "^7.0.2", "@types/mocha": "^7.0.2",
"@types/node": "^12.12.34", "@types/node": "^12.12.36",
"@typescript-eslint/eslint-plugin": "^2.26.0", "@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.26.0", "@typescript-eslint/parser": "^2.28.0",
"coveralls": "^3.0.11", "coveralls": "^3.0.11",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"mocha": "^7.1.1", "mocha": "^7.1.1",
"nyc": "^14.1.1", "nyc": "^14.1.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.3.3", "rollup": "^2.6.1",
"rollup-plugin-typescript2": "^0.26.0", "rollup-plugin-typescript2": "^0.26.0",
"ts-node": "^8.8.2", "ts-node": "^8.8.2",
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@peculiar/asn1-schema": "^1.0.5", "@peculiar/asn1-schema": "^1.1.2",
"@peculiar/json-schema": "^1.1.10", "@peculiar/json-schema": "^1.1.10",
"pvtsutils": "^1.0.10", "pvtsutils": "^1.0.10",
"tslib": "^1.11.1", "tslib": "^1.11.1",
"webcrypto-core": "^1.0.19-next.0" "webcrypto-core": "^1.0.20"
}, },
"nyc": { "nyc": {
"extension": [ "extension": [

View File

@ -11,6 +11,7 @@ export class HmacProvider extends core.HmacProvider {
const key = new HmacCryptoKey(); const key = new HmacCryptoKey();
key.algorithm = { key.algorithm = {
...algorithm as any, ...algorithm as any,
length,
name: this.name, name: this.name,
}; };
key.extractable = extractable; key.extractable = extractable;