aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-07-07 12:25:25 +0000
committerMartin Willi <martin@strongswan.org>2006-07-07 12:25:25 +0000
commitaf2faa1f1d9fd95089da609ae7fd9a5670e41950 (patch)
tree381a514a8f474ebc8677ef0299120172779b8686 /src
parentc71d53ba4eafc91f539ab731bdf393b0f0c407d9 (diff)
downloadstrongswan-af2faa1f1d9fd95089da609ae7fd9a5670e41950.tar.bz2
strongswan-af2faa1f1d9fd95089da609ae7fd9a5670e41950.tar.xz
reenabled check_expiry
Diffstat (limited to 'src')
-rwxr-xr-xsrc/libstrongswan/crypto/x509.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstrongswan/crypto/x509.c b/src/libstrongswan/crypto/x509.c
index 79804bd64..8a55255e4 100755
--- a/src/libstrongswan/crypto/x509.c
+++ b/src/libstrongswan/crypto/x509.c
@@ -1097,7 +1097,8 @@ char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
{
return strict? "fatal (expired)" : "warning (expired)";
}
-/* {
+
+ {
static char buf[35];
const char* unit = "second";
@@ -1120,11 +1121,10 @@ char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
unit = "minute";
}
snprintf(buf, sizeof(buf), "warning (expires in %d %s%s)", time_left, unit, (time_left == 1)?"":"s");
-} */
- /* TODO: check_expiry from pluto is a hack: it returns a buffer to its stack.
- * this is dangerous and may cause crashes! Reimplement this another way!!!
- */
- return "warning (expires in under 30days)";
+
+ /* TODO: This is not thread save and may result in corrupted strings. Rewrite this! */
+ return buf;
+ }
}
/**