https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8bf2b3cf2cc63f6424ba121b56b6843cba35e1f3

commit 8bf2b3cf2cc63f6424ba121b56b6843cba35e1f3
Author:     winesync <[email protected]>
AuthorDate: Tue Dec 8 18:11:23 2020 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Tue Jan 5 11:03:13 2021 +0100

    [WINESYNC] wininet: Implement INTERNET_OPTION_SECURITY_CERTIFICATE flag for 
InternetQueryOption.
    
    Signed-off-by: Daniel Lehman <[email protected]>
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id ef88a70fa775f3e7a26d8f1618f32ee94bb9ea05 by Daniel Lehman 
<[email protected]>
---
 dll/win32/wininet/http.c                  | 100 ++++++++++++++++++++
 dll/win32/wininet/lang/wininet_Bg.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Cs.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Da.rc      |  11 +++
 dll/win32/wininet/lang/wininet_De.rc      |  11 +++
 dll/win32/wininet/lang/wininet_En.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Eo.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Es.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Fi.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Fr.rc      |  11 +++
 dll/win32/wininet/lang/wininet_He.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Hu.rc      |  11 +++
 dll/win32/wininet/lang/wininet_It.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Ja.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Ko.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Lt.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Nl.rc      |  11 +++
 dll/win32/wininet/lang/wininet_No.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Pl.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Pt.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Ro.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Ru.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Si.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Sq.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Sr.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Sv.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Tr.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Uk.rc      |  11 +++
 dll/win32/wininet/lang/wininet_Zh.rc      |  11 +++
 dll/win32/wininet/resource.h              |  11 +++
 modules/rostests/winetests/wininet/http.c | 150 +++++++++++++++++++++++++++++-
 sdk/tools/winesync/wininet.cfg            |   2 +-
 32 files changed, 568 insertions(+), 3 deletions(-)

diff --git a/dll/win32/wininet/http.c b/dll/win32/wininet/http.c
index 58e91bc1a13..52ed7cc730a 100644
--- a/dll/win32/wininet/http.c
+++ b/dll/win32/wininet/http.c
@@ -57,6 +57,7 @@
 
 #include "internet.h"
 #include "zlib.h"
+#include "resource.h"
 #include "wine/debug.h"
 #include "wine/exception.h"
 #endif /* defined(__REACTOS__) */
@@ -2296,6 +2297,105 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, 
DWORD option, void *buffe
 
         return get_security_cert_struct(req, 
(INTERNET_CERTIFICATE_INFOA*)buffer);
     }
