* Change keyring unlock functionalities * Add keyring#Lock, keyring#CheckIntegrity, tests * Update helpers, fix bugs * Update go.mod with ProtonMail/crypto commit * Change key management system * Clear keys from memory + tests * Create SessionKey with direct encryption for datapackets. Move symmetrickey to password. * Fix upstream dependencies * Update module to V2, documentation * Add linter * Add v2 folder to .gitignore * Minor changes to KeyID getters * Remove old changelog * Improve docs, remove compilation script
28 lines
588 B
Go
28 lines
588 B
Go
package helper
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"strings"
|
|
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
|
)
|
|
|
|
const testTime = 1557754627 // 2019-05-13T13:37:07+00:00
|
|
|
|
func readTestFile(name string, trimNewlines bool) string {
|
|
data, err := ioutil.ReadFile("../crypto/testdata/" + name) //nolint
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if trimNewlines {
|
|
return strings.TrimRight(string(data), "\n")
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
// Corresponding key in ../crypto/testdata/keyring_privateKey
|
|
var testMailboxPassword = []byte("apple")
|
|
|
|
func init() {
|
|
crypto.UpdateTime(testTime) // 2019-05-13T13:37:07+00:00
|
|
}
|