Openpgp security update (V2) (#31)

* 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
This commit is contained in:
wussler 2019-12-27 19:35:43 +01:00 committed by GitHub
parent 136c0a5495
commit 54f45d0471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 2588 additions and 1770 deletions

View file

@ -3,12 +3,14 @@ package helper
import (
"io/ioutil"
"strings"
"github.com/ProtonMail/gopenpgp/v2/crypto"
)
var err error
const testTime = 1557754627 // 2019-05-13T13:37:07+00:00
func readTestFile(name string, trimNewlines bool) string {
data, err := ioutil.ReadFile("../crypto/testdata/" + name)
data, err := ioutil.ReadFile("../crypto/testdata/" + name) //nolint
if err != nil {
panic(err)
}
@ -19,4 +21,8 @@ func readTestFile(name string, trimNewlines bool) string {
}
// Corresponding key in ../crypto/testdata/keyring_privateKey
const testMailboxPassword = "apple"
var testMailboxPassword = []byte("apple")
func init() {
crypto.UpdateTime(testTime) // 2019-05-13T13:37:07+00:00
}