x509: valid_at matches "not after" and "not before"

Sun, 07 Nov 2010 17:12:33 -0800

author
Paul Aurich <paul@darkrain42.org>
date
Sun, 07 Nov 2010 17:12:33 -0800
changeset 27
3e0325d39a61
parent 26
bbff42d46512
child 28
8c61b29d87ec

x509: valid_at matches "not after" and "not before"

src/x509.c file | annotate | diff | comparison | revisions
--- a/src/x509.c	Sat Nov 06 15:33:26 2010 +0000
+++ b/src/x509.c	Sun Nov 07 17:12:33 2010 -0800
@@ -196,8 +196,8 @@
 {
   X509* cert = luasec_to_x509(L, 1);
   time_t time = luaL_checkinteger(L, 2);
-  lua_pushboolean(L, (X509_cmp_time(X509_get_notAfter(cert), &time) > 0
-                  && X509_cmp_time(X509_get_notBefore(cert), &time) < 0));
+  lua_pushboolean(L, (X509_cmp_time(X509_get_notAfter(cert), &time) >= 0
+                  && X509_cmp_time(X509_get_notBefore(cert), &time) <= 0));
   return 1;
 }
 

mercurial