Skip to content

Add Asn1IntegerRef::to_der_contents - #543

Merged
kornelski merged 1 commit into
cloudflare:masterfrom
geota:amaceiras/asn1-integer-der-contents
Oct 26, 2026
Merged

kornelski merged 1 commit into
cloudflare:masterfrom
geota:amaceiras/asn1-integer-der-contents

Conversation

@geota

@geota geota commented Oct 23, 2026 •

Copy link
Copy Markdown

Add a safe wrapper around i2c_ASN1_INTEGER using the existing to_der! macro. It returns the integer's minimal signed two's-complement DER encoding, excluding the tag and length.

Includes tests for zero, sign boundaries, and integers larger than 64 bits.

@clanky-the-clanker

clanky-the-clanker Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

✅ Approved — A small, correct safe wrapper that reuses the existing to_der! macro, with documentation and boundary-case tests; no issues found.

The decision is advisory: this comment never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The wrapper reuses the existing to_der! length-query-then-fill pattern correctly. Tests cover zero, the sign boundaries and integers larger than 64 bits.


📝 Documentation: ✅ LGTM

The doc comment and the #[corresponds(i2c_ASN1_INTEGER)] attribute are accurate and match what the method returns.


Reviewed commit: ae26780b

@TheJokr

TheJokr commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

clanky review

@kornelski
kornelski merged commit 3d73b84 into cloudflare:master Oct 26, 2026
27 checks passed
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.

4 participants