From fead864996c7c270a7f5b159cd12aaedb00715b7 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 30 Jul 2022 02:49:51 +0300 Subject: [PATCH 1/2] x509-cert: support TeletexStrings in RDN Handle the TeletexStrings usage for the value part of AttributeTypeAndValue. Signed-off-by: Dmitry Baryshkov --- x509-cert/src/attr.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/x509-cert/src/attr.rs b/x509-cert/src/attr.rs index 9a0d2d265..3d32c2515 100644 --- a/x509-cert/src/attr.rs +++ b/x509-cert/src/attr.rs @@ -220,6 +220,7 @@ impl fmt::Display for AttributeTypeAndValue<'_> { Tag::PrintableString => self.value.printable_string().ok().map(|s| s.as_str()), Tag::Utf8String => self.value.utf8_string().ok().map(|s| s.as_str()), Tag::Ia5String => self.value.ia5_string().ok().map(|s| s.as_str()), + Tag::TeletexString => self.value.teletex_string().ok().map(|s| s.as_str()), _ => None, }; From c8c52f76d8649a7726851ddbe5d6837c89af4165 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 30 Jul 2022 02:49:51 +0300 Subject: [PATCH 2/2] x509-cert: support TeletexStrings in DirectoryString Handle the TeletexStrings usage in the DirectoryString structure. Signed-off-by: Dmitry Baryshkov --- x509-cert/src/ext/pkix/name/dirstr.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x509-cert/src/ext/pkix/name/dirstr.rs b/x509-cert/src/ext/pkix/name/dirstr.rs index e2af69810..283b53f11 100644 --- a/x509-cert/src/ext/pkix/name/dirstr.rs +++ b/x509-cert/src/ext/pkix/name/dirstr.rs @@ -1,4 +1,4 @@ -use der::asn1::{PrintableStringRef, Utf8StringRef}; +use der::asn1::{PrintableStringRef, TeletexStringRef, Utf8StringRef}; use der::Choice; /// DirectoryString as defined in [RFC 5280 Section 4.2.1.4]. @@ -44,6 +44,9 @@ pub enum DirectoryString<'a> { #[asn1(type = "PrintableString")] PrintableString(PrintableStringRef<'a>), + #[asn1(type = "TeletexString")] + TeletexString(TeletexStringRef<'a>), + #[asn1(type = "UTF8String")] Utf8String(Utf8StringRef<'a>), }