From: Alan T. DeKok Date: Wed, 8 Mar 2017 22:20:16 +0000 (-0500) Subject: rename and export tls_asn1time_to_epoch() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b70827e80925cc930738c785fa45ecd2adf89701;p=thirdparty%2Ffreeradius-server.git rename and export tls_asn1time_to_epoch() --- diff --git a/src/include/tls-h b/src/include/tls-h index 18b68cea658..43e08e90cd2 100644 --- a/src/include/tls-h +++ b/src/include/tls-h @@ -450,6 +450,8 @@ int tls_ocsp_check(REQUEST *request, SSL *ssl, X509_STORE *store, X509 *issuer_cert, X509 *client_cert, fr_tls_ocsp_conf_t *conf, bool staple_response); +int tls_asn1time_to_epoch(time_t *out, ASN1_TIME const *asn1); + /* * tls/session.c */ diff --git a/src/main/tls/ocsp.c b/src/main/tls/ocsp.c index e1207ac1987..791ffa1de13 100644 --- a/src/main/tls/ocsp.c +++ b/src/main/tls/ocsp.c @@ -56,7 +56,8 @@ typedef enum { * - 0 success. * - -1 on failure. */ -static int ocsp_asn1time_to_epoch(time_t *out, ASN1_TIME const *asn1){ +int tls_asn1time_to_epoch(time_t *out, ASN1_TIME const *asn1) +{ struct tm t; char const *p = (char const *)asn1->data, *end = p + strlen(p); @@ -601,7 +602,7 @@ int tls_ocsp_check(REQUEST *request, SSL *ssl, * on the code path, other times we don't. */ if (now.tv_sec == 0) gettimeofday(&now, NULL); - if (ocsp_asn1time_to_epoch(&next, next_update) < 0) { + if (tls_asn1time_to_epoch(&next, next_update) < 0) { REDEBUG("Failed parsing next_update time: %s", fr_strerror()); ocsp_status = OCSP_STATUS_SKIPPED; goto finish;