vwxyzjn / portwarden

Create Encrypted Backups of Your Bitwarden Vault with Attachments
MIT License
587 stars 33 forks source link

DeriveKey() function uses undeclared variable "Salt" #47

Open maxweisspoker opened 3 months ago

maxweisspoker commented 3 months ago

From the looks of it, the data variable passed into the first argument for EncryptBytes() and DecryptBytes() in encryption.go is in fact the passphrase, and the second argument "passphrase" is intended to be the Salt. That is confusing enough, but the DeriveKey() function is outright broken because it wants to use "Salt" which is not defined.

I have a PR which defines Salt in the "portwarden" namespace as the env var Salt, although I don't know if that's really how you want that function to work. Regardless, defining Salt as such clears away the errors and allows the program to compile.