+    case INTERNET_OPTION_SECURITY_CERTIFICATE: {
+        DWORD err;
+        int needed;
+        char subject[64];
+        char issuer[64];
+        char effective[64];
+        char expiration[64];
+        char protocol[64];
+        char signature[64];
+        char encryption[64];
+        char privacy[64];
+        char bits[16];
+        char strength[16];
+        char start_date[32];
+        char start_time[32];
+        char expiry_date[32];
+        char expiry_time[32];
+        SYSTEMTIME start, expiry;
+        INTERNET_CERTIFICATE_INFOA info;
+
+        if(!size)
+            return ERROR_INVALID_PARAMETER;
+
+        if(!req->netconn) {
+            *size = 0;
+            return ERROR_INTERNET_INVALID_OPERATION;
+        }
+
+        if(!buffer) {
+            *size = 1;
+            return ERROR_INSUFFICIENT_BUFFER;
+        }
+
+        if((err = get_security_cert_struct(req, &info)))
+            return err;
+
+        LoadStringA(WININET_hModule, IDS_CERT_SUBJECT, subject, 
sizeof(subject));
+        LoadStringA(WININET_hModule, IDS_CERT_ISSUER, issuer, sizeof(issuer));
+        LoadStringA(WININET_hModule, IDS_CERT_EFFECTIVE, effective, 
sizeof(effective));
+        LoadStringA(WININET_hModule, IDS_CERT_EXPIRATION, expiration, 
sizeof(expiration));
+        LoadStringA(WININET_hModule, IDS_CERT_PROTOCOL, protocol, 
sizeof(protocol));
+        LoadStringA(WININET_hModule, IDS_CERT_SIGNATURE, signature, 
sizeof(signature));
+        LoadStringA(WININET_hModule, IDS_CERT_ENCRYPTION, encryption, 
sizeof(encryption));
+        LoadStringA(WININET_hModule, IDS_CERT_PRIVACY, privacy, 
sizeof(privacy));
+        LoadStringA(WININET_hModule, info.dwKeySize >= 128 ? IDS_CERT_HIGH : 
IDS_CERT_LOW,
+                    strength, sizeof(strength));
+        LoadStringA(WININET_hModule, IDS_CERT_BITS, bits, sizeof(bits));
+
+        FileTimeToSystemTime(&info.ftStart, &start);
+        FileTimeToSystemTime(&info.ftExpiry, &expiry);
+        GetDateFormatA(LOCALE_USER_DEFAULT, 0, &start, NULL, start_date, 
sizeof(start_date));
+        GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &start, NULL, start_time, 
sizeof(start_time));
+        GetDateFormatA(LOCALE_USER_DEFAULT, 0, &expiry, NULL, expiry_date, 
sizeof(expiry_date));
+        GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &expiry, NULL, expiry_time, 
sizeof(expiry_time));
+
+        needed = _scprintf("%s:\r\n%s\r\n"
+                           "%s:\r\n%s\r\n"
+                           "%s:\t%s %s\r\n"
+                           "%s:\t%s %s\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t%s (%u %s)",
+                           subject, info.lpszSubjectInfo,
+                           issuer, info.lpszIssuerInfo,
+                           effective, start_date, start_time,
+                           expiration, expiry_date, expiry_time,
+                           protocol, signature, encryption,
+                           privacy, strength, info.dwKeySize, bits);
+
+        if(needed < *size) {
+            err = ERROR_SUCCESS;
+            *size = snprintf(buffer, *size,
+                           "%s:\r\n%s\r\n"
+                           "%s:\r\n%s\r\n"
+                           "%s:\t%s %s\r\n"
+                           "%s:\t%s %s\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t(null)\r\n"
+                           "%s:\t%s (%u %s)",
+                           subject, info.lpszSubjectInfo,
+                           issuer, info.lpszIssuerInfo,
+                           effective, start_date, start_time,
+                           expiration, expiry_date, expiry_time,
+                           protocol, signature, encryption,
+                           privacy, strength, info.dwKeySize, bits);
+        }else {
+            err = ERROR_INSUFFICIENT_BUFFER;
+            *size = 1;
+        }
+
+        LocalFree(info.lpszSubjectInfo);
+        LocalFree(info.lpszIssuerInfo);
+        LocalFree(info.lpszProtocolName);
+        LocalFree(info.lpszSignatureAlgName);
+        LocalFree(info.lpszEncryptionAlgName);
+        return err;
+    }
     case INTERNET_OPTION_CONNECT_TIMEOUT:
         if (*size < sizeof(DWORD))
             return ERROR_INSUFFICIENT_BUFFER;
