| 509 } |
509 } |
| 510 |
510 |
| 511 static gboolean |
511 static gboolean |
| 512 x509_check_name (PurpleCertificate *crt, const gchar *name) |
512 x509_check_name (PurpleCertificate *crt, const gchar *name) |
| 513 { |
513 { |
| |
514 CERTCertificate *crt_dat; |
| |
515 SECStatus st; |
| |
516 |
| |
517 g_return_val_if_fail(crt, FALSE); |
| |
518 g_return_val_if_fail(crt->scheme == &x509_nss, FALSE); |
| |
519 |
| |
520 crt_dat = X509_NSS_DATA(crt); |
| |
521 g_return_val_if_fail(crt_dat, FALSE); |
| |
522 |
| |
523 st = CERT_VerifyCertName(crt_dat, name); |
| |
524 |
| |
525 if (st == SECSuccess) { |
| |
526 return TRUE; |
| |
527 } |
| |
528 else if (st == SECFailure) { |
| |
529 return FALSE; |
| |
530 } |
| |
531 |
| |
532 /* If we get here...bad things! */ |
| |
533 g_assert(FALSE); |
| 514 return FALSE; |
534 return FALSE; |
| 515 } |
535 } |
| 516 |
536 |
| 517 static gboolean |
537 static gboolean |
| 518 x509_times (PurpleCertificate *crt, time_t *activation, time_t *expiration) |
538 x509_times (PurpleCertificate *crt, time_t *activation, time_t *expiration) |