diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-11 05:12:42 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-11 05:12:42 +0000 |
commit | b493c0b94f9f3db42fe67c1ae233978737ccdf58 (patch) | |
tree | 121506e929a0f4bd7a6138b2298dddf496a41d83 /net | |
parent | 5d9758a0de718ac4118d22c67de605ca62f639c1 (diff) | |
download | chromium_src-b493c0b94f9f3db42fe67c1ae233978737ccdf58.zip chromium_src-b493c0b94f9f3db42fe67c1ae233978737ccdf58.tar.gz chromium_src-b493c0b94f9f3db42fe67c1ae233978737ccdf58.tar.bz2 |
Enable extra logging when using client certificates on Windows via NSS
BUG=62027
TEST=None
Review URL: http://codereview.chromium.org/4709005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/socket/ssl_client_socket_nss.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index a9b8822..917990a 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -1675,6 +1675,54 @@ SECStatus SSLClientSocketNSS::PlatformClientAuthHandler( if (that->ssl_config_.client_cert) { PCCERT_CONTEXT cert_context = that->ssl_config_.client_cert->os_cert_handle(); + if (VLOG_IS_ON(1)) { + do { + DWORD size_needed = 0; + BOOL got_info = CertGetCertificateContextProperty( + cert_context, CERT_KEY_PROV_INFO_PROP_ID, NULL, &size_needed); + if (!got_info) { + VLOG(1) << "Failed to get key prov info size " << GetLastError(); + break; + } + std::vector<BYTE> raw_info(size_needed); + got_info = CertGetCertificateContextProperty( + cert_context, CERT_KEY_PROV_INFO_PROP_ID, &raw_info[0], + &size_needed); + if (!got_info) { + VLOG(1) << "Failed to get key prov info " << GetLastError(); + break; + } + PCRYPT_KEY_PROV_INFO info = + reinterpret_cast<PCRYPT_KEY_PROV_INFO>(&raw_info[0]); + VLOG(1) << "Container Name: " << info->pwszContainerName + << "\nProvider Name: " << info->pwszProvName + << "\nProvider Type: " << info->dwProvType + << "\nFlags: " << info->dwFlags + << "\nProvider Param Count: " << info->cProvParam + << "\nKey Specifier: " << info->dwKeySpec; + } while (false); + + do { + DWORD size_needed = 0; + BOOL got_identifier = CertGetCertificateContextProperty( + cert_context, CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size_needed); + if (!got_identifier) { + VLOG(1) << "Failed to get key identifier size " + << GetLastError(); + break; + } + std::vector<BYTE> raw_id(size_needed); + got_identifier = CertGetCertificateContextProperty( + cert_context, CERT_KEY_IDENTIFIER_PROP_ID, &raw_id[0], + &size_needed); + if (!got_identifier) { + VLOG(1) << "Failed to get key identifier " << GetLastError(); + break; + } + VLOG(1) << "Key Identifier: " << base::HexEncode(&raw_id[0], + size_needed); + } while (false); + } HCRYPTPROV provider = NULL; DWORD key_spec = AT_KEYEXCHANGE; BOOL must_free = FALSE; |