diff --git a/dll/win32/wininet/lang/wininet_Bg.rc 
b/dll/win32/wininet/lang/wininet_Bg.rc
index e6876ae9e79..e649b5a73cd 100644
--- a/dll/win32/wininet/lang/wininet_Bg.rc
+++ b/dll/win32/wininet/lang/wininet_Bg.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Cs.rc 
b/dll/win32/wininet/lang/wininet_Cs.rc
index 541fdb69636..664fe1372b3 100644
--- a/dll/win32/wininet/lang/wininet_Cs.rc
+++ b/dll/win32/wininet/lang/wininet_Cs.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Da.rc 
b/dll/win32/wininet/lang/wininet_Da.rc
index 90b92a835ca..1411bfd1fcf 100644
--- a/dll/win32/wininet/lang/wininet_Da.rc
+++ b/dll/win32/wininet/lang/wininet_Da.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_De.rc 
b/dll/win32/wininet/lang/wininet_De.rc
index d0cc74bf4e7..eae9240f2c8 100644
--- a/dll/win32/wininet/lang/wininet_De.rc
+++ b/dll/win32/wininet/lang/wininet_De.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_En.rc 
b/dll/win32/wininet/lang/wininet_En.rc
index feea5cc6a18..98633dda562 100644
--- a/dll/win32/wininet/lang/wininet_En.rc
+++ b/dll/win32/wininet/lang/wininet_En.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Eo.rc 
b/dll/win32/wininet/lang/wininet_Eo.rc
index ce5ed51768d..32d9b43254e 100644
--- a/dll/win32/wininet/lang/wininet_Eo.rc
+++ b/dll/win32/wininet/lang/wininet_Eo.rc
@@ -27,6 +27,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Es.rc 
b/dll/win32/wininet/lang/wininet_Es.rc
index b1e960e7f81..1ec207fefde 100644
--- a/dll/win32/wininet/lang/wininet_Es.rc
+++ b/dll/win32/wininet/lang/wininet_Es.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "La fecha del certificado no es válida."
   IDS_CERT_CN_INVALID   "El nombre que hay en el certificado no encaja con el 
del sitio."
   IDS_CERT_ERRORS       "Hay por lo menos un problema de seguridad sin 
especificar con este certificado."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Fi.rc 
b/dll/win32/wininet/lang/wininet_Fi.rc
index 0f6eb3aa389..c0dd5e56fab 100644
--- a/dll/win32/wininet/lang/wininet_Fi.rc
+++ b/dll/win32/wininet/lang/wininet_Fi.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Fr.rc 
b/dll/win32/wininet/lang/wininet_Fr.rc
index 85b8505e424..5e6adfd01a5 100644
--- a/dll/win32/wininet/lang/wininet_Fr.rc
+++ b/dll/win32/wininet/lang/wininet_Fr.rc
@@ -34,6 +34,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_He.rc 
b/dll/win32/wininet/lang/wininet_He.rc
index 42f88c2ed46..a663f624fbb 100644
--- a/dll/win32/wininet/lang/wininet_He.rc
+++ b/dll/win32/wininet/lang/wininet_He.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Hu.rc 
b/dll/win32/wininet/lang/wininet_Hu.rc
index 9ec0ae67d3f..0f7becb9ffc 100644
--- a/dll/win32/wininet/lang/wininet_Hu.rc
+++ b/dll/win32/wininet/lang/wininet_Hu.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_It.rc 
b/dll/win32/wininet/lang/wininet_It.rc
index 773cbee8879..859c1eb0842 100644
--- a/dll/win32/wininet/lang/wininet_It.rc
+++ b/dll/win32/wininet/lang/wininet_It.rc
@@ -31,6 +31,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Ja.rc 
b/dll/win32/wininet/lang/wininet_Ja.rc
index 3765d0746dd..a00db74a3a2 100644
--- a/dll/win32/wininet/lang/wininet_Ja.rc
+++ b/dll/win32/wininet/lang/wininet_Ja.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Ko.rc 
b/dll/win32/wininet/lang/wininet_Ko.rc
index cbf2432447f..266143045a0 100644
--- a/dll/win32/wininet/lang/wininet_Ko.rc
+++ b/dll/win32/wininet/lang/wininet_Ko.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Lt.rc 
b/dll/win32/wininet/lang/wininet_Lt.rc
index d0e733b5fe7..1b7e8427970 100644
--- a/dll/win32/wininet/lang/wininet_Lt.rc
+++ b/dll/win32/wininet/lang/wininet_Lt.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Nl.rc 
b/dll/win32/wininet/lang/wininet_Nl.rc
index 2a43f54d2b1..5f8c432495c 100644
--- a/dll/win32/wininet/lang/wininet_Nl.rc
+++ b/dll/win32/wininet/lang/wininet_Nl.rc
@@ -29,6 +29,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_No.rc 
b/dll/win32/wininet/lang/wininet_No.rc
index 167ad99dc29..b0c3e2fc9e8 100644
--- a/dll/win32/wininet/lang/wininet_No.rc
+++ b/dll/win32/wininet/lang/wininet_No.rc
@@ -27,6 +27,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Pl.rc 
b/dll/win32/wininet/lang/wininet_Pl.rc
index e637f158299..c05c71a7d0f 100644
--- a/dll/win32/wininet/lang/wininet_Pl.rc
+++ b/dll/win32/wininet/lang/wininet_Pl.rc
@@ -27,6 +27,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "Data certyfikatu jest nieprawidłowa."
   IDS_CERT_CN_INVALID   "Nazwa na certyfikacie nie pasuje do witryny."
   IDS_CERT_ERRORS       "Istnieje co najmniej jeden nieokreślony problem 
