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:
parent
136c0a5495
commit
54f45d0471
46 changed files with 2588 additions and 1770 deletions
|
|
@ -1,8 +1,8 @@
|
|||
package crypto
|
||||
|
||||
import (
|
||||
"time"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
// UpdateTime updates cached time
|
||||
|
|
@ -31,7 +31,7 @@ func getNow() time.Time {
|
|||
return time.Now()
|
||||
}
|
||||
|
||||
return time.Unix(pgp.latestServerTime + extrapolate, 0)
|
||||
return time.Unix(pgp.latestServerTime+extrapolate, 0)
|
||||
}
|
||||
|
||||
func getDiff() (int64, error) {
|
||||
|
|
@ -40,12 +40,10 @@ func getDiff() (int64, error) {
|
|||
return int64(time.Since(pgp.latestClientTime).Seconds()), nil
|
||||
}
|
||||
|
||||
return 0, errors.New("Latest server time not available")
|
||||
return 0, errors.New("gopenpgp: latest server time not available")
|
||||
}
|
||||
|
||||
// getTimeGenerator Returns a time generator function
|
||||
func getTimeGenerator() func() time.Time {
|
||||
return func() time.Time {
|
||||
return getNow()
|
||||
}
|
||||
return getNow
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue