Rename <openssl/time.h> to <openssl/posix_time.h>
There's a desire to upstream this in a compatible way to other projects so they can use the same public API as us, however for some C based build systems having an include file potentially on the include path that can end up being picked up when you include <time.h> is problematic and annoying, so let's just avoid the unnecessary pain. Update-Note: <openssl/time.h> has moved to <openssl/posix_time.h> Change-Id: I7c6aa92e95a10ff65275851fcf596b06e4848789 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/65847 Commit-Queue: Bob Beck <bbe@google.com> Auto-Submit: Bob Beck <bbe@google.com> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
committed by
Boringssl LUCI CQ
parent
625f68bf35
commit
db7308de87
@@ -58,7 +58,7 @@
|
||||
#include <openssl/bytestring.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
* [including the GNU Public Licence.] */
|
||||
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include <openssl/bytestring.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/obj.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/posix_time.h>
|
||||
#include <openssl/span.h>
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#include "../test/test_util.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Time conversion to/from POSIX time_t and struct tm, with no support
|
||||
// for time zones other than UTC
|
||||
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/* Copyright (c) 2022, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#ifndef OPENSSL_HEADER_POSIX_TIME_H
|
||||
#define OPENSSL_HEADER_POSIX_TIME_H
|
||||
|
||||
#include <openssl/base.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// Time functions.
|
||||
|
||||
|
||||
// OPENSSL_posix_to_tm converts a int64_t POSIX time value in |time|, which must
|
||||
// be in the range of year 0000 to 9999, to a broken out time value in |tm|. It
|
||||
// returns one on success and zero on error.
|
||||
OPENSSL_EXPORT int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);
|
||||
|
||||
// OPENSSL_tm_to_posix converts a time value between the years 0 and 9999 in
|
||||
// |tm| to a POSIX time value in |out|. One is returned on success, zero is
|
||||
// returned on failure. It is a failure if |tm| contains out of range values.
|
||||
OPENSSL_EXPORT int OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern C
|
||||
#endif
|
||||
|
||||
#endif // OPENSSL_HEADER_POSIX_TIME_H
|
||||
+3
-26
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2022, Google Inc.
|
||||
/* Copyright (c) 2024, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -15,31 +15,8 @@
|
||||
#ifndef OPENSSL_HEADER_TIME_H
|
||||
#define OPENSSL_HEADER_TIME_H
|
||||
|
||||
#include <openssl/base.h>
|
||||
// Compatibility header, to be deprecated. use <openssl/posix_time.h> instead.
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// Time functions.
|
||||
|
||||
|
||||
// OPENSSL_posix_to_tm converts a int64_t POSIX time value in |time|, which must
|
||||
// be in the range of year 0000 to 9999, to a broken out time value in |tm|. It
|
||||
// returns one on success and zero on error.
|
||||
OPENSSL_EXPORT int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);
|
||||
|
||||
// OPENSSL_tm_to_posix converts a time value between the years 0 and 9999 in
|
||||
// |tm| to a POSIX time value in |out|. One is returned on success, zero is
|
||||
// returned on failure. It is a failure if |tm| contains out of range values.
|
||||
OPENSSL_EXPORT int OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern C
|
||||
#endif
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
#endif // OPENSSL_HEADER_TIME_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "parse_values.h"
|
||||
|
||||
#include <openssl/time.h>
|
||||
#include <openssl/posix_time.h>
|
||||
|
||||
namespace bssl::der {
|
||||
|
||||
|
||||
+2
-2
@@ -14,9 +14,9 @@
|
||||
"include/openssl/mem.h",
|
||||
"include/openssl/obj.h",
|
||||
"include/openssl/pool.h",
|
||||
"include/openssl/posix_time.h",
|
||||
"include/openssl/rand.h",
|
||||
"include/openssl/stack.h",
|
||||
"include/openssl/time.h"
|
||||
"include/openssl/stack.h"
|
||||
]
|
||||
},{
|
||||
"Name": "Low-level crypto primitives",
|
||||
|
||||
Reference in New Issue
Block a user