Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Push] push::crypto - base64 failed for target:dh; InvalidLength #3364

Closed
jonalmeida opened this issue Jul 16, 2020 · 5 comments
Closed

[Push] push::crypto - base64 failed for target:dh; InvalidLength #3364

jonalmeida opened this issue Jul 16, 2020 · 5 comments

Comments

@jonalmeida
Copy link
Collaborator

jonalmeida commented Jul 16, 2020

We're seeing a large portion of these errors being reported and it's unclear to me what the cause is as we're passing the message from FCM to the native layer where it fails.

If this is expected behaviour, maybe this shouldn't be forwarded to the crash reporter?

mozilla.components.support.rustlog.RustErrorException: push::crypto - base64 failed for target:dh; InvalidLength
    at mozilla.components.support.rustlog.CrashReporterOnLog.invoke(RustLog.kt:11)
    at mozilla.appservices.rustlog.RawLogCallbackImpl.invoke(RustLogAdapter.kt:3)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:11)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:1)
    at com.sun.jna.Native.invokePointer(Native.java)
    at com.sun.jna.Function.invokePointer(Function.java:1)
    at com.sun.jna.Function.invoke(Function.java:60)
    at com.sun.jna.Function.invoke(Function.java:22)
    at com.sun.jna.Library$Handler.invoke(Library.java:27)
    at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
    at $Proxy5.push_decrypt
    at mozilla.appservices.push.PushManager.decrypt(PushManager.kt:5)
    at mozilla.components.feature.push.RustPushConnection.decryptMessage(Connection.kt:5)
    at mozilla.components.feature.push.AutoPushFeature$onMessageReceived$$inlined$ifInitialized$lambda$1.invokeSuspend(AutoPushFeature.kt:12)
    at mozilla.components.feature.push.AutoPushFeature$onMessageReceived$$inlined$ifInitialized$lambda$1.invoke
    at mozilla.components.feature.push.ext.CoroutineScopeKt$launchAndTry$2.invokeSuspend(CoroutineScope.kt:5)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:3)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:21)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)

Sentry links:

┆Issue is synchronized with this Jira Task
┆Sprint: Backlog

@jonalmeida
Copy link
Collaborator Author

cc: @jrconlin

@jrconlin
Copy link
Contributor

These appear to start around Jun 30. There was no change to the push servers at that time. Do we know if the body is empty for these? If so, that may cause the error we're seeing.

@jonalmeida
Copy link
Collaborator Author

@jrconlin these showed up recently because we started to forward the errors to the crash reporter which we were not doing before.

@rfk
Copy link
Contributor

rfk commented Jul 20, 2020

I managed to reproduce this exact error message by attempting to decode a dh value surrounded by double-quotes, like dh=\"BMOebOMWSRisAhWpRK9ZPszJC8BL9MiWvLZBoBU6pG6Kh6vUFSW4BHFMh0b83xCg3_7IgfQZXwmVuyu27vwiv5c\". I have high confidence that the issue here is the same as #3365, it's just manifesting differently because the quoted string has an invalid length, and thus the base64-decoder bails out before it even tries to decode the first (invalid) character.

@jdragojevic
Copy link
Contributor

@jonalmeida - the sentry errors referenced in this issue appear to have stopped with the push server deploy yesterday afternoon. I'll leave this for you to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants