Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
I think this fixes the prekey null pointer problem
Browse files Browse the repository at this point in the history
Well enough anyway. When the old prekeyDecrypt fails due to null
pointer, fall through to sealedSenderDecrypt, which usually seems to be
able to decrypt it fine
  • Loading branch information
smweber committed Jul 26, 2023
1 parent 099a58a commit b0bd6e8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/signalmeow/receiving.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ func incomingRequestHandlerWithDevice(device *Device) web.RequestHandlerFunc {
result, err = prekeyDecrypt(*senderAddress, usmcContents, device, ctx)
if err != nil {
if strings.Contains(err.Error(), "null pointer") {
// TODO: actually fix this, but ignoring for now because they just build up without a 200
responseCode = 200
log.Printf("sealed sender prekey decrypt null pointer error, ignoring")
// Make sure we don't set responseCode to 200 if we got a null pointer error,
// since we want to fallback to sealedSenderDecrypt in this case
log.Printf("sealed sender prekey decrypt null pointer error: %v", err)
} else {
log.Printf("prekeyDecrypt error: %v", err)
}
Expand Down Expand Up @@ -199,9 +199,7 @@ func incomingRequestHandlerWithDevice(device *Device) web.RequestHandlerFunc {
result, err := prekeyDecrypt(*sender, envelope.Content, device, ctx)
if err != nil {
if strings.Contains(err.Error(), "null pointer") {
// TODO: actually fix this, but ignoring for now because they just build up without a 200
responseCode = 200
log.Printf("prekey decrypt null pointer error, ignoring")
log.Printf("prekey decrypt null pointer error: %v", err)
} else {
log.Printf("prekeyDecrypt error: %v", err)
}
Expand Down

0 comments on commit b0bd6e8

Please sign in to comment.