mirror of
https://github.com/restic/restic.git
synced 2026-04-04 20:28:52 +00:00
Check timestamps for files
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"github.com/fd0/khepri/backend"
|
||||
)
|
||||
|
||||
var ErrWrongData = errors.New("wrong data decrypt, checksum does not match")
|
||||
|
||||
type ContentHandler struct {
|
||||
be backend.Server
|
||||
key *Key
|
||||
@@ -173,6 +175,11 @@ func (ch *ContentHandler) Load(t backend.Type, id backend.ID) ([]byte, error) {
|
||||
return nil, errors.New("Invalid length")
|
||||
}
|
||||
|
||||
// check SHA256 sum
|
||||
if !id.Equal(backend.Hash(buf)) {
|
||||
return nil, ErrWrongData
|
||||
}
|
||||
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user