Open Bug 1342546 Opened 8 years ago Updated 1 month ago

Implement SHA-3

Categories

(NSS :: Libraries, enhancement, P5)

enhancement

Tracking

(Not tracked)

REOPENED

People

(Reporter: jcj, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [nss-nofx])

This is a meta-mug to track the implementation of SHA-3, standardized by NIST in 2015.

Firefox SHA-3 family of hash functions OIDs are defined at CSOR [1] as:

  id-rsassa-pkcs1-v1_5-with-sha3-256 ::= { sigAlgs 14 }
  id-rsassa-pkcs1-v1_5-with-sha3-384 ::= { sigAlgs 15 }
  id-rsassa-pkcs1-v1_5-with-sha3-512 ::= { sigAlgs 16 }

  id-ecdsa-with-sha3-256 ::= { sigAlgs 10 }
  id-ecdsa-with-sha3-384 ::= { sigAlgs 11 }
  id-ecdsa-with-sha3-512 ::= { sigAlgs 12 }

There is a staring point implementation by Richard Barnes, Bob Relyea, and Martin Thomson here: https://github.com/martinthomson/sha3

[1] http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html
Priority: -- → P3
WolfSSL supports it since 3.12.0:
https://www.wolfssl.com/wolfssl-3-12-0-now-available/
https://github.com/wolfSSL/wolfssl/pull/937

mbedtls is working on it:
https://github.com/ARMmbed/mbedtls/pull/479

OpenSSL will support it in the next major release:
https://github.com/openssl/openssl/issues/439

The meta keyword is there, the bug doesn't depend on other bugs and there is no activity for 12 months.
:kjacobs, maybe it's time to close this bug?

Flags: needinfo?(kjacobs.bugzilla)
Severity: normal → --
Flags: needinfo?(kjacobs.bugzilla)
Keywords: meta
Summary: [Meta] Implement SHA-3 → Implement SHA-3

OpenSSL also can use SHA-3 in PKCS#12 files, both for MAC (since 1.1.1) and for PRF in PBKDF2 (also since 1.1.1 but the API is quite clunky, better support should happen in a release after 3.0.0).

Example generated files are in https://github.com/redhat-qe-security/keyfile-corpus

Hubert, does RedHat need this for something?
Otherwise, since we already have code for this in HACL*, I can add it to our backlog for later.

Severity: -- → N/A
Flags: needinfo?(hkario)
Priority: P3 → P5
Whiteboard: [nss-nofx]

No, it isn't needed for anything in particular. Just providing information for completeness sake.
(creating file with SHA-3 MAC with OpenSSL is actually quite easy, you just need to specify -macalg sha3-256 to openssl pkcs12, so technically users can create files like this, but if any of our customers encounter them we can always tell them to use openssl to re-encrypt with a MAC supported by NSS)

Flags: needinfo?(hkario)

It would be helpful if we could migrate this HACL* code over. We need something indistinguishable from a RO for DAP and the natural choice would be SHAKE.
What would be the required steps and effort?

Flags: needinfo?(nkulatova)

I've discussed this with ekr, please add support for SHA-3.

Many thanks to John Schanck for adding SHA3.

Status: NEW → RESOLVED
Closed: 8 months ago
Flags: needinfo?(nkulatova)
Resolution: --- → FIXED

Reopening as this was only partially implemented by Bug 1753026 implementation of some of the SHA-3 family primitives.

The reporter requested implementation of the RSA and ECDSA digital signatures using SHA-3 family of hash functions.

Currently NSS secoidt.h has defined:

As mentioned by Simon in Comment #6, apart from the 4 SHA-3 hash algorithms the SHA-3 family does also include the 2 SHAKE hash algorithms.

The 2 SHAKE algorithms have been standardised in 2019 by IETF as part of PKIX under the RFC 8692.

Without these implemented, when Firefox currently encounters a website with an OpenSSL generated certificate signed using ecdsa_with_SHA3-384 algorithm, it fails with SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED "The certificate is not trusted because it was signed using a signature algorithm that was disabled because that algorithm is not secure" error because the NSS sec_DecodeSigAlg and CERT_VerifySignedDataWithPublicKey functions don't recognise the signature algorithm.

With SHA-3 primitives already implemented by Bug 1753026, I'm guessing implementing SHA-3 digital signatures and certificate validation support should be easier?

Status: RESOLVED → REOPENED
User Story: (updated)
Depends on: 1753026
Resolution: FIXED → ---
User Story: (updated)
Blocks: 1911870
You need to log in before you can comment on or make changes to this bug.