-
Notifications
You must be signed in to change notification settings - Fork 593
Improve RFC 3779 extension api #4890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
if (!m_asnum.has_value() && !m_rdi.has_value()) { | ||
throw Encoding_Error("One of asnum, rdi must be present"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When just doing auto ext = std::make_unique<ASBlocks>()
, nothing is set initially, so the (std::nullopt, std::nullopt) case that was previously caught by the ASIdentifiers
constructor now needs to be caught here too
ASIdOrRange() = default; | ||
|
||
ASIdOrRange(asnum_t id) : m_min(id), m_max(id) {} | ||
|
||
ASIdOrRange(asnum_t min, asnum_t max) : m_min(min), m_max(max) { | ||
if(max < min) { | ||
throw Decoding_Error("AS range numbers must be sorted"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to make these constructors private too, but that clashes both with our helper methods in x509_ext.cpp
as well as with BER_Decoder
I'm not sure why we didn't do it this way in the first place, sorry about that. I think doing it this way is way nicer for the user, because they don't need to understand the semantic of a random |
#4699 added x509 extensions for RFC 3779. While working on #4877 I realized that the api for actually using them is kind of horrible.