Code Monkey home page Code Monkey logo

Comments (14)

AArnott avatar AArnott commented on July 19, 2024

This is great feedback, thank you.

I wonder if SHA256.Create() would be a sufficient change. It seems like it should ideally create either Sha256Cng or Sha256Managed as supported and appropriate. Do you know if that would work?

from dotnetopenauth.

hazzik avatar hazzik commented on July 19, 2024

@joeudwin
SHA256.Create() depends on configuration provided to application, see http://msdn.microsoft.com/en-us/library/693aff9y.aspx

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

So couldn't a web.config file contain the necessary settings to make the library FIPS-compliant if the library called the SHA256.Create() method?

from dotnetopenauth.

hazzik avatar hazzik commented on July 19, 2024

@AArnott
I think it could

from dotnetopenauth.

joeudwin avatar joeudwin commented on July 19, 2024

Good spot @hazzik.
There is good and bad news...

I can get SHA512.Create() to work by modifying the machine.config

However annoyingly it seems HMACSHA1 is the only FIPS compliant implementation built into .Net out of the ones you are using:
HMACSHA512,HMACSHA384,HMACSHA256 and HMACSHA1.
I will search for another source for these algorithms and report back.

from dotnetopenauth.

joeudwin avatar joeudwin commented on July 19, 2024

After doing some research i have found that the CLR Security team have created FIPS compliant versions of the other HMAC algorithms in the clrsecurity codeplex project (see blog)
After adding the Security.Cryptography.dll to the bin folder and adding the following section to the machine config

<mscorlib>
<cryptographySettings>
<cryptoNameMapping>
<cryptoClasses>
<cryptoClass TestSHA512="System.Security.Cryptography.SHA512Cng, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<cryptoClass TestHMACSHA512="Security.Cryptography.HMACSHA512Cng, Security.Cryptography, Version=1.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</cryptoClasses>
<nameEntry name="System.Security.Cryptography.SHA512" class="TestSHA512"/>
<nameEntry name="HMACSHA512" class="TestHMACSHA512"/>
</cryptoNameMapping>
</cryptographySettings>
</mscorlib>

I can get of the following lines to work without error:

var a = SHA512.Create();
var b = HMAC.Create("HMACSHA512");

So i think the code changes needed to make dotNetOpenAuth work with the FIPS policy enforced is as simple as replacing the use of
new SHA512Managed() with SHA512.Create();
and
new HMACSHA512() with HMAC.Create("HMACSHA512");

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

Stellar. Thanks. We should be able to get this into the next release.

from dotnetopenauth.

joeudwin avatar joeudwin commented on July 19, 2024

That is great news! When is the next release scheduled for?
Will you update this issue when it is resolved?

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

There isn't a schedule for it right now. Hopefully in the next month. And yes, this issue will be updated when that happens.

from dotnetopenauth.

joeudwin avatar joeudwin commented on July 19, 2024

Hi @AArnott, any update on when this may be fixed/ released?
Thanks!

from dotnetopenauth.

tonyrsmith avatar tonyrsmith commented on July 19, 2024

Hi @AArnott, I would also be interested in this fix any idea when it might be ready? Thanks.

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

We're looking at a release by the end of this month. I hope this issue can be fixed there.

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

This has been fixed in 72f107fd. Slated for release in the coming week.

from dotnetopenauth.

AArnott avatar AArnott commented on July 19, 2024

HMACSHA algorithms still need to be converted.

from dotnetopenauth.

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.