bezpieczeństwa z tym certyfikatem."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Pt.rc 
b/dll/win32/wininet/lang/wininet_Pt.rc
index cc52c78119c..83f2878151d 100644
--- a/dll/win32/wininet/lang/wininet_Pt.rc
+++ b/dll/win32/wininet/lang/wininet_Pt.rc
@@ -30,6 +30,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "A data no certificado é inválida."
   IDS_CERT_CN_INVALID   "O nome no certificado não corresponde ao site."
   IDS_CERT_ERRORS       "Há pelo menos um problema de segurança não 
especificado com este certificado."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Ro.rc 
b/dll/win32/wininet/lang/wininet_Ro.rc
index 957481ad568..aa7973d8690 100644
--- a/dll/win32/wininet/lang/wininet_Ro.rc
+++ b/dll/win32/wininet/lang/wininet_Ro.rc
@@ -29,6 +29,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "Data din certificat nu este validă."
   IDS_CERT_CN_INVALID   "Numele din certificat nu corespunde cu cel al 
sitului."
   IDS_CERT_ERRORS       "Există cel puțin o problemă nespecificată de 
securitate cu acest certificat."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Ru.rc 
b/dll/win32/wininet/lang/wininet_Ru.rc
index 04b85e7eec2..14b5363db93 100644
--- a/dll/win32/wininet/lang/wininet_Ru.rc
+++ b/dll/win32/wininet/lang/wininet_Ru.rc
@@ -30,6 +30,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "Данный сертификат недействителен. Проверьте 
правильность установленного на компьютере времени."
   IDS_CERT_CN_INVALID   "Просматриваемый сертификат не соответствует названию 
сайта."
   IDS_CERT_ERRORS       "Данный сертификат поврежден, и проверить его 
подлинность невозможно."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Si.rc 
b/dll/win32/wininet/lang/wininet_Si.rc
index 453a509d132..b70d7adbf1b 100644
--- a/dll/win32/wininet/lang/wininet_Si.rc
+++ b/dll/win32/wininet/lang/wininet_Si.rc
@@ -27,6 +27,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Sq.rc 
b/dll/win32/wininet/lang/wininet_Sq.rc
index 4aafff7fb92..035856c07ae 100644
--- a/dll/win32/wininet/lang/wininet_Sq.rc
+++ b/dll/win32/wininet/lang/wininet_Sq.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Sr.rc 
b/dll/win32/wininet/lang/wininet_Sr.rc
index 797c8aacee2..19ee56ac774 100644
--- a/dll/win32/wininet/lang/wininet_Sr.rc
+++ b/dll/win32/wininet/lang/wininet_Sr.rc
@@ -28,6 +28,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Sv.rc 
b/dll/win32/wininet/lang/wininet_Sv.rc
index dea50e57c4e..b25d3b668f9 100644
--- a/dll/win32/wininet/lang/wininet_Sv.rc
+++ b/dll/win32/wininet/lang/wininet_Sv.rc
@@ -25,6 +25,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Tr.rc 
b/dll/win32/wininet/lang/wininet_Tr.rc
index aaefaf8a28b..9249bf9ee5c 100644
--- a/dll/win32/wininet/lang/wininet_Tr.rc
+++ b/dll/win32/wininet/lang/wininet_Tr.rc
@@ -27,6 +27,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "Onay belgesindeki zaman geçersiz."
   IDS_CERT_CN_INVALID   "Onay belgesindeki ad siteyle uyuşmuyor."
   IDS_CERT_ERRORS       "Bu onay belgesiyle en az bir belirtilmemiş güvenlik 
