diff options
Diffstat (limited to 'src/libstrongswan/crypto/x509.c')
-rwxr-xr-x | src/libstrongswan/crypto/x509.c | 12 |
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; + } } /** |