events: Add support for MSC3783 in the key verification events
This commit is contained in:
		
							parent
							
								
									05356d7d4e
								
							
						
					
					
						commit
						6d133971b0
					
				| @ -42,6 +42,7 @@ unstable-msc3551 = ["unstable-msc1767"] | ||||
| unstable-msc3552 = ["unstable-msc3551"] | ||||
| unstable-msc3553 = ["unstable-msc3552"] | ||||
| unstable-msc3554 = ["unstable-msc1767"] | ||||
| unstable-msc3783 = [] | ||||
| unstable-pdu = [] | ||||
| unstable-sanitize = ["dep:html5ever", "dep:phf"] | ||||
| unstable-unspecified = [] | ||||
|  | ||||
| @ -58,6 +58,11 @@ pub enum MessageAuthenticationCode { | ||||
|     /// The HKDF-HMAC-SHA256 MAC.
 | ||||
|     HkdfHmacSha256, | ||||
| 
 | ||||
|     /// The second version of the HKDF-HMAC-SHA256 MAC.
 | ||||
|     #[cfg(feature = "unstable-msc3783")] | ||||
|     #[ruma_enum(rename = "org.matrix.msc3783.hkdf-hmac-sha256")] | ||||
|     HkdfHmacSha256V2, | ||||
| 
 | ||||
|     /// The HMAC-SHA256 MAC.
 | ||||
|     HmacSha256, | ||||
| 
 | ||||
| @ -158,4 +163,15 @@ mod tests { | ||||
|         assert_eq!(serialized, "\"hmac-sha256\""); | ||||
|         assert_eq!(deserialized, MessageAuthenticationCode::HmacSha256); | ||||
|     } | ||||
| 
 | ||||
|     #[test] | ||||
|     #[cfg(feature = "unstable-msc3783")] | ||||
|     fn serialize_mac_method_msc3783() { | ||||
|         let serialized = | ||||
|             serde_json::to_string(&MessageAuthenticationCode::HkdfHmacSha256V2).unwrap(); | ||||
|         let deserialized: MessageAuthenticationCode = serde_json::from_str(&serialized).unwrap(); | ||||
| 
 | ||||
|         assert_eq!(serialized, "\"org.matrix.msc3783.hkdf-hmac-sha256\""); | ||||
|         assert_eq!(deserialized, MessageAuthenticationCode::HkdfHmacSha256V2); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -150,6 +150,7 @@ unstable-msc3554 = ["ruma-common/unstable-msc3554"] | ||||
| unstable-msc3575 = ["ruma-client-api?/unstable-msc3575"] | ||||
| unstable-msc3618 = ["ruma-federation-api?/unstable-msc3618"] | ||||
| unstable-msc3723 = ["ruma-federation-api?/unstable-msc3723"] | ||||
| unstable-msc3783 = ["ruma-common/unstable-msc3783"] | ||||
| unstable-pdu = ["ruma-common/unstable-pdu"] | ||||
| unstable-sanitize = ["ruma-common/unstable-sanitize"] | ||||
| unstable-unspecified = [ | ||||
| @ -185,6 +186,7 @@ __ci = [ | ||||
|     "unstable-msc3575", | ||||
|     "unstable-msc3618", | ||||
|     "unstable-msc3723", | ||||
|     "unstable-msc3783", | ||||
| ] | ||||
| 
 | ||||
| [dependencies] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user