X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/clxutils/clAppUtils/timeStr.h diff --git a/SecurityTests/clxutils/clAppUtils/timeStr.h b/SecurityTests/clxutils/clAppUtils/timeStr.h deleted file mode 100644 index 7d1548a2..00000000 --- a/SecurityTests/clxutils/clAppUtils/timeStr.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _TIME_STR_H_ -#define _TIME_STR_H_ - -#include -#include - -#define UTC_TIME_STRLEN 13 -#define CSSM_TIME_STRLEN 14 /* no trailing 'Z' */ -#define GENERALIZED_TIME_STRLEN 15 - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Given a string containing either a UTC-style or "generalized time" - * time string, convert to a struct tm (in GMT/UTC). Returns nonzero on - * error. - */ -int appTimeStringToTm( - const char *str, - unsigned len, - struct tm *tmp); - -typedef enum { - TIME_UTC, - TIME_CSSM, - TIME_GEN -} timeSpec; - -/* Caller must CSSM_FREE() the resulting string */ -char *appTimeAtNowPlus(int secFromNow, - timeSpec timeSpec); - -/*** for backwards compatibility ***/ - -/* - * Malloc and return UTC (2-digit year) time string, for time with specified - * offset from present. This uses the stdlib gmtime(), which is not thread safe. - * Even though this function protects the call with a lock, the TP also uses - * gmtime. It also does the correct locking for its own calls to gmtime()Êbut - * the is no way to synchronize TP's calls to gmtime() with the calls to this - * one other than only using this one when no threads might be performing TP ops. - */ -char *utcAtNowPlus(int secFromNow); - -/* - * Same thing, generalized time (4-digit year). - */ -char *genTimeAtNowPlus(int secFromNow); - -/* - * Free the string obtained from the above. - */ -void freeTimeString(char *timeStr); - -char *x509TimeToCssmTimestring( - const CSSM_X509_TIME *x509Time, - unsigned *rtnLen); // for caller's convenience - -#ifdef __cplusplus -} -#endif - -#endif /* _TIME_STR_H_ */