Make adjustments for easier CGO integration

This commit is contained in:
2026-01-21 18:35:26 -05:00
parent f82b35bc43
commit 48e084ac0f
7 changed files with 49 additions and 37 deletions
+3 -2
View File
@@ -19,8 +19,9 @@ import (
// WriteEntry writes entryData to an encrypted file at realPath.
// If the entry contains an updated password, an age file is also created.
func WriteEntry(realPath string, decSlice []string, passwordIsNew bool) error {
err := os.WriteFile(realPath, crypt.EncryptBytes([]byte(strings.Join(decSlice, "\n"))), 0600)
// Leave rcwPassword nil to use RCW demonization.
func WriteEntry(realPath string, decSlice []string, passwordIsNew bool, rcwPassword []byte) error {
err := os.WriteFile(realPath, crypt.EncryptBytes([]byte(strings.Join(decSlice, "\n")), rcwPassword), 0600)
if err != nil {
return errors.New("unable to write to file: " + err.Error())
}