From 699e55bb0e94986bab0462b27aa8f4464c54cc35 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 16 Feb 2017 12:31:01 -0500 Subject: [PATCH] Unexport time_support.h. These are only used by crypto/asn1 and not externally. Change-Id: I2e6a28828fd81a4e3421eed1e98f0a65197f4b88 Reviewed-on: https://boringssl-review.googlesource.com/13868 Reviewed-by: David Benjamin Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/CMakeLists.txt | 1 - crypto/asn1/CMakeLists.txt | 1 + crypto/asn1/a_gentm.c | 1 - crypto/asn1/a_time.c | 1 - crypto/asn1/a_utctm.c | 1 - crypto/asn1/asn1_locl.h | 35 ++++++++++++ crypto/{ => asn1}/time_support.c | 2 +- include/openssl/time_support.h | 91 -------------------------------- util/doc.config | 3 +- 9 files changed, 38 insertions(+), 98 deletions(-) rename crypto/{ => asn1}/time_support.c (99%) delete mode 100644 include/openssl/time_support.h diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 6afb43d2..fbfc4b27 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -129,7 +129,6 @@ add_library( thread_none.c thread_pthread.c thread_win.c - time_support.c $ $ diff --git a/crypto/asn1/CMakeLists.txt b/crypto/asn1/CMakeLists.txt index 25d8ba22..cd1ee8c2 100644 --- a/crypto/asn1/CMakeLists.txt +++ b/crypto/asn1/CMakeLists.txt @@ -35,6 +35,7 @@ add_library( tasn_new.c tasn_typ.c tasn_utl.c + time_support.c x_bignum.c x_long.c ) diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 2f298689..d130cdf8 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -61,7 +61,6 @@ #include #include -#include #include "asn1_locl.h" diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index a12b38ff..4b584297 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -63,7 +63,6 @@ #include #include #include -#include #include "asn1_locl.h" diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 3b9d2570..193b83f8 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -61,7 +61,6 @@ #include #include -#include #include "asn1_locl.h" diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h index 982bfd60..ce8146bf 100644 --- a/crypto/asn1/asn1_locl.h +++ b/crypto/asn1/asn1_locl.h @@ -57,7 +57,42 @@ * */ +#ifndef OPENSSL_HEADER_ASN1_ASN1_LOCL_H +#define OPENSSL_HEADER_ASN1_ASN1_LOCL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* Wrapper functions for time functions. */ + +/* OPENSSL_gmtime wraps |gmtime_r|. See the manual page for that function. */ +struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result); + +/* OPENSSL_gmtime_adj updates |tm| by adding |offset_day| days and |offset_sec| + * seconds. */ +int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); + +/* OPENSSL_gmtime_diff calculates the difference between |from| and |to| and + * outputs the difference as a number of days and seconds in |*out_days| and + * |*out_secs|. */ +int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, + const struct tm *to); + + /* Internal ASN1 structures and functions: not for application use */ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_ASN1_ASN1_LOCL_H */ diff --git a/crypto/time_support.c b/crypto/asn1/time_support.c similarity index 99% rename from crypto/time_support.c rename to crypto/asn1/time_support.c index ae0f4963..194dc3a7 100644 --- a/crypto/time_support.c +++ b/crypto/asn1/time_support.c @@ -59,7 +59,7 @@ #define _POSIX_C_SOURCE 201410L /* for gmtime_r */ #endif -#include +#include "asn1_locl.h" #include diff --git a/include/openssl/time_support.h b/include/openssl/time_support.h deleted file mode 100644 index 274b17d1..00000000 --- a/include/openssl/time_support.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL - * project 2001. - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 2008. - */ -/* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_TIME_SUPPORT_H -#define OPENSSL_HEADER_TIME_SUPPORT_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -/* Wrapper functions for time functions. */ - - -/* OPENSSL_gmtime wraps |gmtime_r|. See the manual page for that function. */ -struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result); - -/* OPENSSL_gmtime_adj updates |tm| by adding |offset_day| days and |offset_sec| - * seconds. */ -int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); - -/* OPENSSL_gmtime_diff calculates the difference between |from| and |to| and - * outputs the difference as a number of days and seconds in |*out_days| and - * |*out_secs|. */ -int OPENSSL_gmtime_diff(int *out_days, int *out_secs, const struct tm *from, - const struct tm *to); - - -#if defined(__cplusplus) -} /* extern C */ -#endif - -#endif /* OPENSSL_HEADER_TIME_SUPPORT_H */ diff --git a/util/doc.config b/util/doc.config index ddd56db2..f7e8baa1 100644 --- a/util/doc.config +++ b/util/doc.config @@ -16,8 +16,7 @@ "include/openssl/obj.h", "include/openssl/pool.h", "include/openssl/rand.h", - "include/openssl/stack.h", - "include/openssl/time_support.h" + "include/openssl/stack.h" ] },{ "Name": "Low-level crypto primitives",