Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 4e37f24

Browse files
Update jsrsasign dependency to address CVE-2022-25898 (#603)
Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 168fc66 commit 4e37f24

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

fabric-ca-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"types": "./types/index.d.ts",
2121
"dependencies": {
2222
"fabric-common": "file:../fabric-common",
23-
"jsrsasign": "^10.4.1",
23+
"jsrsasign": "^10.5.25",
2424
"url": "^0.11.0",
2525
"winston": "^2.4.5"
2626
},

fabric-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"elliptic": "^6.5.4",
2929
"fabric-protos": "file:../fabric-protos",
3030
"js-sha3": "^0.8.0",
31-
"jsrsasign": "^10.4.1",
31+
"jsrsasign": "^10.5.25",
3232
"nconf": "^0.12.0",
3333
"promise-settle": "^0.3.0",
3434
"sjcl": "^1.0.8",

fabric-common/test/Utils.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const testUtils = require('./TestUtils');
1212
const chai = require('chai');
1313
const chaiAsPromised = require('chai-as-promised');
1414
const sinonChai = require('sinon-chai');
15-
const tmp = require('tmp');
1615
const fs = require('fs-extra');
1716
const winston = require('winston');
17+
const os = require('os');
1818

1919
const should = chai.should();
2020
chai.use(chaiAsPromised);
@@ -210,13 +210,15 @@ describe('Utils', () => {
210210
describe('log to a file', async () => {
211211
let debugFilePath;
212212
let errorFilePath;
213-
let dir;
213+
let tmpDir;
214214

215215
before(async () => {
216216
// create a temp file
217-
dir = tmp.dirSync();
218-
debugFilePath = path.join(dir.name, 'debug.log');
219-
errorFilePath = path.join(dir.name, 'error.log');
217+
const prefix = `${os.tmpdir()}${path.sep}`;
218+
tmpDir = await fs.promises.mkdtemp(prefix);
219+
220+
debugFilePath = path.join(tmpDir, 'debug.log');
221+
errorFilePath = path.join(tmpDir, 'error.log');
220222
await fs.ensureFile(debugFilePath);
221223
await fs.ensureFile(errorFilePath);
222224
});
@@ -228,9 +230,9 @@ describe('Utils', () => {
228230
const logger = Utils.getLogger(loggerName);
229231
logger.transports.should.be.an.instanceOf(Object);
230232
logger.transports.debugfile.should.be.an.instanceOf(winston.transports.File);
231-
logger.transports.debugfile.dirname.should.equal(dir.name);
233+
logger.transports.debugfile.dirname.should.equal(tmpDir);
232234
logger.transports.errorfile.should.be.an.instanceOf(winston.transports.File);
233-
logger.transports.errorfile.dirname.should.equal(dir.name);
235+
logger.transports.errorfile.dirname.should.equal(tmpDir);
234236

235237
// Log to the file
236238
logger.error('Test logger - error');
@@ -261,7 +263,7 @@ describe('Utils', () => {
261263

262264
after(async () => {
263265
// Remove tmp dir
264-
await fs.remove(dir.name);
266+
await fs.remove(tmpDir);
265267
});
266268

267269
});

fabric-network/test/testutils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as os from 'os';
1111
import * as path from 'path';
1212
import * as util from 'util';
1313

14-
import _rimraf = require('rimraf');
14+
import _rimraf from 'rimraf';
1515
const rimraf = util.promisify(_rimraf);
1616

1717
/**
@@ -89,7 +89,7 @@ export function newEndorsementResponse(response: protos.IResponse, properties: P
8989
},
9090
payload: Buffer.from(payload),
9191
response: {
92-
message: response.message,
92+
message: response.message ?? '',
9393
payload: Buffer.alloc(0),
9494
status: response.status ?? 200,
9595
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"fabric-protos": "file:./fabric-protos",
6868
"ink-docstrap": "^1.3.2",
6969
"jsdoc": "^3.6.6",
70-
"jsrsasign": "^10.4.1",
71-
"mocha": "^8.4.0",
70+
"jsrsasign": "^10.5.25",
71+
"mocha": "^9.2.2",
7272
"nano": "^10.0.0",
7373
"npm-run-all": "^4.1.5",
7474
"nyc": "^15.0.0",

0 commit comments

Comments
 (0)