aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1/asn1_alt_name.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-11-10 08:23:45 -0500
committerJack Lloyd <[email protected]>2017-11-10 08:23:45 -0500
commitbff1490ac8001fe8dcfdc145c44c6cce28a0cba1 (patch)
treee70dda7d11abd6683a9376c35930d23e1b68c2aa /src/lib/asn1/asn1_alt_name.cpp
parent2abac405f483b45ddb653f710be396d8d37936b2 (diff)
parentba16efe696d181b0165e57f86cade99934aa788f (diff)
Merge GH #1287 #1289 Use UTF-8 encoding for ASN.1 strings
Diffstat (limited to 'src/lib/asn1/asn1_alt_name.cpp')
-rw-r--r--src/lib/asn1/asn1_alt_name.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/asn1/asn1_alt_name.cpp b/src/lib/asn1/asn1_alt_name.cpp
index 7bd4cd494..940312886 100644
--- a/src/lib/asn1/asn1_alt_name.cpp
+++ b/src/lib/asn1/asn1_alt_name.cpp
@@ -11,7 +11,6 @@
#include <botan/ber_dec.h>
#include <botan/oids.h>
#include <botan/internal/stl_util.h>
-#include <botan/charset.h>
#include <botan/parsing.h>
#include <botan/loadstor.h>
@@ -133,7 +132,7 @@ void encode_entries(DER_Encoder& encoder,
if(type == "RFC822" || type == "DNS" || type == "URI")
{
ASN1_String asn1_string(i->second, IA5_STRING);
- encoder.add_object(tagging, CONTEXT_SPECIFIC, asn1_string.iso_8859());
+ encoder.add_object(tagging, CONTEXT_SPECIFIC, asn1_string.value());
}
else if(type == "IP")
{
@@ -218,13 +217,9 @@ void AlternativeName::decode_from(BER_Decoder& source)
}
else if(tag == 1 || tag == 2 || tag == 6)
{
- const std::string value = Charset::transcode(ASN1::to_string(obj),
- LATIN1_CHARSET,
- LOCAL_CHARSET);
-
- if(tag == 1) add_attribute("RFC822", value);
- if(tag == 2) add_attribute("DNS", value);
- if(tag == 6) add_attribute("URI", value);
+ if(tag == 1) add_attribute("RFC822", ASN1::to_string(obj));
+ if(tag == 2) add_attribute("DNS", ASN1::to_string(obj));
+ if(tag == 6) add_attribute("URI", ASN1::to_string(obj));
}
else if(tag == 7)
{