aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509/asn1_alt_name.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-11-14 14:03:16 -0500
committerJack Lloyd <[email protected]>2017-11-14 16:35:24 -0500
commit50ebb336e119eacfacd20c4b005295cac986cdf2 (patch)
treef45feddffad600bd4e1cd7e205abcd855495d0aa /src/lib/x509/asn1_alt_name.cpp
parentcd7866e3ec00beff057228cf3fb87b72df02f88f (diff)
Fix PKCS10 subject alt name usage
GH #1010
Diffstat (limited to 'src/lib/x509/asn1_alt_name.cpp')
-rw-r--r--src/lib/x509/asn1_alt_name.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/x509/asn1_alt_name.cpp b/src/lib/x509/asn1_alt_name.cpp
index 8b3d2d6e9..04e11bbcd 100644
--- a/src/lib/x509/asn1_alt_name.cpp
+++ b/src/lib/x509/asn1_alt_name.cpp
@@ -98,6 +98,15 @@ bool AlternativeName::has_field(const std::string& attr) const
return (range.first != range.second);
}
+std::string AlternativeName::get_first_attribute(const std::string& attr) const
+ {
+ auto i = m_alt_info.lower_bound(attr);
+ if(i != m_alt_info.end() && i->first == attr)
+ return i->second;
+
+ return "";
+ }
+
std::vector<std::string> AlternativeName::get_attribute(const std::string& attr) const
{
std::vector<std::string> results;