-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove CVE-2023-46809 revert config
use node-rsa instead of RSA_PKCS1_PADDING revert #650 run test on Node.js 22
- Loading branch information
Showing
6 changed files
with
47 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,3 @@ jobs: | |
secrets: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
with: | ||
checkTest: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,6 @@ | |
"url": "[email protected]:cnpm/cnpmcore.git" | ||
}, | ||
"egg": { | ||
"revert": [ | ||
"CVE-2023-46809" | ||
], | ||
"typescript": true | ||
}, | ||
"keywords": [ | ||
|
@@ -105,6 +102,7 @@ | |
"lodash": "^4.17.21", | ||
"mime-types": "^2.1.35", | ||
"mysql2": "^3.9.4", | ||
"node-rsa": "^1.1.1", | ||
"npm-package-arg": "^10.1.0", | ||
"oss-cnpm": "^5.0.1", | ||
"p-map": "^4.0.0", | ||
|
@@ -126,6 +124,7 @@ | |
"@types/mime-types": "^2.1.1", | ||
"@types/mocha": "^10.0.1", | ||
"@types/mysql": "^2.15.21", | ||
"@types/node-rsa": "^1.1.4", | ||
"@types/npm-package-arg": "^6.1.1", | ||
"@types/semver": "^7.3.12", | ||
"@types/tar": "^6.1.4", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { strict as assert } from 'node:assert'; | ||
import { genRSAKeys, encryptRSA, decryptRSA } from '../../app/common/CryptoUtil'; | ||
|
||
describe('test/common/CryptoUtil.test.ts', () => { | ||
describe('genRSAKeys()', () => { | ||
it('should work', () => { | ||
const keys = genRSAKeys(); | ||
assert(keys.publicKey); | ||
assert(keys.privateKey); | ||
// console.log(keys); | ||
}); | ||
}); | ||
|
||
describe('encryptRSA(), decryptRSA()', () => { | ||
it('should work', () => { | ||
const keys = genRSAKeys(); | ||
// const plainText = 'hello world 中文😄'; | ||
const plainText = 'hello world 中文'; | ||
const encryptText = encryptRSA(keys.publicKey, plainText); | ||
// console.log(encryptText); | ||
assert.equal(decryptRSA(keys.privateKey, encryptText), plainText); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters