Coder Social home page Coder Social logo

Comments (19)

stenol avatar stenol commented on August 16, 2024 1

Thank you. Just let me know when it will be ready :)

from network.

luky92 avatar luky92 commented on August 16, 2024 1

the new version has a different error even on default key lenth
network.log
here is a log

from network.

Toemsel avatar Toemsel commented on August 16, 2024
  • Are the private/public keys correct for each kind?
  • Is the communication working without RSA?
  • Make sure the firewall isn't blocking the connections

Since the GitHub example doesn't throw any exception and the provided stacktrace doesn't help either, I would require a small sample project illustrating the issue.

from network.

stenol avatar stenol commented on August 16, 2024

Here is some other info:

  • The communication is working without RSA.
  • The key lenght of RSA is 512 bits (I know, it's less secure than 2048 bits but it's alright for our purpose)
  • The server is use in a windows service application.
  • The client is on a xamarin android application with android 6.0 +

I will try to make a small project that illustrate the issue. :)

from network.

Toemsel avatar Toemsel commented on August 16, 2024

An example is required to reconstruct your issue.

Did you try the RSA approach with the default RSA key size? (Just leave it empty so the overloading will take care of it)

from network.

stenol avatar stenol commented on August 16, 2024

Here is a link for a demo project. Don't forget to change ip address in Program.cs of the ClientTest project. The main solution file is in the ServerTest folder. I try with 512 and 1024 key size and the issue is there. With 2048 key size, there is no issue.

http://sjs-studio.com/temp/CrashTaskCancel.zip

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Thanks. Please stick with the 2048 key size as long as there isn't a new NuGet available. Will invest and fix within the next two weeks.

Thanks for your understanding

from network.

luky92 avatar luky92 commented on August 16, 2024

Is there any update on that? i have a simular issiue

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Sorry, not yet. I will investigate that isse as soon as possible. I will raise the priority.

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Issue has been resolved.

Improvements

  • Server and Client may choose an arbitrary key size, they can, but don't have to match.
    As an example: Only the client sends highly sensitive data and the server only acknowledges.
    Server -> Client: 512 keySize
    Client -> Server: 4096 keySize
  • Invalid key sizes (e.g.: 256) will throw an exception immediately.
  • The lib will log performance issues, if the keySize has been chosen too secure
  • Small refactorings as well

Please let me know if the release works for you. Thanks

from network.

Toemsel avatar Toemsel commented on August 16, 2024

ok, thanks for the feedback. I will take the current version down from NuGet. Just in case
Does this behavior reproduce on the example RSA project on your machine? Furthermore

  • On which OS do you use the lib
  • On which OS version
  • Does your project target .NET or .NET Core?
  • Did you update the client and server application?

Regarding your logs:

  • The UDP connection shuts down, because of the failed TCP connection. That works like intended
  • The TCP connection successfully exchanges RSA keys, then crashes. Unluckily "System.Collections.Generic.KeyNotFoundException: Dany klucz nie był obecny w słowniku." could be related to your code as well. However, I will upload a small change (to log an incoming package before invoking it's delegate) so we will be able to tell which packet causes the issue. Could you please download the src, execute your program again and reupload the exception? That would already help a lot. Thanks in advance.

from network.

luky92 avatar luky92 commented on August 16, 2024

Client Android 6.0 xamarin forms app
Server Winforms app on win 10
here is a log from the new ver
network.log
i noticed that when switching pages in the app the client reconnects now but it still crashes this dosent happen on plain text connection

from network.

Toemsel avatar Toemsel commented on August 16, 2024

The new exception log seems to be different from the first one, which is odd.
My first guess is the unsupported RSA OAE Padding on Android 6.0.
Could you please re-try the same scenario with the newest SRC commit?

In the meanwhile I will install Xamarin on my machine to reproduce your issue.

from network.

luky92 avatar luky92 commented on August 16, 2024

ok now it creates udp connection for rsa as well
here is a new log
network.log

from network.

Toemsel avatar Toemsel commented on August 16, 2024

I have setup the same environment on my machine.
Without UDP is seems to work fine. Somehow the UDP connection instantly closes after sending data over RSA. Still investigating.

from network.

luky92 avatar luky92 commented on August 16, 2024

ok seems like the firewall was to blame on the last error here is a new one
network.log

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Now we receive the exact same error :) At least something. Thanks for the report. I will let you know when it has been fixed.

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Try the code out on your device, instead within the emulator.
The RSA communication does work while it runs on a device, but will fail in the emulator.
(Might be related to: https://xamarin.github.io/bugzilla-archives/21/2162/bug.html)

Please let me know if it also works for you on the device.

from network.

Toemsel avatar Toemsel commented on August 16, 2024

Uppon further investigation the issue arrives from the Android Emulator environment.
There are several open issues on Xamarin regarding unreceivable UDP packets.

Till the issue has been fixed from Xamarin, avoid using UDP within the emulator, or simply deploy the application to your device for testing. This applies for the ClientConnectionContainer and the SecureClientConnectionContainer.

New version has been published to NuGet. (x.x.x.18)
If you encounter another issue, please open a new ticket, since the original "keySize" related one has been fixed.

Thanks for your help

Edit: Make sure to enable multicast on your router, in order to receive udp packets

from network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.