HavenDV / H.Pipes

A simple, easy to use, strongly-typed, async wrapper around .NET named pipes.
MIT License
219 stars 26 forks source link

Dependencies Inferno on will fail if not on windows and on supported .net versions #15

Open PeterPann23 opened 2 years ago

PeterPann23 commented 2 years ago

Inferno the recommendation to use H.Formatters.Inferno will fail as the method of encryption is deprecated.

HavenDV commented 2 years ago

I don't know much about cryptography, please check these links. I would also appreciate @zbalkan if he comments on this. https://github.com/HavenDV/H.Pipes/issues/1 https://github.com/HavenDV/H.Pipes/pull/11 https://github.com/HavenDV/H.Pipes/pull/12

zbalkan commented 2 years ago

I cloned the solution in a new computer and it did not build at all. The dependencies problem is something and more general. I'll investigate it. I have dotnet 5.0 and 6,0 installed and got the errors. Now trying to install the latest 4.x use in projects. It is 4.7.2 in Ceras and the others are previous versions.

HavenDV commented 2 years ago

The project uses .Net 4.5.1 as the minimum supported framework, it needs to be installed explicitly (VS2022 does not install it automatically)

PeterPann23 commented 2 years ago

Neither do the installed client machines

From: Konstantin S. @.> Sent: Friday, 11 March 2022 11:36 To: HavenDV/H.Pipes @.> Cc: Walter Verhoeven @.>; Author @.> Subject: Re: [HavenDV/H.Pipes] Dependencies Inferno on will fail if not on windows and on supported .net versions (Issue #15)

The project uses .Net 4.5.1 as the minimum supported framework, it needs to be installed explicitly (VS2022 does not install it automatically)

— Reply to this email directly, view it on GitHubhttps://github.com/HavenDV/H.Pipes/issues/15#issuecomment-1064987378, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKSYBNWRZ2T6RHCA4RBPN5LU7MO2FANCNFSM5QO56YAQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.**@.>>

HavenDV commented 2 years ago

Neither do the installed client machines

Sorry this was only addressed to @zbalkan . This does not apply to those who use the library.

zbalkan commented 2 years ago

Ok, @PeterPann23 , can you please detail the issue you posted?

PeterPann23 commented 2 years ago

the NuGet package compiles, the distributed application will not... depending on the client machines config, also you close the connection on errors without saying why, perhaps have a look at the [SupportedOSPlatform("windows")]

HavenDV commented 2 years ago

also you close the connection on errors without saying why

For now, exceptions will be shown via: https://github.com/HavenDV/H.Pipes/blob/f2f2b4464656862389da97f494d8e96724282eda/src/libs/H.Formatters.Inferno/PipeServerExtensions.cs#L49 I can add a callback that will return exceptions.

HavenDV commented 2 years ago

I added the possibility of additional exception handling when calling EnableEncryption: https://github.com/HavenDV/H.Pipes/commit/ec5267dc4a3444ae1ce26b975e4b6505f0ad8fc9

HavenDV commented 2 years ago

As for the rest of the problems - I need something specific - error messages or a project to reproduce.

HavenDV commented 2 years ago

I have also added a warning to the README.

image

Also, I marked EnableEncryption with System.Runtime.Versioning.SupportedOSPlatform(windows) because CngKey.Import is only available for windows platforms. @zbalkan do you know any cross platform alternatives for this? You can see the current errors by removing SupportedOSPlatform from the H.Formatters.Inferno project

zbalkan commented 2 years ago

There are candidates like nsec, Bouncy Castle or System.Security.Cryptography namespace . But they have different runtime requirements. I can give each of them a shot and see what we can get.

HavenDV commented 2 years ago

I also checked the Inferno research for compatibility and did a PR for them. https://github.com/sdrapkin/SecurityDriven.Inferno/pull/40

CngKeyExtensions.CreateNewDhmKey and GetSharedDhmSecret also windows-only.

HavenDV commented 2 years ago

There are candidates like nsec, Bouncy Castle or System.Security.Cryptography namespace . But they have different runtime requirements. I can give each of them a shot and see what we can get.

System.Security.Cryptography would be the best candidate and would look the best if it were possible to use it.

P.S. If you do this, please create a new project like the Inferno project and do any experiments there.

zbalkan commented 2 years ago

I made some experiments. Currently, I plan to make a PR just to add a README for Inferno that mentions the dependencies and limitations. And another PR with a new project with a demo using System.Security.Cryptography. Yet, it will take time.