mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 409091, SSL Client Auth prompt should indicate port number r=rrelyea, a1.9=mtschrep
This commit is contained in:
parent
aeabf2b45f
commit
48937de428
@ -2547,8 +2547,27 @@ SECStatus nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket,
|
||||
|
||||
/* Get CN and O of the subject and O of the issuer */
|
||||
char *ccn = CERT_GetCommonName(&serverCert->subject);
|
||||
charCleaner ccnCleaner(ccn);
|
||||
NS_ConvertUTF8toUTF16 cn(ccn);
|
||||
if (ccn) PORT_Free(ccn);
|
||||
|
||||
PRInt32 port;
|
||||
info->GetPort(&port);
|
||||
char *hostname = SSL_RevealURL(socket);
|
||||
charCleaner hostnameCleaner(hostname);
|
||||
|
||||
nsString cn_host_port;
|
||||
if (ccn && strcmp(ccn, hostname) == 0) {
|
||||
cn_host_port.Append(cn);
|
||||
cn_host_port.AppendLiteral(":");
|
||||
cn_host_port.AppendInt(port);
|
||||
}
|
||||
else {
|
||||
cn_host_port.Append(cn);
|
||||
cn_host_port.AppendLiteral(" (");
|
||||
cn_host_port.AppendLiteral(":");
|
||||
cn_host_port.AppendInt(port);
|
||||
cn_host_port.AppendLiteral(")");
|
||||
}
|
||||
|
||||
char *corg = CERT_GetOrgName(&serverCert->subject);
|
||||
NS_ConvertUTF8toUTF16 org(corg);
|
||||
@ -2615,7 +2634,7 @@ SECStatus nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket,
|
||||
rv = NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
else {
|
||||
rv = dialogs->ChooseCertificate(info, cn.get(), org.get(), issuer.get(),
|
||||
rv = dialogs->ChooseCertificate(info, cn_host_port.get(), org.get(), issuer.get(),
|
||||
(const PRUnichar**)certNicknameList, (const PRUnichar**)certDetailsList,
|
||||
CertsToUse, &selectedIndex, &canceled);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user