Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support signing Firefox Addons #14

Open
wants to merge 103 commits into
base: master
Choose a base branch
from

Conversation

jvehent
Copy link
Contributor

@jvehent jvehent commented Feb 27, 2017

This is a massive pull request, and I would understand if you do not want to merge it, but I thought I should share it and leave it up to you.

I am using this package to sign Firefox addons, and had to fix a number of limitations as well as add support for certificate chains for this to happen. I also added support for ECDSA and SHA2 algorithms. The code has been restructured in separate files to help with readability, and tests that use OpenSSL helped me make sure the PKCS7 structures are compatible with other implementations.

Ultimately, I think we'll keep referring to our fork from go.mozilla.org/pkcs7, since this is a sensitive piece of code for us, but would love to maintain upstream compatibility as much as possible.

Note: I couldn't figure out how to address the README changes. I might have to drop that patch.

jvehent and others added 21 commits February 6, 2017 12:31
Support S/MIME detached signatures, and improve tests
Add more checks around BER processing, fixes #2
This patch adds the ability to both sign and verify
signatures that contain a certificate chain. The root
of the chain is expected to be provided separately via
an x509.CertPool passed to the Verifier.

The added FirefoxAddon test case uses a certificate
chain to check the addon signature against the Firefox
Root CA.
Adding RSA SHA1-SHA512 support
Minor fixes to implement addon signing in firefox
Added support for encrypting using a pre-shared key
Implement crypto.Signer to support keys where the private part is kept in, for example, a hardware module.
Implement crypto.Signer for pkcs11/hsm support
@jvehent jvehent mentioned this pull request Jul 5, 2017
vanbroup and others added 8 commits July 19, 2017 22:27
The private key might not always be availible to determine the Encryption Algorithm, for example when the key is stored in hardware. This change brings the pkcs7 package in-line with the go crypto packages by using the crypto.Singer interface to obtain the public key.
Use public key for getOIDForEncryptionAlgorithm
This patch add a new method SetDigestAlgorithm to set the digest
algorihm used when signing data. It also exports all the OIDs to make
them usable outside the package, which artificially inflates the size
of this change.
Make the signing digest algorithm configurable
mozmark and others added 30 commits January 21, 2020 21:52
…ges for x/crypto dependencies"

This reverts commit f7765b8, reversing
changes made to b0a785e.
Fix go.mod module address
Replace travis CI with Github Actions.
ignore DSA tests on unsupported golang versions
Go 1.10 is more strict about Asn.1 annotations. This removes the incorrect “explicit” annotation from encryptedContentInfo.EncryptedContent.

I’m also using openssl to generate the fixture now so that we aren’t testing with our own output for `Decrypt()`

Cherry-pick upstream fullsailor@cddbb99
…ontent

Fix failure to parse enveloped data in Go 1.10
The test now validates a chain against a fixed time
that is known to be valid for the entire certificate chain.
Also fix an error in the same test with date/time parsing.
Fix FirefoxAddon test to not use current time.
Fix indefinite length asn1 parsing
encodeIndent was only there for debugging and not currently used for anything.
This was causing some projects downstream to fail testing with -race enabled.
+ Added `-race` to go test and made ber.go tests run in parallel
Fix race condition with unused code
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.