libpurple/plugins/ssl/ssl-nss.c

branch
soc.2007.certmgr
changeset 19012
7813c38f34e9
parent 19011
21cdaee203e8
child 19013
60c74d9597f3
equal deleted inserted replaced
19011:21cdaee203e8 19012:7813c38f34e9
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)

mercurial