sorunu var."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Uk.rc 
b/dll/win32/wininet/lang/wininet_Uk.rc
index 0691ad719bb..7aab43df6e6 100644
--- a/dll/win32/wininet/lang/wininet_Uk.rc
+++ b/dll/win32/wininet/lang/wininet_Uk.rc
@@ -31,6 +31,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "The date on the certificate is invalid."
   IDS_CERT_CN_INVALID   "The name on the certificate does not match the site."
   IDS_CERT_ERRORS       "There is at least one unspecified security problem 
with this certificate."
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/lang/wininet_Zh.rc 
b/dll/win32/wininet/lang/wininet_Zh.rc
index 8e6e2418cca..46adbc8b3d9 100644
--- a/dll/win32/wininet/lang/wininet_Zh.rc
+++ b/dll/win32/wininet/lang/wininet_Zh.rc
@@ -31,6 +31,17 @@ STRINGTABLE
   IDS_CERT_DATE_INVALID "证书上的日期是无效的。"
   IDS_CERT_CN_INVALID   "证书上的名称与该站点不匹配。"
   IDS_CERT_ERRORS       "还有与此证书的至少一个未指定的安全问题。"
+  IDS_CERT_SUBJECT      "Subject"
+  IDS_CERT_ISSUER       "Issuer"
+  IDS_CERT_EFFECTIVE    "Effective Date"
+  IDS_CERT_EXPIRATION   "Expiration Date"
+  IDS_CERT_PROTOCOL     "Security Protocol"
+  IDS_CERT_SIGNATURE    "Signature Type"
+  IDS_CERT_ENCRYPTION   "Encryption Type"
+  IDS_CERT_PRIVACY      "Privacy Strength"
+  IDS_CERT_HIGH         "High"
+  IDS_CERT_LOW          "Low"
+  IDS_CERT_BITS         "bits"
 }
 
 IDD_PROXYDLG DIALOGEX 36, 24, 220, 146
diff --git a/dll/win32/wininet/resource.h b/dll/win32/wininet/resource.h
index d1fa2fbceed..d21ea470454 100644
--- a/dll/win32/wininet/resource.h
+++ b/dll/win32/wininet/resource.h
@@ -40,3 +40,14 @@
 #define IDS_CERT_DATE_INVALID 0x502
 #define IDS_CERT_CN_INVALID   0x503
 #define IDS_CERT_ERRORS       0x504
