Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NodeJS PKCS12 example for NodeJS v18 #368

Open
microshine opened this issue Nov 29, 2022 · 0 comments
Open

Fix NodeJS PKCS12 example for NodeJS v18 #368

microshine opened this issue Nov 29, 2022 · 0 comments

Comments

@microshine
Copy link
Contributor

These tests don't work on NodeJS v18

  1) Node.js PKCS#12 Example
       Parse Windows-like PKCS#12 data
         Windows RC2:
     Error: error:0308010C:digital envelope routines::unsupported
      at Decipheriv.createCipherBase (node:internal/crypto/cipher:116:19)
      at Decipheriv.createCipherWithIV (node:internal/crypto/cipher:135:3)
      at new Decipheriv (node:internal/crypto/cipher:289:3)
      at Object.createDecipheriv (node:crypto:149:10)
      at Object.decryptUsingPBKDF1Password (examples/NodePKCS12Example/NodeEngineNodeSpecific.ts:381:25)
      at NodeEngine.decryptEncryptedContentInfo (examples/NodePKCS12Example/NodeEngine.ts:433:33)
      at EncryptedData.decrypt (src/EncryptedData.ts:129:43)
      at AuthenticatedSafe.parseInternalValues (src/AuthenticatedSafe.ts:47:62)
      at parsePKCS12 (test/nodePKCS12Example.spec.ts:196:46)
      at async Context.<anonymous> (test/nodePKCS12Example.spec.ts:252:7)

  2) Node.js PKCS#12 Example
       X.509 Certificate
         RC2-40-CBC algorithm:
     Error: error:0308010C:digital envelope routines::unsupported
      at Cipheriv.createCipherBase (node:internal/crypto/cipher:116:19)
      at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:135:3)
      at new Cipheriv (node:internal/crypto/cipher:243:3)
      at Object.createCipheriv (node:crypto:141:10)
      at Object.encryptUsingPBKDF1Password (examples/NodePKCS12Example/NodeEngineNodeSpecific.ts:328:25)
      at NodeEngine.encryptEncryptedContentInfo (examples/NodePKCS12Example/NodeEngine.ts:316:57)
      at EncryptedData.encrypt (src/EncryptedData.ts:113:6)
      at PKCS8ShroudedKeyBag.makeInternalValues (src/PKCS8ShroudedKeyBag.ts:76:44)
      at pkcs12Like (test/nodePKCS12Example.spec.ts:145:101)
      at windowsLike (test/nodePKCS12Example.spec.ts:176:10)
      at Context.<anonymous> (test/nodePKCS12Example.spec.ts:273:31)
      at processImmediate (node:internal/timers:471:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant