From 5ce0c267f42341b823bb05f7a1f0553e4c9e6b47 Mon Sep 17 00:00:00 2001 From: microshine Date: Wed, 25 Nov 2020 12:58:53 +0300 Subject: [PATCH] style: fix lint errors --- .eslintrc.json | 1 + src/mechs/ec/crypto.ts | 2 -- src/mechs/rsa/crypto.ts | 5 ----- src/mechs/rsa/rsa_es.ts | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9dae37a..3fab269 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,6 +18,7 @@ "@typescript-eslint/interface-name-prefix": 0, "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/semi": 1, + "@typescript-eslint/explicit-module-boundary-types": 0, "semi": "off", "import/order": ["error", { "groups": ["builtin", "external", "internal"], diff --git a/src/mechs/ec/crypto.ts b/src/mechs/ec/crypto.ts index 2c86b86..421978c 100644 --- a/src/mechs/ec/crypto.ts +++ b/src/mechs/ec/crypto.ts @@ -23,14 +23,12 @@ export class EcCrypto { publicKey.extractable = true; publicKey.usages = keyUsages.filter((usage) => this.publicKeyUsages.indexOf(usage) !== -1); - // @ts-ignore NodeJs d.ts error const keys = crypto.generateKeyPairSync("ec", { namedCurve: this.getOpenSSLNamedCurve(algorithm.namedCurve), publicKeyEncoding: { format: "der", type: "spki", }, - // @ts-ignore NodeJs d.ts error privateKeyEncoding: { format: "der", type: "pkcs8", diff --git a/src/mechs/rsa/crypto.ts b/src/mechs/rsa/crypto.ts index 55bcb58..806ad20 100644 --- a/src/mechs/rsa/crypto.ts +++ b/src/mechs/rsa/crypto.ts @@ -34,7 +34,6 @@ export class RsaCrypto { Buffer.from(algorithm.publicExponent), ]).readInt32BE(0); - // @ts-ignore NodeJs d.ts error const keys = crypto.generateKeyPairSync("rsa", { modulusLength: algorithm.modulusLength, publicExponent, @@ -199,7 +198,6 @@ export class RsaCrypto { key: key.pem, }; if (algorithm.name.toUpperCase() === "RSA-PSS") { - // @ts-ignore options.padding = crypto.constants.RSA_PKCS1_PSS_PADDING; options.saltLength = (algorithm as RsaPssParams).saltLength; } @@ -220,7 +218,6 @@ export class RsaCrypto { key: key.pem, }; if (algorithm.name.toUpperCase() === "RSA-PSS") { - // @ts-ignore options.padding = crypto.constants.RSA_PKCS1_PSS_PADDING; options.saltLength = (algorithm as RsaPssParams).saltLength; } @@ -232,7 +229,6 @@ export class RsaCrypto { protected static encryptOAEP(algorithm: RsaOaepParams, key: RsaPublicKey, data: Uint8Array) { const options: crypto.RsaPublicKey = { key: `-----BEGIN PUBLIC KEY-----\n${key.data.toString("base64")}\n-----END PUBLIC KEY-----`, - // @ts-ignore padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, }; if (algorithm.label) { @@ -245,7 +241,6 @@ export class RsaCrypto { protected static decryptOAEP(algorithm: RsaOaepParams, key: RsaPrivateKey, data: Uint8Array) { const options: crypto.RsaPrivateKey = { key: `-----BEGIN PRIVATE KEY-----\n${key.data.toString("base64")}\n-----END PRIVATE KEY-----`, - // @ts-ignore padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, }; if (algorithm.label) { diff --git a/src/mechs/rsa/rsa_es.ts b/src/mechs/rsa/rsa_es.ts index 1f64cdc..47ed1e6 100644 --- a/src/mechs/rsa/rsa_es.ts +++ b/src/mechs/rsa/rsa_es.ts @@ -87,7 +87,6 @@ export class RsaEsProvider extends core.ProviderCrypto { const type = key.type.toUpperCase(); return { key: `-----BEGIN ${type} KEY-----\n${getCryptoKey(key).data.toString("base64")}\n-----END ${type} KEY-----`, - // @ts-ignore padding: crypto.constants.RSA_PKCS1_PADDING, }; }