mirror of
https://github.com/ddworken/hishtory.git
synced 2025-03-16 08:18:16 +01:00
Add additional error checking that should never trigger
This commit is contained in:
parent
4d2b02e2c3
commit
30b5478104
@ -154,6 +154,9 @@ func DecryptHistoryEntry(userSecret string, entry shared.EncHistoryEntry) (Histo
|
||||
if err != nil {
|
||||
return HistoryEntry{}, nil
|
||||
}
|
||||
if decryptedEntry.EntryId != "" && entry.EncryptedId != "" && decryptedEntry.EntryId != entry.EncryptedId {
|
||||
return HistoryEntry{}, fmt.Errorf("rejecting encrypted history entry that contains mismatching IDs (outer=%s inner=%s)", entry.EncryptedId, decryptedEntry.EntryId)
|
||||
}
|
||||
return decryptedEntry, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user