Skip to content

Commit

Permalink
fix(electron): rsa-pss keys are never supported
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Nov 16, 2021
1 parent 4db6e53 commit 188c1f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/runtime/node/node_key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const [major, minor] = process.version
.split('.')
.map((str) => parseInt(str, 10))

const rsaPssParams = major >= 17 || (major === 16 && minor >= 9)
const electron = 'electron' in process.versions
const rsaPssParams = !electron && (major >= 17 || (major === 16 && minor >= 9))

const PSS = {
padding: constants.RSA_PKCS1_PSS_PADDING,
Expand Down
2 changes: 1 addition & 1 deletion test/jws/rsa-pss.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const [major, minor] = process.version
.split('.')
.map((str) => parseInt(str, 10))

const rsaPssParams = major >= 17 || (major === 16 && minor >= 9)
const electron = 'electron' in process.versions
const rsaPssParams = !electron && (major >= 17 || (major === 16 && minor >= 9))

const { FlattenedSign, flattenedVerify } = await import('#dist')

Expand Down

0 comments on commit 188c1f7

Please sign in to comment.