Add some comments and other changes to crypto stuff

This commit is contained in:
Tulir Asokan 2020-06-23 21:42:33 +03:00
commit ea5cf3ee5e
12 changed files with 194 additions and 42 deletions

View file

@ -120,3 +120,22 @@ type RequestedKeyInfo struct {
SenderKey id.SenderKey `json:"sender_key"`
SessionID id.SessionID `json:"session_id"`
}
type RoomKeyWithheldCode string
const (
RoomKeyWithheldBlacklisted RoomKeyWithheldCode = "m.blacklisted"
RoomKeyWithheldUnverified RoomKeyWithheldCode = "m.unverified"
RoomKeyWithheldUnauthorized RoomKeyWithheldCode = "m.unauthorized"
RoomKeyWithheldUnavailable RoomKeyWithheldCode = "m.unavailable"
RoomKeyWithheldNoOlmSession RoomKeyWithheldCode = "m.no_olm"
)
type RoomKeyWithheldEventContent struct {
RoomID id.RoomID `json:"room_id,omitempty"`
Algorithm id.Algorithm `json:"algorithm"`
SessionID id.SessionID `json:"session_id,omitempty"`
SenderKey id.SenderKey `json:"sender_key"`
Code RoomKeyWithheldCode `json:"code"`
Reason string `json:"reason,omitempty"`
}