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

Error: Invalid key length - Apple Calendar Integration #1585

Closed
davidwuest opened this issue Jan 21, 2022 · 7 comments
Closed

Error: Invalid key length - Apple Calendar Integration #1585

davidwuest opened this issue Jan 21, 2022 · 7 comments
Labels
🐛 bug Something isn't working

Comments

@davidwuest
Copy link

When trying to add the apple calendar I get the following error. Any ideas?
Error: Invalid key length
at Cipheriv.createCipherBase (internal/crypto/cipher.js:103:19)
at Cipheriv.createCipherWithIV (internal/crypto/cipher.js:121:20)
at new Cipheriv (internal/crypto/cipher.js:227:22)
at Object.createCipheriv (crypto.js:124:10)
at symmetricEncrypt (/app/.next/server/chunks/1027.js:29:66)
at handler (/app/.next/server/pages/api/integrations/apple/add.js:145:88)
at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils.js:102:9)
at async Server.handleApiRequest (/app/node_modules/next/dist/server/next-server.js:1064:9)
at async Object.fn (/app/node_modules/next/dist/server/next-server.js:951:37)
at async Router.execute (/app/node_modules/next/dist/server/router.js:222:32)

@davidwuest davidwuest added the 🐛 bug Something isn't working label Jan 21, 2022
@Dax911
Copy link

Dax911 commented Jan 22, 2022

Yes I have the same error.

@davidwuest
Copy link
Author

@Dax911 thank you for your feedback. Just trying to narrow it down. I'm currently using a self signed certificate, since I'm on a test server. Are you using a self-signed or trusted certificate?

@milospuac
Copy link
Contributor

Hey David! Thanks for sending this to us. Our calendar is working on the Apple Calendar integration issues, and I'll give you an update once sorted.

@7d916724
Copy link

@davidwuest - can you confirm that the CALENDSO_ENCRYPTION_KEY environment variable is defined? I was able to recreate this error by leaving that env variable empty.

You can see here that the code expects process.env.CALENDSO_ENCRYPTION_KEY to not be null.

@davidwuest
Copy link
Author

@7d916724 - I had the CALENDSO_ENCRYPTION_KEY environment variable defined, but not in the correct length. Regenerated and it worked. Thanks for pointing it out.

@ankit-io
Copy link

Hi @davidwuest, what is the correct length?

@davidwuest
Copy link
Author

Hi @davidwuest, what is the correct length?

Just do dd if=/dev/urandom bs=1K count=1 | md5sum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants