113 |
} |
} |
114 |
|
|
115 |
|
|
116 |
|
/* Initialize a datepicker control with the time given in @t. */ |
117 |
|
static void |
118 |
|
init_datepicker_from_time (HWND picker, time_t t) |
119 |
|
{ |
120 |
|
SYSTEMTIME st; |
121 |
|
struct tm *tm; |
122 |
|
|
123 |
|
tm = localtime (&t); |
124 |
|
memset (&st, 0, sizeof st); |
125 |
|
st.wYear = tm->tm_year+1900; |
126 |
|
st.wMonth = tm->tm_mon+1; |
127 |
|
st.wDay = tm->tm_mday; |
128 |
|
DateTime_SetSystemtime (picker, GDT_VALID, &st); |
129 |
|
} |
130 |
|
|
131 |
|
|
132 |
/* Dialog box procedure to display the signature properties. */ |
/* Dialog box procedure to display the signature properties. */ |
133 |
BOOL CALLBACK |
BOOL CALLBACK |
134 |
sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
158 |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
159 |
SetDlgItemText (dlg, IDC_SIGPROPS_CLASSINF, _("Class")); |
SetDlgItemText (dlg, IDC_SIGPROPS_CLASSINF, _("Class")); |
160 |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPSTR, _("Expire date")); |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPSTR, _("Expire date")); |
161 |
|
SetDlgItemText (dlg, IDC_SIGPROPS_CREATSTR, _("Creation date")); |
162 |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYINF, _("Issuer key")); |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYINF, _("Issuer key")); |
163 |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYIDINF, _("Issuer key ID")); |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYIDINF, _("Issuer key ID")); |
164 |
SetDlgItemText (dlg, IDC_SIGPROPS_POLICINF, _("Policy URL")); |
SetDlgItemText (dlg, IDC_SIGPROPS_POLICINF, _("Policy URL")); |
192 |
else |
else |
193 |
s = _(" user ID not found"); |
s = _(" user ID not found"); |
194 |
SetDlgItemText (dlg, IDC_SIGPROPS_ISSUER, s); |
SetDlgItemText (dlg, IDC_SIGPROPS_ISSUER, s); |
195 |
|
|
196 |
|
init_datepicker_from_time (GetDlgItem (dlg, IDC_SIGPROPS_CREATDATE), |
197 |
|
ks->timestamp); |
198 |
if (ks->expires == 0) { |
if (ks->expires == 0) { |
199 |
ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPSTR), SW_HIDE); |
ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPSTR), SW_HIDE); |
200 |
ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), SW_HIDE); |
ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), SW_HIDE); |
201 |
} |
} |
202 |
else { |
else { |
203 |
SYSTEMTIME st; |
init_datepicker_from_time (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), |
204 |
struct tm *tm; |
ks->expires); |
205 |
time_t now = time (NULL); |
if (time (NULL) > ks->expires) |
|
time_t tmp = ks->expires; |
|
|
|
|
|
tm = localtime (&tmp); |
|
|
memset (&st, 0, sizeof st); |
|
|
st.wYear = tm->tm_year+1900; |
|
|
st.wMonth = tm->tm_mon+1; |
|
|
st.wDay = tm->tm_mday; |
|
|
DateTime_SetSystemtime (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), |
|
|
GDT_VALID, &st); |
|
|
|
|
|
if (now > ks->expires) |
|
206 |
ctx.expired = 1; |
ctx.expired = 1; |
207 |
if (ctx.expired) |
if (ctx.expired) |
208 |
CheckDlgButton (dlg, IDC_SIGPROPS_EXPIRED, BST_CHECKED); |
CheckDlgButton (dlg, IDC_SIGPROPS_EXPIRED, BST_CHECKED); |