File tree Expand file tree Collapse file tree 3 files changed +1
-27
lines changed
crates/matrix-sdk-crypto/src Expand file tree Collapse file tree 3 files changed +1
-27
lines changed Original file line number Diff line number Diff line change @@ -305,13 +305,6 @@ pub enum SessionCreationError {
305
305
) ]
306
306
OneTimeKeyMissing ( OwnedUserId , OwnedDeviceId ) ,
307
307
308
- /// The one-time key algorithm is unsupported.
309
- #[ error(
310
- "Tried to create a new Olm session for {0} {1}, but the one-time \
311
- key algorithm is unsupported"
312
- ) ]
313
- OneTimeKeyUnknown ( OwnedUserId , OwnedDeviceId ) ,
314
-
315
308
/// Failed to verify the one-time key signatures.
316
309
#[ error(
317
310
"Failed to verify the signature of a one-time key, key: {one_time_key:?}, \
Original file line number Diff line number Diff line change @@ -962,10 +962,6 @@ impl Account {
962
962
963
963
let result = match first_key {
964
964
OneTimeKey :: SignedKey ( key) => Ok ( PrekeyBundle :: Olm3DH { key } ) ,
965
- _ => Err ( SessionCreationError :: OneTimeKeyUnknown (
966
- device. user_id ( ) . to_owned ( ) ,
967
- device. device_id ( ) . into ( ) ,
968
- ) ) ,
969
965
} ;
970
966
971
967
trace ! ( ?result, "Finished searching for a valid pre-key bundle" ) ;
Original file line number Diff line number Diff line change @@ -103,10 +103,6 @@ impl SignedKey {
103
103
pub enum OneTimeKey {
104
104
/// A signed Curve25519 one-time key.
105
105
SignedKey ( SignedKey ) ,
106
-
107
- /// An unsigned Curve25519 one-time key.
108
- #[ serde( serialize_with = "serialize_curve_key" ) ]
109
- Key ( Curve25519PublicKey ) ,
110
106
}
111
107
112
108
impl OneTimeKey {
@@ -121,17 +117,7 @@ impl OneTimeKey {
121
117
let key: SignedKey = key. deserialize_as ( ) ?;
122
118
Ok ( OneTimeKey :: SignedKey ( key) )
123
119
}
124
- _ => match algorithm. as_str ( ) {
125
- "curve25519" => {
126
- let key: String = key. deserialize_as ( ) ?;
127
- Ok ( OneTimeKey :: Key (
128
- Curve25519PublicKey :: from_base64 ( & key) . map_err ( serde:: de:: Error :: custom) ?,
129
- ) )
130
- }
131
- _ => {
132
- Err ( serde:: de:: Error :: custom ( format ! ( "Unsupported key algorithm {algorithm}" ) ) )
133
- }
134
- } ,
120
+ _ => Err ( serde:: de:: Error :: custom ( format ! ( "Unsupported key algorithm {algorithm}" ) ) ) ,
135
121
}
136
122
}
137
123
}
@@ -141,7 +127,6 @@ impl OneTimeKey {
141
127
pub fn fallback ( & self ) -> bool {
142
128
match self {
143
129
OneTimeKey :: SignedKey ( s) => s. fallback ( ) ,
144
- OneTimeKey :: Key ( _) => false ,
145
130
}
146
131
}
147
132
}
You can’t perform that action at this time.
0 commit comments