H.Pipes icon indicating copy to clipboard operation
H.Pipes copied to clipboard

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

Open PeterPann23 opened this issue 2 years ago • 15 comments

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

PeterPann23 avatar Mar 11 '22 08:03 PeterPann23

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

HavenDV avatar Mar 11 '22 08:03 HavenDV

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.

zbalkan avatar Mar 11 '22 10:03 zbalkan

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

HavenDV avatar Mar 11 '22 10:03 HavenDV

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: @.@.>>

PeterPann23 avatar Mar 11 '22 11:03 PeterPann23

Neither do the installed client machines

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

HavenDV avatar Mar 11 '22 12:03 HavenDV

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

zbalkan avatar Mar 11 '22 14:03 zbalkan

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")]

PeterPann23 avatar Mar 11 '22 15:03 PeterPann23

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 avatar Mar 12 '22 05:03 HavenDV

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

HavenDV avatar Mar 12 '22 05:03 HavenDV

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

HavenDV avatar Mar 12 '22 05:03 HavenDV

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

HavenDV avatar Mar 12 '22 05:03 HavenDV

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.

zbalkan avatar Mar 12 '22 07:03 zbalkan

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 avatar Mar 12 '22 08:03 HavenDV

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.

HavenDV avatar Mar 12 '22 08:03 HavenDV

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.

zbalkan avatar Mar 13 '22 15:03 zbalkan