Mercurial > pidgin
comparison libpurple/plugins/ssl/ssl-nss.c @ 19073:2156321c5482
- x509_nss get_times
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Fri, 03 Aug 2007 07:43:40 +0000 |
parents | 4bdf4ce3473b |
children | 3004bfa0e846 |
comparison
equal
deleted
inserted
replaced
19072:4bdf4ce3473b | 19073:2156321c5482 |
---|---|
535 } | 535 } |
536 | 536 |
537 static gboolean | 537 static gboolean |
538 x509_times (PurpleCertificate *crt, time_t *activation, time_t *expiration) | 538 x509_times (PurpleCertificate *crt, time_t *activation, time_t *expiration) |
539 { | 539 { |
540 return FALSE; | 540 CERTCertificate *crt_dat; |
541 PRTime nss_activ, nss_expir; | |
542 | |
543 g_return_val_if_fail(crt, FALSE); | |
544 g_return_val_if_fail(crt->scheme == &x509_nss, FALSE); | |
545 | |
546 crt_dat = X509_NSS_DATA(crt); | |
547 g_return_val_if_fail(crt_dat, FALSE); | |
548 | |
549 /* Extract the times into ugly PRTime thingies */ | |
550 /* TODO: Maybe this shouldn't throw an error? */ | |
551 g_return_val_if_fail( | |
552 SECSuccess == CERT_GetCertTimes(crt_dat, | |
553 &nss_activ, &nss_expir), | |
554 FALSE); | |
555 | |
556 if (activation) { | |
557 *activation = nss_activ; | |
558 } | |
559 if (expiration) { | |
560 *expiration = nss_expir; | |
561 } | |
562 | |
563 return TRUE; | |
541 } | 564 } |
542 | 565 |
543 static PurpleCertificateScheme x509_nss = { | 566 static PurpleCertificateScheme x509_nss = { |
544 "x509", /* Scheme name */ | 567 "x509", /* Scheme name */ |
545 N_("X.509 Certificates"), /* User-visible scheme name */ | 568 N_("X.509 Certificates"), /* User-visible scheme name */ |