Skip to content

Commit

Permalink
fix: Downgrade node-webcrypto-ossl to avoid breaking change (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea authored Apr 23, 2020
1 parent 104c71a commit 39b6604
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 96 deletions.
4 changes: 2 additions & 2 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { Crypto } = require("node-webcrypto-ossl");
const WebCrypto = require('node-webcrypto-ossl');
const { CryptoEngine, setEngine } = require('pkijs');

const webcrypto = new Crypto();
const webcrypto = new WebCrypto();
const cryptoEngine = new CryptoEngine({
crypto: webcrypto,
name: 'nodeEngine',
Expand Down
109 changes: 20 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"asn1js": "^2.0.22",
"binary-parser": "^1.4.0",
"buffer-to-arraybuffer": "0.0.5",
"node-webcrypto-ossl": "^2.0.6",
"node-webcrypto-ossl": "^1.0.49",
"pkijs": "^2.1.88",
"smart-buffer": "^4.0.2",
"uuid4": "^1.1.4",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//region Configure PKI.js
import { Crypto } from 'node-webcrypto-ossl';
import WebCrypto from 'node-webcrypto-ossl';
import { CryptoEngine, setEngine } from 'pkijs';

const webcrypto = new Crypto();
const webcrypto = new WebCrypto();
const cryptoEngine = new CryptoEngine({
crypto: webcrypto,
name: 'nodeEngine',
Expand Down
4 changes: 2 additions & 2 deletions src/lib/crypto_wrappers/_utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as asn1js from 'asn1js';
import bufferToArray from 'buffer-to-arraybuffer';
import { Crypto } from 'node-webcrypto-ossl';
import WebCrypto from 'node-webcrypto-ossl';
import * as pkijs from 'pkijs';

import { deserializeDer, generateRandom64BitValue, getPkijsCrypto } from './_utils';

const stubWebcrypto = new Crypto();
const stubWebcrypto = new WebCrypto();

jest.mock('pkijs');

Expand Down

0 comments on commit 39b6604

Please sign in to comment.