cryptui: Show status for end cert in hierarchy page.

This commit is contained in:
Juan Lang 2008-12-17 09:00:58 -08:00 committed by Alexandre Julliard
parent 84a26e5c94
commit d3a61c769f
3 changed files with 42 additions and 1 deletions

View File

@ -34,6 +34,11 @@ STRINGTABLE DISCARDABLE
IDS_ISSUER_HEADING "Issued by: "
IDS_VALID_FROM "Valid from "
IDS_VALID_TO " to "
IDS_CERTIFICATE_BAD_SIGNATURE "This certificate has an invalid signature."
IDS_CERTIFICATE_BAD_TIME "This certificate has expired or is not yet valid."
IDS_CERTIFICATE_BAD_TIMENEST "This certificate's validity period exceeds that of its issuer."
IDS_CERTIFICATE_REVOKED "This certificate was revoked by its issuer."
IDS_CERTIFICATE_VALID "This certificate is OK."
IDS_FIELD "Field"
IDS_VALUE "Value"
IDS_FIELDS_ALL "<All>"

View File

@ -31,6 +31,11 @@
#define IDS_ISSUER_HEADING 1011
#define IDS_VALID_FROM 1012
#define IDS_VALID_TO 1013
#define IDS_CERTIFICATE_BAD_SIGNATURE 1014
#define IDS_CERTIFICATE_BAD_TIME 1015
#define IDS_CERTIFICATE_BAD_TIMENEST 1016
#define IDS_CERTIFICATE_REVOKED 1017
#define IDS_CERTIFICATE_VALID 1018
#define IDS_FIELD 1019
#define IDS_VALUE 1020
#define IDS_FIELDS_ALL 1021

View File

@ -1828,12 +1828,43 @@ static void show_cert_chain(HWND hwnd, struct hierarchy_data *data)
}
}
static void set_certificate_status(HWND hwnd, CRYPT_PROVIDER_CERT *cert)
{
/* Select all the text in the control, the next update will replace it */
SendMessageW(hwnd, EM_SETSEL, 0, -1);
/* Set the highest priority error messages first. */
if (!(cert->dwConfidence & CERT_CONFIDENCE_SIG))
add_string_resource_to_control(hwnd, IDS_CERTIFICATE_BAD_SIGNATURE);
else if (!(cert->dwConfidence & CERT_CONFIDENCE_TIME))
add_string_resource_to_control(hwnd, IDS_CERTIFICATE_BAD_TIME);
else if (!(cert->dwConfidence & CERT_CONFIDENCE_TIMENEST))
add_string_resource_to_control(hwnd, IDS_CERTIFICATE_BAD_TIMENEST);
else if (cert->dwRevokedReason)
add_string_resource_to_control(hwnd, IDS_CERTIFICATE_REVOKED);
else
add_string_resource_to_control(hwnd, IDS_CERTIFICATE_VALID);
}
static void set_certificate_status_for_end_cert(HWND hwnd,
PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo)
{
HWND status = GetDlgItem(hwnd, IDC_CERTIFICATESTATUSTEXT);
CRYPT_PROVIDER_SGNR *provSigner = WTHelperGetProvSignerFromChain(
(CRYPT_PROVIDER_DATA *)pCertViewInfo->u.pCryptProviderData,
pCertViewInfo->idxSigner, pCertViewInfo->fCounterSigner,
pCertViewInfo->idxCounterSigner);
CRYPT_PROVIDER_CERT *provCert = WTHelperGetProvCertFromChain(provSigner,
pCertViewInfo->idxCert);
set_certificate_status(status, provCert);
}
static void show_cert_hierarchy(HWND hwnd, struct hierarchy_data *data)
{
/* Disable view certificate button until a certificate is selected */
EnableWindow(GetDlgItem(hwnd, IDC_VIEWCERTIFICATE), FALSE);
show_cert_chain(hwnd, data);
FIXME("show cert status\n");
set_certificate_status_for_end_cert(hwnd, data->pCertViewInfo);
}
static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,