File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,7 @@ void FrameCryptorTransformer::decryptFrame(
534
534
return ;
535
535
}
536
536
537
- if (last_dec_error_ == kDecryptionFailed && !key_handler->have_valid_key ) {
537
+ if (last_dec_error_ == kDecryptionFailed && !key_handler->has_valid_key ) {
538
538
// if decryption failed and we have an invalid key,
539
539
// please try to decrypt with the next new key
540
540
return ;
@@ -584,6 +584,7 @@ void FrameCryptorTransformer::decryptFrame(
584
584
decryption_success = true ;
585
585
// success, so we set the new key
586
586
key_handler->SetKeyFromMaterial (new_material, key_index);
587
+ key_handler->has_valid_key = true ;
587
588
if (last_dec_error_ != FrameCryptionState::kKeyRatcheted ) {
588
589
last_dec_error_ = FrameCryptionState::kKeyRatcheted ;
589
590
if (observer_)
@@ -612,7 +613,7 @@ void FrameCryptorTransformer::decryptFrame(
612
613
if (!decryption_success) {
613
614
if (last_dec_error_ != FrameCryptionState::kDecryptionFailed ) {
614
615
last_dec_error_ = FrameCryptionState::kDecryptionFailed ;
615
- key_handler->have_valid_key = false ;
616
+ key_handler->has_valid_key = false ;
616
617
if (observer_)
617
618
observer_->OnFrameCryptionStateChanged (participant_id_,
618
619
last_dec_error_);
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ class ParticipantKeyHandler {
102
102
}
103
103
SetKeyFromMaterial (new_material,
104
104
key_index != -1 ? key_index : current_key_index_);
105
+ has_valid_key = true ;
105
106
return new_material;
106
107
}
107
108
@@ -113,7 +114,7 @@ class ParticipantKeyHandler {
113
114
virtual void SetKey (std::vector<uint8_t > password, int key_index) {
114
115
webrtc::MutexLock lock (&mutex_);
115
116
SetKeyFromMaterial (password, key_index);
116
- have_valid_key = true ;
117
+ has_valid_key = true ;
117
118
}
118
119
119
120
std::vector<uint8_t > RatchetKeyMaterial (
@@ -145,8 +146,8 @@ class ParticipantKeyHandler {
145
146
crypto_key_ring_[current_key_index_] =
146
147
DeriveKeys (password, key_provider_->options ().ratchet_salt , 128 );
147
148
}
148
- protected:
149
- bool have_valid_key = false ;
149
+ protected:
150
+ bool has_valid_key = false ;
150
151
private:
151
152
mutable webrtc::Mutex mutex_;
152
153
int current_key_index_ = 0 ;
You can’t perform that action at this time.
0 commit comments