+#define IDS_CERT_SUBJECT      0x505
+#define IDS_CERT_ISSUER       0x506
+#define IDS_CERT_EFFECTIVE    0x507
+#define IDS_CERT_EXPIRATION   0x508
+#define IDS_CERT_PROTOCOL     0x509
+#define IDS_CERT_SIGNATURE    0x50a
+#define IDS_CERT_ENCRYPTION   0x50b
+#define IDS_CERT_PRIVACY      0x50c
+#define IDS_CERT_HIGH         0x50d
+#define IDS_CERT_LOW          0x50e
+#define IDS_CERT_BITS         0x50f
diff --git a/modules/rostests/winetests/wininet/http.c 
b/modules/rostests/winetests/wininet/http.c
index 39ca8fde4be..725a1882d24 100644
--- a/modules/rostests/winetests/wininet/http.c
+++ b/modules/rostests/winetests/wininet/http.c
@@ -171,6 +171,26 @@ static INTERNET_STATUS_CALLBACK (WINAPI 
*pInternetSetStatusCallbackA)(HINTERNET
 static INTERNET_STATUS_CALLBACK (WINAPI 
*pInternetSetStatusCallbackW)(HINTERNET ,INTERNET_STATUS_CALLBACK);
 static BOOL (WINAPI 
*pInternetGetSecurityInfoByURLA)(LPSTR,PCCERT_CHAIN_CONTEXT*,DWORD*);
 
+static BOOL is_lang_english(void)
+{
+    static HMODULE hkernel32 = NULL;
+    static LANGID (WINAPI *pGetThreadUILanguage)(void) = NULL;
+    static LANGID (WINAPI *pGetUserDefaultUILanguage)(void) = NULL;
+
+    if (!hkernel32)
+    {
+        hkernel32 = GetModuleHandleA("kernel32.dll");
+        pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, 
"GetThreadUILanguage");
+        pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, 
"GetUserDefaultUILanguage");
+    }
+    if (pGetThreadUILanguage)
+        return PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH;
+    if (pGetUserDefaultUILanguage)
+        return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH;
+
+    return PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH;
+}
+
 static int strcmp_wa(LPCWSTR strw, const char *stra)
 {
     WCHAR buf[512];
@@ -6132,6 +6152,58 @@ static const cert_struct_test_t test_winehq_com_cert = {
     "[email protected]"
 };
 
+static const char *cert_string_fmt =
+    "Subject:\r\n%s\r\n"
+    "Issuer:\r\n%s\r\n"
+    "Effective Date:\t%s %s\r\n"
+    "Expiration Date:\t%s %s\r\n"
+    "Security Protocol:\t%s\r\n"
+    "Signature Type:\t%s\r\n"
+    "Encryption Type:\t%s\r\n"
+    "Privacy Strength:\t%s (%u bits)";
+
+static void test_cert_struct_string(HINTERNET req, const 
INTERNET_CERTIFICATE_INFOA *info)
+{
+    SYSTEMTIME start, expiry;
+    char expiry_date[32];
+    char expiry_time[32];
+    char start_date[32];
+    char start_time[32];
+    char expect[512];
+    char actual[512];
+    DWORD size;
+    BOOL res;
+
+    size = sizeof(actual);
+    SetLastError(0xdeadbeef);
+    memset(actual, 0x55, sizeof(actual));
+    res = InternetQueryOptionA(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
actual, &size);
+    ok(res, "InternetQueryOption failed: %u\n", GetLastError());
+
+    FileTimeToSystemTime(&info->ftStart, &start);
+    FileTimeToSystemTime(&info->ftExpiry, &expiry);
+
+    GetDateFormatA(LOCALE_USER_DEFAULT, 0, &start, NULL, start_date, 
sizeof(start_date));
+    GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &start, NULL, start_time, 
sizeof(start_time));
+    GetDateFormatA(LOCALE_USER_DEFAULT, 0, &expiry, NULL, expiry_date, 
sizeof(expiry_date));
+    GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &expiry, NULL, expiry_time, 
sizeof(expiry_time));
+
+    snprintf(expect, sizeof(expect), cert_string_fmt, info->lpszSubjectInfo, 
info->lpszIssuerInfo,
+             start_date, start_time, expiry_date, expiry_time,
+             info->lpszSignatureAlgName, info->lpszEncryptionAlgName, 
info->lpszProtocolName,
+             info->dwKeySize >= 128 ? "High" : "Low", info->dwKeySize);
+    ok(size == strlen(actual), "size = %u\n", size);
+    ok(!strcmp(actual, expect), "expected:\n%s\nactual:\n%s\n", expect, 
actual);
+
+    --size;
+    SetLastError(0xdeadbeef);
+    memset(actual, 0x55, sizeof(actual));
+    res = InternetQueryOptionA(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
actual, &size);
+    ok(!res && GetLastError() == ERROR_INSUFFICIENT_BUFFER, 
"InternetQueryOption failed: %d\n", GetLastError());
+    ok(size == 1, "unexpected size: %u\n", size);
+    ok(actual[0] == 0x55, "unexpected byte: %02x\n", actual[0]);
+}
+
 static void test_cert_struct(HINTERNET req, const cert_struct_test_t *test)
 {
     INTERNET_CERTIFICATE_INFOA info;
@@ -6158,6 +6230,10 @@ static void test_cert_struct(HINTERNET req, const 
cert_struct_test_t *test)
     ok(!info.lpszProtocolName, "lpszProtocolName = %s\n", 
info.lpszProtocolName);
     ok(info.dwKeySize >= 128 && info.dwKeySize <= 256, "dwKeySize = %u\n", 
info.dwKeySize);
 
+    if (is_lang_english())
+        test_cert_struct_string(req, &info);
+    else
+        skip("Skipping tests that are English-only\n");
     release_cert_info(&info);
 }
 
