summaryrefslogtreecommitdiff
path: root/src/ne_gnutls.c
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-02-28 22:27:11 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-02-28 22:27:11 +0000
commitb8181d90bded31ea9dbdcae5b1c55ad187f220f6 (patch)
treee58556867e60f5c4aa38ea7d2aad2952d12c37a8 /src/ne_gnutls.c
parent30f4dc92be52557850dff1de6f59386e75a652cc (diff)
downloadneon-b8181d90bded31ea9dbdcae5b1c55ad187f220f6.tar.gz
Formalize the date formatting by ne_ssl_cert_validity and add
ne_ssl_cert_validity_time, which is better for i18n: * src/ne_ssl.h (ne_ssl_cert_validity): Adopt a fixed format for returned date. (ne_ssl_cert_validity_time): New prototype. * src/ne_openssl.c (asn1time_to_timet, ne_ssl_cert_validity_time): New functions. * src/ne_gnutls.c (ne_ssl_cert_validity_time): New function. * src/ne_session.c (ne_ssl_cert_validity): New function. * src/ne_stubssl.c (ne_ssl_cert_validity_time): New stub. * test/ssl.c (cert_validity): Adjust for new date formatting. * macros/neon.m4 (LIBNEON_SOURCE_CHECKS): Check for timezone global. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@968 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src/ne_gnutls.c')
-rw-r--r--src/ne_gnutls.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ne_gnutls.c b/src/ne_gnutls.c
index eb30dcb..2e02bb3 100644
--- a/src/ne_gnutls.c
+++ b/src/ne_gnutls.c
@@ -182,17 +182,14 @@ void ne_ssl_clicert_free(ne_ssl_client_cert *cc)
ne_free(cc);
}
-void ne_ssl_cert_validity(const ne_ssl_certificate *cert,
- char *from, char *until)
+void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert,
+ time_t *from, time_t *until)
{
-#warning FIXME strftime not portable
if (from) {
- time_t t = gnutls_x509_crt_get_activation_time(cert->subject);
- strftime(from, NE_SSL_VDATELEN, "%b %d %H:%M:%S %Y %Z", localtime(&t));
+ *from = gnutls_x509_crt_get_activation_time(cert->subject);
}
if (until) {
- time_t t = gnutls_x509_crt_get_expiration_time(cert->subject);
- strftime(until, NE_SSL_VDATELEN, "%b %d %H:%M:%S %Y %Z", localtime(&t));
+ *until = gnutls_x509_crt_get_expiration_time(cert->subject);
}
}