Juan Lang : crypt32: Implement formatting an alt name entry with type CERT_ALT_NAME_DIRECTORY_NAME .

Alexandre Julliard julliard at winehq.org
Thu Nov 13 08:51:32 CST 2008


Module: wine
Branch: master
Commit: 7fb0ce553294e300bd6c697f851672941fcf465f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7fb0ce553294e300bd6c697f851672941fcf465f

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Nov 12 20:37:02 2008 -0800

crypt32: Implement formatting an alt name entry with type CERT_ALT_NAME_DIRECTORY_NAME.

---

 dlls/crypt32/object.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index d639630..596c8e3 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -778,6 +778,19 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
         bytesNeeded += strlenW(entry->u.pwszDNSName) * sizeof(WCHAR);
         ret = TRUE;
         break;
+    case CERT_ALT_NAME_DIRECTORY_NAME:
+    {
+        DWORD strType = dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE
+         ? CERT_NAME_STR_CRLF_FLAG : 0;
+        DWORD directoryNameLen = CertNameToStrW(X509_ASN_ENCODING,
+         &entry->u.DirectoryName, strType, NULL, 0);
+
+        LoadStringW(hInstance, IDS_ALT_NAME_OTHER_NAME, buf,
+         sizeof(buf) / sizeof(buf[0]));
+        bytesNeeded += (directoryNameLen - 1) * sizeof(WCHAR);
+        ret = TRUE;
+        break;
+    }
     case CERT_ALT_NAME_URL:
         LoadStringW(hInstance, IDS_ALT_NAME_URL, buf,
          sizeof(buf) / sizeof(buf[0]));
@@ -877,6 +890,15 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
             case CERT_ALT_NAME_URL:
                 strcpyW(str, entry->u.pwszURL);
                 break;
+            case CERT_ALT_NAME_DIRECTORY_NAME:
+            {
+                DWORD strType = dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE
+                 ? CERT_NAME_STR_CRLF_FLAG : 0;
+
+                CertNameToStrW(X509_ASN_ENCODING, &entry->u.DirectoryName,
+                 strType, str, bytesNeeded / sizeof(WCHAR));
+                break;
+            }
             case CERT_ALT_NAME_IP_ADDRESS:
                 if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
                 {




More information about the wine-cvs mailing list