@@ -6237,7 +6313,7 @@ static void test_security_flags(void)
     INTERNET_CERTIFICATE_INFOA *cert;
     HINTERNET ses, conn, req;
     DWORD size, flags;
-    char buf[100];
+    char buf[512];
     BOOL res;
 
     if (!https_support)
@@ -6398,6 +6474,30 @@ static void test_security_flags(void)
     }
     HeapFree(GetProcessHeap(), 0, cert);
 
+    SetLastError(0xdeadbeef);
+    res = InternetQueryOptionW(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
NULL, NULL);
+    ok(!res && GetLastError() == ERROR_INVALID_PARAMETER, "InternetQueryOption 
failed: %d\n", GetLastError());
+
+    size = 0;
+    SetLastError(0xdeadbeef);
+    res = InternetQueryOptionW(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
NULL, &size);
+    ok(!res && GetLastError() == ERROR_INSUFFICIENT_BUFFER, 
"InternetQueryOption failed: %d\n", GetLastError());
+    ok(size == 1, "unexpected size: %u\n", size);
+
+    size = 42;
+    SetLastError(0xdeadbeef);
+    memset(buf, 0x55, sizeof(buf));
+    res = InternetQueryOptionW(req, INTERNET_OPTION_SECURITY_CERTIFICATE, buf, 
&size);
+    ok(!res && GetLastError() == ERROR_INSUFFICIENT_BUFFER, 
"InternetQueryOption failed: %d\n", GetLastError());
+    ok(size == 1, "unexpected size: %u\n", size);
+    ok(buf[0] == 0x55, "unexpected byte: %02x\n", buf[0]);
+
+    size = sizeof(buf);
+    SetLastError(0xdeadbeef);
+    res = InternetQueryOptionW(req, INTERNET_OPTION_SECURITY_CERTIFICATE, buf, 
&size);
+    ok(res && GetLastError() == ERROR_SUCCESS, "InternetQueryOption failed: 
%d\n", GetLastError());
+    ok(size < sizeof(buf), "unexpected size: %u\n", size);
+
     ros_skip_flaky
     CHECK_NOTIFIED2(INTERNET_STATUS_CONNECTING_TO_SERVER, 2);
     CHECK_NOTIFIED2(INTERNET_STATUS_CONNECTED_TO_SERVER, 2);
@@ -6583,9 +6683,10 @@ static void test_secure_connection(void)
     static const WCHAR get[] = {'G','E','T',0};
     static const WCHAR testpage[] = 
{'/','t','e','s','t','s','/','h','e','l','l','o','.','h','t','m','l',0};
     HINTERNET ses, con, req;
-    DWORD size, flags, err;
+    DWORD size, size2, flags, err;
     INTERNET_CERTIFICATE_INFOA *certificate_structA = NULL;
     INTERNET_CERTIFICATE_INFOW *certificate_structW = NULL;
+    char certstr1[512], certstr2[512];
     BOOL ret;
 
     ses = InternetOpenA("Gizmo5", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
@@ -6650,6 +6751,19 @@ static void test_secure_connection(void)
     }
     HeapFree(GetProcessHeap(), 0, certificate_structW);
 
+    SetLastError(0xdeadbeef);
+    size = sizeof(certstr1);
+    ret = InternetQueryOptionW(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
certstr1, &size);
+    ok(ret && GetLastError() == ERROR_SUCCESS, "InternetQueryOption failed: 
%d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    size2 = sizeof(certstr2);
+    ret = InternetQueryOptionA(req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
certstr2, &size2);
+    ok(ret && GetLastError() == ERROR_SUCCESS, "InternetQueryOption failed: 
%d\n", GetLastError());
+
+    ok(size == size2, "expected same size\n");
+    ok(!strcmp(certstr1, certstr2), "expected same string\n");
+
     InternetCloseHandle(req);
     InternetCloseHandle(con);
     InternetCloseHandle(ses);
@@ -7538,6 +7652,37 @@ static void test_concurrent_header_access(void)
     CloseHandle( wait );
 }
 
+static void test_cert_string(void)
+{
+    HINTERNET ses, con, req;
+    char actual[512];
+    DWORD size;
+    BOOL res;
+
+    ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 );
+    ok( ses != NULL, "InternetOpenA failed\n" );
+
+    con = InternetConnectA( ses, "test.winehq.org", 
INTERNET_DEFAULT_HTTP_PORT, NULL, NULL,
+                            INTERNET_SERVICE_HTTP, 0, 0 );
+    ok( con != NULL, "InternetConnectA failed %u\n", GetLastError() );
+
+    req = HttpOpenRequestA( con, NULL, "/", NULL, NULL, NULL, 0, 0 );
+    ok( req != NULL, "HttpOpenRequestA failed %u\n", GetLastError() );
+
+    size = sizeof(actual);
+    SetLastError( 0xdeadbeef );
+    memset( actual, 0x55, sizeof(actual) );
+    res = InternetQueryOptionA( req, INTERNET_OPTION_SECURITY_CERTIFICATE, 
actual, &size );
+    ok( !res && GetLastError() == ERROR_INTERNET_INVALID_OPERATION,
+        "InternetQueryOption failed: %u\n", GetLastError() );
+    ok( size == 0, "unexpected size: %u\n", size );
+    ok( actual[0] == 0x55, "unexpected byte: %02x\n", actual[0] );
+
+    InternetCloseHandle( req );
+    InternetCloseHandle( con );
+    InternetCloseHandle( ses );
+}
+
 START_TEST(http)
 {
     HMODULE hdll;
@@ -7594,5 +7739,6 @@ START_TEST(http)
     test_connection_failure();
     test_default_service_port();
     test_concurrent_header_access();
+    test_cert_string();
     free_events();
 }
diff --git a/sdk/tools/winesync/wininet.cfg b/sdk/tools/winesync/wininet.cfg
index c9a256e7d6f..5e68252160e 100644
--- a/sdk/tools/winesync/wininet.cfg
+++ b/sdk/tools/winesync/wininet.cfg
@@ -5,4 +5,4 @@ files:
   include/wininet.h: sdk/include/psdk/wininet.h
   include/winineti.h: sdk/include/psdk/winineti.h
 tags:
-  wine: 99c0ab2ea1f912ee699e307a77f26822dfef7b06
+  wine: ef88a70fa775f3e7a26d8f1618f32ee94bb9ea05

Reply via email to