merging changes from portability branch back to trunk

important change for developers: %Y replaces %D to print identities!
This commit is contained in:
Tobias Brunner
2009-04-30 11:37:54 +00:00
parent 466f11bfaf
commit d24a74c5b4
120 changed files with 1409 additions and 3053 deletions
+10 -3
View File
@@ -307,8 +307,8 @@ u_int asn1_length(chunk_t *blob)
*/
time_t asn1_to_time(const chunk_t *utctime, asn1_t type)
{
struct tm t;
time_t tc, tz_offset;
struct tm t, local;
time_t tc, tz_offset, now;
u_char *eot = NULL;
if ((eot = memchr(utctime->ptr, 'Z', utctime->len)) != NULL)
@@ -375,9 +375,16 @@ time_t asn1_to_time(const chunk_t *utctime, asn1_t type)
/* convert to time_t */
tc = mktime(&t);
if (tc == -1)
{
return TIME_MAX;
}
/* if no conversion overflow occurred, compensate timezone */
return (tc == -1) ? TIME_MAX : (tc - timezone - tz_offset);
now = time(NULL);
localtime_r(&now, &local);
return tc - local.tm_gmtoff - tz_offset;
}
/**
+1
View File
@@ -32,6 +32,7 @@ print OID_H "/* Object identifiers (OIDs) used by strongSwan\n",
" * ", $automatic, "\n",
" * ", $warning, "\n",
" */\n\n",
"#include <sys/types.h>\n\n",
"#ifndef OID_H_\n",
"#define OID_H_\n\n",
"typedef struct {\n",