changeset 19987:4f870bb6d3e6

- Fix ssl-nss x509 to properly convert NSPR PRTime to time_t (in English, this means that x509_times works now)
author William Ehlhardt <williamehlhardt@gmail.com>
date Thu, 13 Sep 2007 03:44:47 +0000
parents 4840b100e14f
children 47f2becb7a60
files libpurple/plugins/ssl/ssl-nss.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/ssl/ssl-nss.c	Thu Sep 13 03:16:23 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-nss.c	Thu Sep 13 03:44:47 2007 +0000
@@ -668,11 +668,14 @@
 						&nss_activ, &nss_expir),
 		FALSE);
 
+	/* NSS's native PRTime type *almost* corresponds to time_t; however,
+	   it measures *microseconds* since the epoch, not seconds. Hence
+	   the funny conversion. */
 	if (activation) {
-		*activation = nss_activ;
+		*activation = nss_activ / 1000000;
 	}
 	if (expiration) {
-		*expiration = nss_expir;
+		*expiration = nss_expir / 1000000;
 	}
 	
 	return TRUE;