WhiskeySockets / BaileysCSharp

Lightweight full-featured C# WhatsApp Web API
71 stars 25 forks source link

Lib signal #41

Open shargon opened 1 week ago

shargon commented 1 week ago

Hi what is the original repository of libsignal that you use? I want to check if it's update because i have troubles with the encryption

donaldjansen commented 1 week ago

It was not from a repo, all repo's that I found initially had issues, so I wrote one from scratch. I haven't had any issues but tbh I have been off the project for about 6 weeks, work kept me busy so anything could have changed between then and now. What issues are you experiencing ?

shargon commented 1 week ago

This one in particular, with some phones i get this exception during time https://github.com/WhiskeySockets/BaileysCSharp/issues/40

luidiva commented 1 week ago

Hey guys, how are you doing? Is this project production ready? I tested and faced some disconnections. Is there a list with all features and issues? Thank you!

donaldjansen commented 1 week ago

Hey guys, how are you doing? Is this project production ready? I tested and faced some disconnections. Is there a list with all features and issues? Thank you!

I wouldn't say it is production ready, there are a few features still to be implemented, however I have a number that has been running stable for 4 months now on it

donaldjansen commented 1 week ago

Hey guys, how are you doing? Is this project production ready? I tested and faced some disconnections. Is there a list with all features and issues? Thank you!

Do you perhaps have any steps I can do to replicate this ?

luidiva commented 6 days ago

Hey guys, how are you doing? Is this project production ready? I tested and faced some disconnections. Is there a list with all features and issues? Thank you!

Do you perhaps have any steps I can do to replicate this ?

I just cloned the repo, started from vs2022 and read qr code. After about 4~5 hours console stopped updating and I got a handshake error in diagnostic events. I am going to test it again.

luidiva commented 6 days ago

After about 5 hours connected error occurred again again:

{"The remote party closed the WebSocket connection without completing the close handshake."}

em System.Net.WebSockets.ManagedWebSocket.ThrowEOFUnexpected() em System.Net.WebSockets.ManagedWebSocket.d75.MoveNext() em System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) em System.Net.WebSockets.ManagedWebSocket.d641.MoveNext() em System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) em System.Threading.Tasks.ValueTask1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- Fim do rastreamento de pilha do local anterior --- em BaileysCSharp.Core.Sockets.Client.WebSocketClient.d5.MoveNext() em C:\Users\Luidi\Downloads\BaileysCSharp-main\BaileysCSharp-main\BaileysCSharp\Core\Sockets\Client\WebSocketClient.cs:linha 66 em BaileysCSharp.Core.Sockets.Client.WebSocketClient.d4.MoveNext() em C:\Users\Luidi\Downloads\BaileysCSharp-main\BaileysCSharp-main\BaileysCSharp\Core\Sockets\Client\WebSocketClient.cs:linha 39

luidiva commented 5 days ago

Just let it connected. After 6 hours I got this error:

image

donaldjansen commented 5 days ago

Ok this doesn't seem to be coming from the Lib signal, it looks like the keys are getting out of sync. I am investigating it

shargon commented 5 days ago

I received this error in noise handler when server send regular_row message, only it happens in one iphone:

System.Security.Cryptography.AuthenticationTagMismatchException: The computed authentication tag did not match the input authentication tag.\r\n at System.Security.Cryptography.AeadCommon.Decrypt(SafeKeyHandle keyHandle, ReadOnlySpan1 nonce, ReadOnlySpan1 associatedData, ReadOnlySpan1 ciphertext, ReadOnlySpan1 tag, Span1 plaintext, Boolean clearPlaintextOnFailure)\r\n at System.Security.Cryptography.AesGcm.Decrypt(ReadOnlySpan1 nonce, ReadOnlySpan1 ciphertext, ReadOnlySpan1 tag, Span1 plaintext, ReadOnlySpan1 associatedData)\r\n at BaileysCSharp.Core.Helper.CryptoUtils.DecryptAESGCM(Span`1 ciphertext, Byte[] encKey, Byte[] iv, Byte[] hash) in BaileysCSharp\Core\Helper\EncryptionHelper.cs:line 121\r\n at BaileysCSharp.Core.Utils.NoiseHandler.Decrypt(Byte[] ciphertext) in BaileysCSharp\Core\Utils\NoiseHandler.cs:line 81\r\n at BaileysCSharp.Core.Utils.NoiseHandler.DecodeFrameNew(Byte[] newData) in BaileysCSharp\Core\Utils\NoiseHandler.cs:line 184