You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When encrypting a message the framework invokes its delegate stores in order to do some processing. This is done when invoking encrypt(_:) on a SessionCipher. In order to create a SessionCipher a remoteAddress is needed. Lets say we create the remoteAddress with let remoteAddress = SignalAddress(name: userId.description, deviceId: 1). Now when checking the values the remoteAddress contains (name + deviceId) I get the following correct values: userId = "1" and deviceId = 1.
Then something weird happens when encrypt(_:) is invoked. The first method that is invoked by the framework is loadSession(for:) - SessionStore. The loadSession(for:) method gets the remoteAddress as a parameter.
Now checking the values of the remoteAddress the method did receive the deviceId equals 1, but the name does not equal. Instead of getting "1" I get this: "1\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}Hrkt\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}U\u{ef}\u{ef}\u{ef}ݺ\u{ef}i"
Every time when encrypt(_:) is invoked the name of the address changes. But the string always starts with the original name (here "1").
I wrote some unit tests and when running non of them show this issue. This only happens on actually running the application on device or on simulator.
Here a picture of the original address that was handed over to the session cipher object:
And here the same address, that was handed over to the store delegates:
The text was updated successfully, but these errors were encountered:
When encrypting a message the framework invokes its delegate stores in order to do some processing. This is done when invoking
encrypt(_:)
on a SessionCipher. In order to create a SessionCipher aremoteAddress
is needed. Lets say we create the remoteAddress with let remoteAddress = SignalAddress(name: userId.description, deviceId: 1). Now when checking the values the remoteAddress contains (name + deviceId) I get the following correct values: userId = "1" and deviceId = 1.Then something weird happens when
encrypt(_:)
is invoked. The first method that is invoked by the framework isloadSession(for:)
- SessionStore. TheloadSession(for:)
method gets the remoteAddress as a parameter.Now checking the values of the remoteAddress the method did receive the deviceId equals 1, but the name does not equal. Instead of getting "1" I get this: "1\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}Hrkt\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}\u{ef}U\u{ef}\u{ef}\u{ef}ݺ\u{ef}i"
Every time when
encrypt(_:)
is invoked the name of the address changes. But the string always starts with the original name (here "1").I wrote some unit tests and when running non of them show this issue. This only happens on actually running the application on device or on simulator.
Here a picture of the original address that was handed over to the session cipher object:
And here the same address, that was handed over to the store delegates:
The text was updated successfully, but these errors were encountered: