Skip to content

Add SHA-384 MAC digest support - #77

Open
jelinek-wgs wants to merge 1 commit into
SSLMate:masterfrom
jelinek-wgs:add-sha384-mac-support
Open

jelinek-wgs wants to merge 1 commit into
SSLMate:masterfrom
jelinek-wgs:add-sha384-mac-support

Conversation

@jelinek-wgs

Copy link
Copy Markdown

The classic PKCS#12 MAC (RFC 7292) only supports SHA-1, SHA-256 and SHA-512; SHA-384 (OID 2.16.840.1.101.3.4.2.2) is rejected with "unknown digest algorithm". This affects PKCS#12 files exported with openssl pkcs12 -export -macalg sha384.

  • pbkdf.go: add sha384Sum helper.
  • mac.go: add oidSHA384, wire into doMac (RFC 7292 Appendix B.2: u=48, v=128 bytes).
  • pkcs12_test.go: add TestPKCS12_SHA384MAC using a real OpenSSL- generated fixture (verified via openssl pkcs12 -info).

The classic PKCS#12 MAC (RFC 7292) only supports SHA-1, SHA-256 and
SHA-512; SHA-384 (OID 2.16.840.1.101.3.4.2.2) is rejected with
"unknown digest algorithm". This affects PKCS#12 files exported with
`openssl pkcs12 -export -macalg sha384`.

- pbkdf.go: add sha384Sum helper.
- mac.go: add oidSHA384, wire into doMac (RFC 7292 Appendix B.2:
  u=48, v=128 bytes).
- pkcs12_test.go: add TestPKCS12_SHA384MAC using a real OpenSSL-
  generated fixture (verified via `openssl pkcs12 -info`).
@jelinek-wgs
jelinek-wgs force-pushed the add-sha384-mac-support branch from a7933bc to 99c0845 Compare July 2, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant