Skip to content

Commit

Permalink
Don't clear keys on "invalid signed prekey identifier"
Browse files Browse the repository at this point in the history
  • Loading branch information
smweber committed Mar 8, 2024
1 parent 1fb0c95 commit ecc78fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/signalmeow/receiving.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ func (cli *Client) checkDecryptionErrorAndDisconnect(ctx context.Context, err er
return
}
log := zerolog.Ctx(ctx).With().Str("action", "check decryption error and disconnect").Logger()
if strings.Contains(err.Error(), "30: invalid PreKey message: decryption failed") ||
strings.Contains(err.Error(), "70: invalid signed prekey identifier") {
if strings.Contains(err.Error(), "70: invalid signed prekey identifier") {
log.Warn().Msg("Failed decrypting a SignedPreKey message, invalid signed prekey identifier")
}
if strings.Contains(err.Error(), "30: invalid PreKey message: decryption failed") {
log.Warn().Msg("Failed decrypting a PreKey message, probably our prekeys are broken, force re-registration")
disconnectErr := cli.ClearKeysAndDisconnect(ctx)
if disconnectErr != nil {
Expand Down

0 comments on commit ecc78fa

Please sign in to comment.