fix(mail): improve parsing of S/MIME certificate

Fixes #5215
This commit is contained in:
Francis Lachapelle
2022-01-24 14:53:03 -05:00
parent e513a7242a
commit c12dd56362
2 changed files with 8 additions and 2 deletions

View File

@@ -124,12 +124,18 @@
"S/MIME Certificate" = "S/MIME Certificate";
"Subject Name" = "Subject Name";
"Issuer" = "Issuer";
"streetAddress" = "Street";
"stateOrProvinceName" = "State or Province";
"localityName" = "Locality";
"countryName" = "Country";
"organizationName" = "Organization";
"organizationalUnitName" = "Organizational Unit";
"commonName" = "Common Name";
"surname" = "Surname";
"givenName" = "Given Name";
"emailAddress" = "Email Address";
/* Authentication username */
"Username" = "Username";

View File

@@ -149,7 +149,7 @@
memset(p, 0, 1024);
buf = BIO_new(BIO_s_mem());
X509_NAME_print_ex(buf, X509_get_subject_name(x), 0,
ASN1_STRFLGS_ESC_CTRL | XN_FLAG_SEP_MULTILINE | XN_FLAG_FN_LN);
ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_UTF8_CONVERT | XN_FLAG_SEP_MULTILINE | XN_FLAG_FN_LN);
BIO_read(buf, p, 1024);
subject = [NSString stringWithUTF8String: p];
BIO_free(buf);
@@ -157,7 +157,7 @@
memset(p, 0, 1024);
buf = BIO_new(BIO_s_mem());
X509_NAME_print_ex(buf, X509_get_issuer_name(x), 0,
ASN1_STRFLGS_ESC_CTRL | XN_FLAG_SEP_MULTILINE | XN_FLAG_FN_LN);
ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_UTF8_CONVERT | XN_FLAG_SEP_MULTILINE | XN_FLAG_FN_LN);
BIO_read(buf, p, 1024);
issuer = [NSString stringWithUTF8String: p];
BIO_free(buf);