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

Fixed data truncation for signed messages #6

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

Conversation

geoko86
Copy link

@geoko86 geoko86 commented Apr 14, 2016

I noticed that data gets truncated on signed messages because only the first ASN.1 data structure was parsed.
The fix now loops over any rest that comes back from ans1.Unmarshal and tries to unmarshal that rest again.

@fullsailor
Copy link
Owner

@geoko86 Any chance you have an sample with this format that I can add to the tests?

@geoko86
Copy link
Author

geoko86 commented Apr 14, 2016

Hi Andrew, I don't have a sample that i can share at the moment. I'll try
to create one on the weekend or next week.

On Thu, Apr 14, 2016 at 7:06 PM Andrew Smith notifications@github.com
wrote:

@geoko86 https://github.com/geoko86 Any chance you have an sample with
this format that I can add to the tests?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#6 (comment)

sent from mobile device.

Timo Gatsonides and others added 23 commits July 30, 2016 11:16
Most files could be unsigned, but some were failing. This commit successfully parses at least one example (received by email from Frank).
Bug fix and hack to allow unsigning certain files
Fixes an issue where more than one certificate would not be marshalled correctly.
This is now tested against openssl

* correctly marshal degenerate certificates
* update DegenerateCertificates test
* add marshalCertificateBytes function and test against openssl
* Added AES-128-GCM support to Encrypt() and Decrypt()
According to the specification, when AuthenticatedAttributes isn't included the pkcs7 content should be used.

Fixes fullsailor#9
I believe I was lied to. (or followed out of date advice)
OID 2.16.840.1.101.3.4.1.2
Since Go 1.10, the SignatureAlgorithm is now validated against the public key type. It was "working" before because the Amazon key used DSA with SHA1, and so the RSA/DSA mismatch didn't matter since the SHA1 hash type did.

This uses some unexported code from `crypto/x509` that looks up a signature algorithm for a given `pxix.AlgorithmIdentifier`

Fixes fullsailor#27
Fixes fullsailor#28
Fixes fullsailor#29
App Store receipts have an unusual DigestEncryptionAlgorithm, this may be because it doesn't have any authenticated attributes.

If the new strategy for determining the correct x509.SignatureAlgorithm fails, we fallback to the old SHA1WithRSA algo.
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()`

Fixes fullsailor#31
The content type should be oidData.

Fixes fullsailor#24
…cted-when-running

Georg/ch6977/esb race condition detected when running
chrisccoulson pushed a commit to chrisccoulson/pkcs7 that referenced this pull request Apr 25, 2020
Minor fixes to implement addon signing in firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants