Skip to content

Internalize cryptobyte package - #59

Merged
hslatman merged 1 commit into
mainfrom
herman/internalize-cryptobyte
Jul 16, 2026
Merged

Internalize cryptobyte package#59
hslatman merged 1 commit into
mainfrom
herman/internalize-cryptobyte

Conversation

@hslatman

Copy link
Copy Markdown
Member

No description provided.

@hslatman
hslatman marked this pull request as ready for review July 15, 2026 20:16
@hslatman
hslatman requested review from a team, azazeal and Copilot July 15, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/cryptobyte imports with github.com/smallstep/pkcs7/internal/cryptobyte in 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/crypto requirement from go.mod (and cleared go.sum accordingly).

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.

Comment thread internal/cryptobyte/string.go
Comment thread internal/cryptobyte/string.go
Comment thread internal/cryptobyte/builder.go
Comment thread internal/cryptobyte/cryptobyte_test.go
@hslatman
hslatman merged commit 092fcd3 into main Jul 16, 2026
9 checks passed
@hslatman
hslatman deleted the herman/internalize-cryptobyte branch July 16, 2026 09:43
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.

3 participants