mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-29 12:53:23 +02:00
wolfSSL_get_ocsp_producedDate*(): gate on !defined(NO_ASN_TIME), and in client_test(), gate call to strftime() on HAVE_STRFTIME and add fallback code; add HAVE_STRFTIME test to configure.ac.
This commit is contained in:
@@ -3007,14 +3007,24 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
||||
|
||||
showPeerEx(ssl, lng_index);
|
||||
|
||||
#ifdef HAVE_OCSP
|
||||
#if defined(HAVE_OCSP) && !defined(NO_ASN_TIME)
|
||||
#ifdef HAVE_STRFTIME
|
||||
{
|
||||
struct tm tm;
|
||||
char date[32];
|
||||
ret = wolfSSL_get_ocsp_producedDate_tm(ssl, &tm);
|
||||
if ((ret == 0) && (strftime(date, sizeof date, "%Y-%m-%d %H:%M:%S %z",&tm) > 0))
|
||||
printf("OCSP response timestamp: %s\n",date);
|
||||
if ((ret == 0) && (strftime(date, sizeof date, "%Y-%m-%d %H:%M:%S %z", &tm) > 0))
|
||||
printf("OCSP response timestamp: %s\n", date);
|
||||
}
|
||||
#else
|
||||
{
|
||||
byte date[MAX_DATE_SIZE];
|
||||
int asn_date_format;
|
||||
ret = wolfSSL_get_ocsp_producedDate(ssl, date, sizeof date, &asn_date_format);
|
||||
if (ret == 0)
|
||||
printf("OCSP response timestamp: %s (ASN.1 type %d)\n", (char *)date, asn_date_format);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
|
||||
Reference in New Issue
Block a user