@@ -19,6 +19,7 @@ struct Participant {
19
19
store : InMemSignalProtocolStore ,
20
20
message_queue : Vec < ( CiphertextMessage , Box < [ u8 ] > ) > ,
21
21
archive_count : u8 ,
22
+ pre_key_count : u32 ,
22
23
}
23
24
24
25
impl Participant {
@@ -40,7 +41,9 @@ impl Participant {
40
41
. calculate_signature ( & their_signed_pre_key_public, rng)
41
42
. unwrap ( ) ;
42
43
43
- let signed_pre_key_id: SignedPreKeyId = rng. gen_range ( 0 , 0xFF_FFFF ) . into ( ) ;
44
+ let _: SignedPreKeyId = rng. gen_range ( 0 , 0xFF_FFFF ) . into ( ) ;
45
+ them. pre_key_count += 1 ;
46
+ let signed_pre_key_id: SignedPreKeyId = them. pre_key_count . into ( ) ;
44
47
45
48
them. store
46
49
. save_signed_pre_key (
@@ -56,8 +59,11 @@ impl Participant {
56
59
. await
57
60
. unwrap ( ) ;
58
61
62
+ them. pre_key_count += 1 ;
63
+ let pre_key_id: PreKeyId = them. pre_key_count . into ( ) ;
64
+
59
65
let pre_key_info = if use_one_time_pre_key {
60
- let pre_key_id : PreKeyId = rng. gen_range ( 0 , 0xFF_FFFF ) . into ( ) ;
66
+ let _ : PreKeyId = rng. gen_range ( 0 , 0xFF_FFFF ) . into ( ) ;
61
67
let one_time_pre_key = KeyPair :: generate ( rng) ;
62
68
63
69
them. store
@@ -197,6 +203,7 @@ fuzz_target!(|data: (u64, &[u8])| {
197
203
. unwrap( ) ,
198
204
message_queue: Vec :: new( ) ,
199
205
archive_count: 0 ,
206
+ pre_key_count: 0 ,
200
207
} ;
201
208
let mut bob = Participant {
202
209
name: "bob" ,
@@ -208,6 +215,7 @@ fuzz_target!(|data: (u64, &[u8])| {
208
215
. unwrap( ) ,
209
216
message_queue: Vec :: new( ) ,
210
217
archive_count: 0 ,
218
+ pre_key_count: 0 ,
211
219
} ;
212
220
213
221
for action in actions {
0 commit comments