Merge pull request #62 from PeculiarVentures/update-dependencies

Update dependencies
This commit is contained in:
Miroshin Stepan 2023-03-21 20:08:00 +01:00 committed by GitHub
commit c74cf09150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 575 additions and 1418 deletions

View File

@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-
- name: Install global dependencies
run: npm i yarn -g
run: npm i yarn nyc coveralls -g
- name: Install dependencies
run: yarn

View File

@ -54,27 +54,25 @@
"homepage": "https://github.com/PeculiarVentures/webcrypto#readme",
"devDependencies": {
"@peculiar/webcrypto-test": "^1.0.7",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"coveralls": "^3.1.1",
"eslint": "^8.26.0",
"eslint-plugin-import": "^2.26.0",
"mocha": "^10.1.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"rollup": "^3.2.5",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.5",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"eslint": "^8.36.0",
"eslint-plugin-import": "^2.27.5",
"mocha": "^10.2.0",
"rimraf": "^4.4.0",
"rollup": "^3.20.0",
"rollup-plugin-typescript2": "^0.34.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^5.0.2"
},
"dependencies": {
"@peculiar/asn1-schema": "^2.3.0",
"@peculiar/asn1-schema": "^2.3.6",
"@peculiar/json-schema": "^1.1.12",
"pvtsutils": "^1.3.2",
"tslib": "^2.4.1",
"webcrypto-core": "^1.7.4"
"tslib": "^2.5.0",
"webcrypto-core": "^1.7.7"
},
"nyc": {
"extension": [

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { getCryptoKey, setCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { getCryptoKey, setCryptoKey } from "../storage";
export class AesCbcProvider extends core.AesCbcProvider {

View File

@ -1,8 +1,8 @@
import * as crypto from "crypto";
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
/**
* AES-CMAC implementation source code from https://github.com/allan-stewart/node-aes-cmac

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class AesCtrProvider extends core.AesCtrProvider {

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class AesEcbProvider extends core.AesEcbProvider {

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class AesGcmProvider extends core.AesGcmProvider {

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { AesCrypto } from "./crypto";
import { AesCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class AesKwProvider extends core.AesKwProvider {

View File

@ -1,8 +1,8 @@
import crypto, { CipherGCM, DecipherGCM } from "crypto";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { AesCryptoKey } from "./key";
import { CryptoKey } from "../../keys";
export class AesCrypto {

View File

@ -2,8 +2,8 @@ import crypto from "crypto";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { DesParams } from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { DesCryptoKey } from "./key";
import { CryptoKey } from "../../keys";
export class DesCrypto {

View File

@ -1,8 +1,8 @@
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
import { DesCrypto } from "./crypto";
import { DesCryptoKey } from "./key";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
export type DesCbcParams = core.DesParams;

View File

@ -1,8 +1,8 @@
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
import { DesCrypto } from "./crypto";
import { DesCryptoKey } from "./key";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
export type DesEde3CbcParams = core.DesParams;

View File

@ -3,11 +3,11 @@ import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import { BufferSourceConverter } from "pvtsutils";
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { ShaCrypto } from "../sha";
import { getOidByNamedCurve } from "./helper";
import { EcPrivateKey } from "./private_key";
import { EcPublicKey } from "./public_key";
import { CryptoKey } from "../../keys";
import { ShaCrypto } from "../sha";
export class EcCrypto {

View File

@ -1,9 +1,9 @@
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
import { EcCrypto } from "./crypto";
import { EcPrivateKey } from "./private_key";
import { EcPublicKey } from "./public_key";
import { CryptoKey } from "../../keys";
import { setCryptoKey, getCryptoKey } from "../storage";
export class EcdhProvider extends core.EcdhProvider {

View File

@ -1,8 +1,8 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { EcCrypto } from "./crypto";
import { EcPrivateKey } from "./private_key";
import { EcPublicKey } from "./public_key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class EcdsaProvider extends core.EcdsaProvider {

View File

@ -1,8 +1,8 @@
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { IJsonConvertible, JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys";
import { getOidByNamedCurve } from "./helper";
import { AsymmetricKey } from "../../keys";
export class EcPrivateKey extends AsymmetricKey implements IJsonConvertible {
public readonly type = "private" as const;

View File

@ -1,8 +1,8 @@
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { IJsonConvertible, JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys/asymmetric";
import { getOidByNamedCurve } from "./helper";
import { AsymmetricKey } from "../../keys/asymmetric";
export class EcPublicKey extends AsymmetricKey implements IJsonConvertible {

View File

@ -3,9 +3,9 @@ import { AsnParser } from "@peculiar/asn1-schema";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import { Convert } from "pvtsutils";
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { EdPrivateKey } from "./private_key";
import { EdPublicKey } from "./public_key";
import { CryptoKey } from "../../keys";
export class EdCrypto {

View File

@ -1,7 +1,7 @@
import * as core from "webcrypto-core";
import { EdCrypto } from "./crypto";
import { CryptoKey } from "../../keys";
import { getCryptoKey, setCryptoKey } from "../storage";
import { EdCrypto } from "./crypto";
export class EcdhEsProvider extends core.EcdhEsProvider {

View File

@ -1,9 +1,9 @@
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { getCryptoKey, setCryptoKey } from "../storage";
import { EdCrypto } from "./crypto";
import { EdPrivateKey } from "./private_key";
import { EdPublicKey } from "./public_key";
import { CryptoKey } from "../../keys";
import { getCryptoKey, setCryptoKey } from "../storage";
export class EdDsaProvider extends core.EdDsaProvider {

View File

@ -1,8 +1,8 @@
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { IJsonConvertible, JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys";
import { getOidByNamedCurve } from "./helper";
import { AsymmetricKey } from "../../keys";
export class EdPrivateKey extends AsymmetricKey implements IJsonConvertible {
public readonly type = "private" as const;

View File

@ -2,8 +2,8 @@ import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { IJsonConvertible } from "@peculiar/json-schema";
import { Convert } from "pvtsutils";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys/asymmetric";
import { getOidByNamedCurve } from "./helper";
import { AsymmetricKey } from "../../keys/asymmetric";
export class EdPublicKey extends AsymmetricKey implements IJsonConvertible {

View File

@ -1,8 +1,8 @@
import crypto from "crypto";
import * as core from "webcrypto-core";
import { BufferSourceConverter, CryptoKey } from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { HkdfCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class HkdfProvider extends core.HkdfProvider {

View File

@ -1,9 +1,9 @@
import crypto from "crypto";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { HmacCryptoKey } from "./key";
import { ShaCrypto } from "../sha";
import { setCryptoKey, getCryptoKey } from "../storage";
import { HmacCryptoKey } from "./key";
export class HmacProvider extends core.HmacProvider {

View File

@ -1,7 +1,7 @@
import crypto from "crypto";
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { PbkdfCryptoKey } from "./key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class Pbkdf2Provider extends core.Pbkdf2Provider {

View File

@ -2,9 +2,9 @@ import crypto from "crypto";
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { CryptoKey } from "../../keys";
import { RsaPrivateKey } from "./private_key";
import { RsaPublicKey } from "./public_key";
import { CryptoKey } from "../../keys";
interface INodeCryptoSignOptions {
key: string;

View File

@ -1,8 +1,8 @@
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys";
import { getJwkAlgorithm } from "./helper";
import { AsymmetricKey } from "../../keys";
export class RsaPrivateKey extends AsymmetricKey {
public readonly type = "private" as const;

View File

@ -1,8 +1,8 @@
import { AsnParser, AsnSerializer } from "@peculiar/asn1-schema";
import { JsonParser, JsonSerializer } from "@peculiar/json-schema";
import * as core from "webcrypto-core";
import { AsymmetricKey } from "../../keys/asymmetric";
import { getJwkAlgorithm } from "./helper";
import { AsymmetricKey } from "../../keys/asymmetric";
export class RsaPublicKey extends AsymmetricKey {
public readonly type = "public" as const;

View File

@ -1,10 +1,10 @@
import * as crypto from "crypto";
import { Convert } from "pvtsutils";
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { RsaCrypto } from "./crypto";
import { RsaPrivateKey } from "./private_key";
import { RsaPublicKey } from "./public_key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class RsaEsProvider extends core.ProviderCrypto {

View File

@ -1,10 +1,10 @@
import crypto from "crypto";
import * as core from "webcrypto-core";
import { ShaCrypto } from "../sha/crypto";
import { setCryptoKey, getCryptoKey } from "../storage";
import { RsaCrypto } from "./crypto";
import { RsaPrivateKey } from "./private_key";
import { RsaPublicKey } from "./public_key";
import { ShaCrypto } from "../sha/crypto";
import { setCryptoKey, getCryptoKey } from "../storage";
/**
* Source code for decrypt, encrypt, mgf1 functions is from asmcrypto module

View File

@ -1,8 +1,8 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { RsaCrypto } from "./crypto";
import { RsaPrivateKey } from "./private_key";
import { RsaPublicKey } from "./public_key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class RsaPssProvider extends core.RsaPssProvider {

View File

@ -1,8 +1,8 @@
import * as core from "webcrypto-core";
import { setCryptoKey, getCryptoKey } from "../storage";
import { RsaCrypto } from "./crypto";
import { RsaPrivateKey } from "./private_key";
import { RsaPublicKey } from "./public_key";
import { setCryptoKey, getCryptoKey } from "../storage";
export class RsaSsaProvider extends core.RsaSsaProvider {

View File

@ -30,7 +30,10 @@ export class SubtleCrypto extends core.SubtleCrypto {
//#endregion
//#region DES
this.providers.set(new DesCbcProvider());
const ciphers = crypto.getCiphers();
if (ciphers.includes("des-cbc")) {
this.providers.set(new DesCbcProvider());
}
this.providers.set(new DesEde3CbcProvider());
//#endregion

View File

@ -1,5 +1,6 @@
import assert from "assert";
import process from "process";
import assert from "node:assert";
import nodeCrypto from "node:crypto";
import process from "node:process";
import { WebcryptoTest } from "@peculiar/webcrypto-test";
import { Convert } from "pvtsutils";
import * as core from "webcrypto-core";
@ -10,7 +11,11 @@ const nodeMajorVersion = parseInt(/^v(\d+)/.exec(process.version)![1], 10);
const crypto = new Crypto();
WebcryptoTest.check(crypto as any, {});
const ciphers = nodeCrypto.getCiphers();
WebcryptoTest.check(crypto as any, {
DESCBC: !ciphers.includes("des-cbc"),
});
context("Crypto", () => {
context("getRandomValues", () => {

1873
yarn.lock

File diff suppressed because it is too large Load Diff