Encode ASN.1 types differently, on OTP >= 28 #14
Merged
GalaxyGorilla merged 2 commits intomasterfrom Feb 10, 2026
Merged
Conversation
Closed
ecec28b to
5f8e5c6
Compare
d8e63da to
46c2467
Compare
Keep the old code to maintain backward compatibility
46c2467 to
ecb1313
Compare
2f1801c to
47dae5f
Compare
aaf75f0 to
4801014
Compare
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.
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_keyso 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_encodeLooks safe to use on both 27 and 28
InvalidityDate
From OTP 28 it is available in
public_keyapiIa5String
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 👍