mirror of https://github.com/writeas/writefreely
A focused writing and publishing space.
https://write.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
404 B
26 lines
404 B
package writefreely
|
|
|
|
import (
|
|
"io/ioutil"
|
|
)
|
|
|
|
type keychain struct {
|
|
cookieAuthKey, cookieKey []byte
|
|
}
|
|
|
|
func initKeys(app *app) error {
|
|
var err error
|
|
app.keys = &keychain{}
|
|
|
|
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
|
|
}
|
|
|