Skip to content

Encode ASN.1 types differently, on OTP >= 28 #14

Merged
GalaxyGorilla merged 2 commits intomasterfrom
ziopio/asn1_hack
Feb 10, 2026
Merged

Encode ASN.1 types differently, on OTP >= 28 #14
GalaxyGorilla merged 2 commits intomasterfrom
ziopio/asn1_hack

Conversation

@ziopio
Copy link
Copy Markdown
Member

@ziopio ziopio commented Nov 18, 2025

Problem

This PR tries to fix #13
We need to run different code on 28 as the old internal module does not exist anymore.

Solution

We have more stuff available in public_key so I use the public API when possible.
For a couple of other types, I need to switch to a new internal module.

CertificateSerialNumber -> CRLNumber

By changing type, is possible to use the public_key API public_key:der_encode
Looks safe to use on both 27 and 28

InvalidityDate

From OTP 28 it is available in public_key api

Ia5String

Can be encoded as 'OTP-PKIX':encode('OTPDisplayText', {ia5String, String}),

OID (ObjectIdentifier)

We can use CertPolicyId as 'OTP-PKIX':encode('CertPolicyId', OId),

Tests

I manually tested grisp board connections to grisp.io, both with latest OTP 27 and OTP 28 👍

@ziopio ziopio mentioned this pull request Nov 20, 2025
@ziopio ziopio changed the title Remove OTP-PUB-KEY dependency Encode ASN.1 types differently, on OTP >= 28 Feb 6, 2026
Keep the old code to maintain backward compatibility
@ziopio ziopio requested a review from GalaxyGorilla February 6, 2026 15:21
@ziopio ziopio marked this pull request as ready for review February 6, 2026 15:24
@GalaxyGorilla GalaxyGorilla merged commit 9ade561 into master Feb 10, 2026
@ziopio ziopio deleted the ziopio/asn1_hack branch February 10, 2026 15:38
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.

Broken on OTP 28

2 participants