Use fast.bin for fast cache file

So it's clear that this is no clear text file and it is not supposed to
be edited by the user.
This commit is contained in:
Martin Dosch 2024-04-10 15:50:58 +02:00
parent 61f5ab705d
commit 79897fd295
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

View File

@ -62,9 +62,9 @@ func getFastData(jid string, password string) (xmpp.Fast, error) {
var fast xmpp.Fast
fastPath, err := getDataPath(folder)
if err != nil {
return xmpp.Fast{}, fmt.Errorf("getFastData: failed to read fast cache file: %w", err)
return xmpp.Fast{}, fmt.Errorf("getFastData: failed to read fast cache folder: %w", err)
}
fastFileLoc := fastPath + "fast"
fastFileLoc := fastPath + "fast.bin"
buf, err := readFile(fastFileLoc)
if err != nil {
return xmpp.Fast{}, fmt.Errorf("getFastData: failed to read fast cache file: %w", err)
@ -106,7 +106,7 @@ func writeFastData(jid string, password string, fast xmpp.Fast) error {
if err != nil {
return fmt.Errorf("writeFastData: failed to write fast cache file: %w", err)
}
fastFileLoc := fastPath + "fast"
fastFileLoc := fastPath + "fast.bin"
salt := make([]byte, 32)
key, err := scrypt.Key([]byte(password), salt, 32768, 8, 1, 32)
if err != nil {