Internalize cryptobyte package - #59
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR vendors (internalizes) the cryptobyte package into internal/cryptobyte and updates the legacy X.509 parser to use the internal copy, removing the module dependency on golang.org/x/crypto.
Changes:
- Replaced
golang.org/x/crypto/cryptobyteimports withgithub.com/smallstep/pkcs7/internal/cryptobytein the legacy X.509 parser. - Added an internal copy of
cryptobyte(including ASN.1 helpers) plus upstream tests and licensing files. - Removed the
golang.org/x/cryptorequirement fromgo.mod(and clearedgo.sumaccordingly).
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/legacy/x509/parser.go | Switches legacy X.509 parsing to use the internal cryptobyte copy. |
| internal/cryptobyte/doc.go | Documents why cryptobyte is internalized and scoped to legacy parsing support. |
| internal/cryptobyte/string.go | Adds cryptobyte.String parsing helpers. |
| internal/cryptobyte/builder.go | Adds cryptobyte.Builder construction helpers. |
| internal/cryptobyte/asn1.go | Adds ASN.1 parsing/building helpers for cryptobyte. |
| internal/cryptobyte/asn1/asn1.go | Adds ASN.1 tag/type constants used by cryptobyte. |
| internal/cryptobyte/cryptobyte_test.go | Adds upstream tests for Builder/String behavior. |
| internal/cryptobyte/asn1_test.go | Adds upstream tests for ASN.1 helpers. |
| internal/cryptobyte/LICENSE | Adds upstream license for the copied code. |
| internal/cryptobyte/PATENTS | Adds upstream patents grant for the copied code. |
| go.mod | Drops the golang.org/x/crypto dependency. |
| go.sum | Cleared due to dependency removal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 15, 2026
azazeal
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.