mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
31 lines
511 B
Go
31 lines
511 B
Go
package writefreely
|
|
|
|
import (
|
|
"io/ioutil"
|
|
)
|
|
|
|
type keychain struct {
|
|
emailKey, cookieAuthKey, cookieKey []byte
|
|
}
|
|
|
|
func initKeys(app *app) error {
|
|
var err error
|
|
app.keys = &keychain{}
|
|
|
|
app.keys.emailKey, err = ioutil.ReadFile("keys/email.aes256")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
app.keys.cookieAuthKey, err = ioutil.ReadFile("keys/cookies_auth.aes256")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
app.keys.cookieKey, err = ioutil.ReadFile("keys/cookies_enc.aes256")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|