mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Compare commits
154
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ba619efbd | ||
|
|
958cc17b94 | ||
|
|
7120cc96ee | ||
|
|
47ca0d7d12 | ||
|
|
132a9c6842 | ||
|
|
8935371200 | ||
|
|
952168d0cb | ||
|
|
f2ade22c6c | ||
|
|
f140b6f6b2 | ||
|
|
f2464ec60c | ||
|
|
b7ff6145a6 | ||
|
|
1564e78e66 | ||
|
|
d2400028d1 | ||
|
|
3a2ceb530c | ||
|
|
c8a5b4f24b | ||
|
|
80dcfd1eb4 | ||
|
|
db07df555d | ||
|
|
de76300dcd | ||
|
|
e9ed7ded6f | ||
|
|
60d38f079b | ||
|
|
50d8a8c2b6 | ||
|
|
798fd2a5fc | ||
|
|
2d134a34df | ||
|
|
50f530b444 | ||
|
|
29acfe3f53 | ||
|
|
bf45cbe065 | ||
|
|
3d0ff7a6fa | ||
|
|
9321d6f091 | ||
|
|
803e875cdc | ||
|
|
e2e9732579 | ||
|
|
82bdcab53f | ||
|
|
b5d49a47b1 | ||
|
|
d9875e8a58 | ||
|
|
dbea3640aa | ||
|
|
2d81533e22 | ||
|
|
129701749c | ||
|
|
4ce81672e2 | ||
|
|
e6d818ee28 | ||
|
|
53eccb9321 | ||
|
|
af9e43fb5f | ||
|
|
5c8d70a512 | ||
|
|
0fae320feb | ||
|
|
9ad3bf320c | ||
|
|
56a1e41cc1 | ||
|
|
d4919c7dba | ||
|
|
f2a71a6821 | ||
|
|
b9ffe52b79 | ||
|
|
5c1fe75840 | ||
|
|
03bc8eede4 | ||
|
|
45e9405ea4 | ||
|
|
21f383924e | ||
|
|
2210ae4965 | ||
|
|
cff60c178f | ||
|
|
0d094645f7 | ||
|
|
8e85462800 | ||
|
|
d18a8aa15d | ||
|
|
24d81f89d0 | ||
|
|
5323d309df | ||
|
|
8d33352d0a | ||
|
|
c2d6ce7fd2 | ||
|
|
0f41ded533 | ||
|
|
47e7df3fe2 | ||
|
|
1c172d408a | ||
|
|
4ea900c024 | ||
|
|
d1db2aa912 | ||
|
|
8d219159c7 | ||
|
|
5ccca965c2 | ||
|
|
d4d9b85cce | ||
|
|
af22b383fc | ||
|
|
b42e561d6a | ||
|
|
5027105905 | ||
|
|
53bcdaef90 | ||
|
|
977368147d | ||
|
|
19da555275 | ||
|
|
a04e071689 | ||
|
|
8406429759 | ||
|
|
47a256af7a | ||
|
|
84b28a1f9b | ||
|
|
a14a7bbbc3 | ||
|
|
0dc238a663 | ||
|
|
4532ac986d | ||
|
|
12da6be5ad | ||
|
|
934ea6ccb0 | ||
|
|
6b05d8eac6 | ||
|
|
6b7a2785e2 | ||
|
|
3abc4ff44e | ||
|
|
03eb6a5667 | ||
|
|
81afa92400 | ||
|
|
87711319c5 | ||
|
|
607156d373 | ||
|
|
1ef5e7d56c | ||
|
|
ef5d846a47 | ||
|
|
ae78f8f429 | ||
|
|
f18168af70 | ||
|
|
9fd7c97b87 | ||
|
|
c147f2f0a2 | ||
|
|
4c6e112e9f | ||
|
|
69d2f812fd | ||
|
|
97fba7509b | ||
|
|
0401b2fb08 | ||
|
|
711db39fec | ||
|
|
c643cd842c | ||
|
|
48e4bb4379 | ||
|
|
bcd172012b | ||
|
|
352fc1abf9 | ||
|
|
b6eaf36aa3 | ||
|
|
fdc0a80de8 | ||
|
|
f137a85e48 | ||
|
|
c3102c342a | ||
|
|
702b7be467 | ||
|
|
c884ba7756 | ||
|
|
1259c0994a | ||
|
|
4ba00f725a | ||
|
|
10b26c77fe | ||
|
|
f0eb1c5531 | ||
|
|
e9131f34b8 | ||
|
|
4209a7bf2a | ||
|
|
0f4e2de7c6 | ||
|
|
52584919e7 | ||
|
|
f97f4e0b8f | ||
|
|
95ff7e4bb5 | ||
|
|
d740f83794 | ||
|
|
fbf40542f8 | ||
|
|
5bb244b0a0 | ||
|
|
985f3e4c66 | ||
|
|
44291434af | ||
|
|
860538b4fb | ||
|
|
a352cef971 | ||
|
|
5a4deb4db9 | ||
|
|
91463af35f | ||
|
|
daccc520c1 | ||
|
|
0a8c491e71 | ||
|
|
d5958b4d6d | ||
|
|
4982480b2e | ||
|
|
5bd5b97bc2 | ||
|
|
347338d6cc | ||
|
|
68742e0d2e | ||
|
|
6cbca952c3 | ||
|
|
d33226f4dc | ||
|
|
271d3b9a5b | ||
|
|
868f48f109 | ||
|
|
f757fe4a18 | ||
|
|
20991c24d0 | ||
|
|
5956f49d94 | ||
|
|
3865992e19 | ||
|
|
c905270a53 | ||
|
|
dedcd347d6 | ||
|
|
81c4c199a5 | ||
|
|
6763b01834 | ||
|
|
e68496f578 | ||
|
|
4b34e3e645 | ||
|
|
1bf567ff00 | ||
|
|
bf347bfd58 | ||
|
|
f34e7e0e50 |
No files matched your search
+11
-3
@@ -659,7 +659,7 @@ BSARGS= DESTDIR= \
|
||||
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
||||
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
||||
MK_LLDB=no MK_TESTS=no \
|
||||
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \
|
||||
MK_INCLUDES=yes
|
||||
|
||||
BMAKE= \
|
||||
@@ -680,7 +680,7 @@ TMAKE= \
|
||||
-DNO_LINT \
|
||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
||||
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
||||
MK_LLDB=no MK_TESTS=no
|
||||
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no
|
||||
|
||||
# cross-tools stage
|
||||
# TOOLS_PREFIX set in BMAKE
|
||||
@@ -703,7 +703,7 @@ KTMAKE= \
|
||||
SSP_CFLAGS= \
|
||||
MK_HTML=no -DNO_LINT MK_MAN=no \
|
||||
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
|
||||
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no
|
||||
-DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no
|
||||
|
||||
# world stage
|
||||
WMAKEENV= ${CROSSENV} \
|
||||
@@ -948,6 +948,13 @@ _cleanobj_fast_depend_hack: .PHONY
|
||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \
|
||||
fi
|
||||
.endfor
|
||||
# 20181115 r340463 bzero reimplemented as .c
|
||||
@if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \
|
||||
egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \
|
||||
echo "Removing stale dependencies for bzero"; \
|
||||
rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \
|
||||
${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \
|
||||
fi
|
||||
# 20181009 track migration from ntp's embedded libevent to updated one
|
||||
@if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \
|
||||
egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \
|
||||
@@ -2383,6 +2390,7 @@ NXBMAKEARGS+= \
|
||||
MK_OFED=no \
|
||||
MK_OPENSSH=no \
|
||||
MK_PROFILE=no \
|
||||
MK_RETPOLINE=no \
|
||||
MK_SENDMAIL=no \
|
||||
MK_SVNLITE=no \
|
||||
MK_TESTS=no \
|
||||
|
||||
+2
-1
@@ -200,7 +200,8 @@ build${libcompat}: .PHONY
|
||||
OBJTOP=${LIBCOMPAT_OBJTOP} \
|
||||
OBJROOT='$${OBJTOP}/' \
|
||||
MAKEOBJDIRPREFIX= \
|
||||
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
|
||||
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \
|
||||
MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \
|
||||
${_t}
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
@@ -38,6 +38,13 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20181030: malloc_domain(9) KPI change
|
||||
OLD_FILES+=share/man/man9/malloc_domain.9.gz
|
||||
# 20181025: OpenSSL libraries version bump to avoid conflict with ports
|
||||
OLD_LIBS+=lib/libcrypto.so.9
|
||||
OLD_LIBS+=usr/lib/libssl.so.9
|
||||
OLD_LIBS+=usr/lib32/libcrypto.so.9
|
||||
OLD_LIBS+=usr/lib32/libssl.so.9
|
||||
# 20181015: Stale libcasper(3) files following r329452
|
||||
OLD_LIBS+=lib/casper/libcap_sysctl.so.0
|
||||
OLD_LIBS+=lib/casper/libcap_grp.so.0
|
||||
@@ -51,6 +58,8 @@ OLD_LIBS+=usr/lib32/libcap_pwd.so.0
|
||||
OLD_LIBS+=usr/lib32/libcap_random.so.0
|
||||
OLD_LIBS+=usr/lib32/libcap_dns.so.0
|
||||
OLD_LIBS+=usr/lib32/libcap_syslog.so.0
|
||||
# 20181012: rename of ixlv(4) to iavf(4)
|
||||
OLD_FILES+=usr/share/man/man4/ixlv.4.gz
|
||||
# 20181009: OpenSSL 1.1.1
|
||||
OLD_FILES+=usr/include/openssl/des_old.h
|
||||
OLD_FILES+=usr/include/openssl/dso.h
|
||||
|
||||
@@ -16,20 +16,51 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to
|
||||
the tip of head, and then rebuild without this option. The bootstrap process
|
||||
from older version of current across the gcc/clang cutover is a bit fragile.
|
||||
|
||||
NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
||||
FreeBSD 12.x has many debugging features turned on, in both the kernel
|
||||
and userland. These features attempt to detect incorrect use of
|
||||
system primitives, and encourage loud failure through extra sanity
|
||||
checking and fail stop semantics. They also substantially impact
|
||||
system performance. If you want to do performance measurement,
|
||||
benchmarking, and optimization, you'll want to turn them off. This
|
||||
includes various WITNESS- related kernel options, INVARIANTS, malloc
|
||||
debugging flags in userland, and various verbose features in the
|
||||
kernel. Many developers choose to disable these features on build
|
||||
machines to maximize performance. (To completely disable malloc
|
||||
debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
20181211:
|
||||
12.0-RELEASE.
|
||||
|
||||
20181115:
|
||||
The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue)
|
||||
has been converted to a port (misc/ctm) and will be removed from
|
||||
FreeBSD-13. A depreciation warning will be printed to stderr by
|
||||
the ctm command, but the functionality will remain in base for all
|
||||
FreeBSD-12 releases.
|
||||
|
||||
20181019:
|
||||
The stable/12 branch has been created in subversion from head
|
||||
revision r339432.
|
||||
|
||||
20181015:
|
||||
Ports for the DRM modules have been simplified. Now, amd64 users should
|
||||
just install the drm-kmod port. All others should install
|
||||
drm-legacy-kmod.
|
||||
|
||||
Graphics hardware that's newer than about 2010 usually works with
|
||||
drm-kmod. For hardware older than 2013, however, some users will need
|
||||
to use drm-legacy-kmod if drm-kmod doesn't work for them. Hardware older
|
||||
than 2008 usually only works in drm-legacy-kmod. The graphics team can
|
||||
only commit to hardware made since 2013 due to the complexity of the
|
||||
market and difficulty to test all the older cards effectively. If you
|
||||
have hardware supported by drm-kmod, you are strongly encouraged to use
|
||||
that as you will get better support.
|
||||
|
||||
Other than KPI chasing, drm-legacy-kmod will not be updated. As outlined
|
||||
elsewhere, the drm and drm2 modules will be eliminated from the src base
|
||||
soon (with a limited exception for arm). Please update to the package asap
|
||||
and report any issues to [email protected].
|
||||
|
||||
Generally, anybody using the drm*-kmod packages should add
|
||||
WITHOUT_DRM_MODULE=t and WITHOUT_DRM2_MODULE=t to avoid nasty
|
||||
cross-threading surprises, especially with automatic driver
|
||||
loading from X11 startup. These will become the defaults in 13-current
|
||||
shortly.
|
||||
|
||||
20181012:
|
||||
The ixlv(4) driver has been renamed to iavf(4). As a consequence,
|
||||
custom kernel and module loading configuration files must be updated
|
||||
accordingly. Moreover, interfaces previous presented as ixlvN to the
|
||||
system are now exposed as iavfN and network configuration files must
|
||||
be adjusted as necessary.
|
||||
|
||||
20181009:
|
||||
OpenSSL has been updated to version 1.1.1. This update included
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 10, 2018
|
||||
.Dd October 26, 2018
|
||||
.Dt SETFACL 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -136,6 +136,8 @@ option is specified, no symbolic links are followed.
|
||||
This is the default.
|
||||
.It Fl R
|
||||
Perform the action recursively on any specified directories.
|
||||
When modifying or adding NFSv4 ACL entries, inheritance flags
|
||||
are applied only to directories.
|
||||
.It Fl x Ar entries | position
|
||||
If
|
||||
.Ar entries
|
||||
|
||||
+68
-13
@@ -27,9 +27,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
@@ -73,6 +71,7 @@ static bool need_mask;
|
||||
static acl_type_t acl_type = ACL_TYPE_ACCESS;
|
||||
|
||||
static int handle_file(FTS *ftsp, FTSENT *file);
|
||||
static acl_t clear_inheritance_flags(acl_t acl);
|
||||
static char **stdin_files(void);
|
||||
static void usage(void);
|
||||
|
||||
@@ -124,10 +123,57 @@ stdin_files(void)
|
||||
return (files_list);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove any inheritance flags from NFSv4 ACLs when running in recursive
|
||||
* mode. This is to avoid files being assigned identical ACLs to their
|
||||
* parent directory while also being set to inherit them.
|
||||
*
|
||||
* The acl argument is assumed to be valid.
|
||||
*/
|
||||
static acl_t
|
||||
clear_inheritance_flags(acl_t acl)
|
||||
{
|
||||
acl_t nacl;
|
||||
acl_entry_t acl_entry;
|
||||
acl_flagset_t acl_flagset;
|
||||
int acl_brand, entry_id;
|
||||
|
||||
(void)acl_get_brand_np(acl, &acl_brand);
|
||||
if (acl_brand != ACL_BRAND_NFS4)
|
||||
return (acl);
|
||||
|
||||
nacl = acl_dup(acl);
|
||||
if (nacl == NULL) {
|
||||
warn("acl_dup() failed");
|
||||
return (acl);
|
||||
}
|
||||
|
||||
entry_id = ACL_FIRST_ENTRY;
|
||||
while (acl_get_entry(nacl, entry_id, &acl_entry) == 1) {
|
||||
entry_id = ACL_NEXT_ENTRY;
|
||||
if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
|
||||
warn("acl_get_flagset_np() failed");
|
||||
continue;
|
||||
}
|
||||
if (acl_get_flag_np(acl_flagset, ACL_ENTRY_INHERIT_ONLY) == 1) {
|
||||
if (acl_delete_entry(nacl, acl_entry) != 0)
|
||||
warn("acl_delete_entry() failed");
|
||||
continue;
|
||||
}
|
||||
if (acl_delete_flag_np(acl_flagset,
|
||||
ACL_ENTRY_FILE_INHERIT |
|
||||
ACL_ENTRY_DIRECTORY_INHERIT |
|
||||
ACL_ENTRY_NO_PROPAGATE_INHERIT) != 0)
|
||||
warn("acl_delete_flag_np() failed");
|
||||
}
|
||||
|
||||
return (nacl);
|
||||
}
|
||||
|
||||
static int
|
||||
handle_file(FTS *ftsp, FTSENT *file)
|
||||
{
|
||||
acl_t acl;
|
||||
acl_t acl, nacl;
|
||||
acl_entry_t unused_entry;
|
||||
int local_error, ret;
|
||||
struct sf_entry *entry;
|
||||
@@ -193,17 +239,20 @@ handle_file(FTS *ftsp, FTSENT *file)
|
||||
|
||||
/* Cycle through each option. */
|
||||
TAILQ_FOREACH(entry, &entrylist, next) {
|
||||
if (local_error)
|
||||
continue;
|
||||
|
||||
switch(entry->op) {
|
||||
nacl = entry->acl;
|
||||
switch (entry->op) {
|
||||
case OP_ADD_ACL:
|
||||
local_error += add_acl(entry->acl, entry->entry_number,
|
||||
&acl, file->fts_path);
|
||||
if (R_flag && file->fts_info != FTS_D &&
|
||||
acl_type == ACL_TYPE_NFS4)
|
||||
nacl = clear_inheritance_flags(nacl);
|
||||
local_error += add_acl(nacl, entry->entry_number, &acl,
|
||||
file->fts_path);
|
||||
break;
|
||||
case OP_MERGE_ACL:
|
||||
local_error += merge_acl(entry->acl, &acl,
|
||||
file->fts_path);
|
||||
if (R_flag && file->fts_info != FTS_D &&
|
||||
acl_type == ACL_TYPE_NFS4)
|
||||
nacl = clear_inheritance_flags(nacl);
|
||||
local_error += merge_acl(nacl, &acl, file->fts_path);
|
||||
need_mask = true;
|
||||
break;
|
||||
case OP_REMOVE_EXT:
|
||||
@@ -240,8 +289,7 @@ handle_file(FTS *ftsp, FTSENT *file)
|
||||
need_mask = false;
|
||||
break;
|
||||
case OP_REMOVE_ACL:
|
||||
local_error += remove_acl(entry->acl, &acl,
|
||||
file->fts_path);
|
||||
local_error += remove_acl(nacl, &acl, file->fts_path);
|
||||
need_mask = true;
|
||||
break;
|
||||
case OP_REMOVE_BY_NUMBER:
|
||||
@@ -250,6 +298,13 @@ handle_file(FTS *ftsp, FTSENT *file)
|
||||
need_mask = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (nacl != entry->acl) {
|
||||
acl_free(nacl);
|
||||
nacl = NULL;
|
||||
}
|
||||
if (local_error)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,6 +39,7 @@ ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z kaiwang27 $");
|
||||
static void add_gnu_debuglink(struct elfcopy *ecp);
|
||||
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
|
||||
static void check_section_rename(struct elfcopy *ecp, struct section *s);
|
||||
static void filter_reloc(struct elfcopy *ecp, struct section *s);
|
||||
static int get_section_flags(struct elfcopy *ecp, const char *name);
|
||||
static void insert_sections(struct elfcopy *ecp);
|
||||
static void insert_to_strtab(struct section *t, const char *s);
|
||||
@@ -572,6 +573,14 @@ copy_content(struct elfcopy *ecp)
|
||||
strcmp(s->name, ".shstrtab") == 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* If strip action is STRIP_ALL, relocation info need
|
||||
* to be stripped. Skip filtering otherwisw.
|
||||
*/
|
||||
if (ecp->strip == STRIP_ALL &&
|
||||
(s->type == SHT_REL || s->type == SHT_RELA))
|
||||
filter_reloc(ecp, s);
|
||||
|
||||
/*
|
||||
* The section indices in the SHT_GROUP section needs
|
||||
* to be updated since we might have stripped some
|
||||
@@ -664,6 +673,140 @@ update_section_group(struct elfcopy *ecp, struct section *s)
|
||||
s->nocopy = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Filter relocation entries, only keep those entries whose
|
||||
* symbol is in the keep list.
|
||||
*/
|
||||
static void
|
||||
filter_reloc(struct elfcopy *ecp, struct section *s)
|
||||
{
|
||||
const char *name;
|
||||
GElf_Shdr ish;
|
||||
GElf_Rel rel;
|
||||
GElf_Rela rela;
|
||||
Elf32_Rel *rel32;
|
||||
Elf64_Rel *rel64;
|
||||
Elf32_Rela *rela32;
|
||||
Elf64_Rela *rela64;
|
||||
Elf_Data *id;
|
||||
uint64_t cap, n, nrels, sym;
|
||||
int elferr, i;
|
||||
|
||||
if (gelf_getshdr(s->is, &ish) == NULL)
|
||||
errx(EXIT_FAILURE, "gelf_getehdr() failed: %s",
|
||||
elf_errmsg(-1));
|
||||
|
||||
/* We don't want to touch relocation info for dynamic symbols. */
|
||||
if ((ecp->flags & SYMTAB_EXIST) == 0) {
|
||||
/*
|
||||
* No symbol table in output. If sh_link points to a section
|
||||
* that exists in the output object, this relocation section
|
||||
* is for dynamic symbols. Don't touch it.
|
||||
*/
|
||||
if (ish.sh_link != 0 && ecp->secndx[ish.sh_link] != 0)
|
||||
return;
|
||||
} else {
|
||||
/* Symbol table exist, check if index equals. */
|
||||
if (ish.sh_link != elf_ndxscn(ecp->symtab->is))
|
||||
return;
|
||||
}
|
||||
|
||||
#define COPYREL(REL, SZ) do { \
|
||||
if (nrels == 0) { \
|
||||
if ((REL##SZ = malloc(cap * \
|
||||
sizeof(*REL##SZ))) == NULL) \
|
||||
err(EXIT_FAILURE, "malloc failed"); \
|
||||
} \
|
||||
if (nrels >= cap) { \
|
||||
cap *= 2; \
|
||||
if ((REL##SZ = realloc(REL##SZ, cap * \
|
||||
sizeof(*REL##SZ))) == NULL) \
|
||||
err(EXIT_FAILURE, "realloc failed"); \
|
||||
} \
|
||||
REL##SZ[nrels].r_offset = REL.r_offset; \
|
||||
REL##SZ[nrels].r_info = REL.r_info; \
|
||||
if (s->type == SHT_RELA) \
|
||||
rela##SZ[nrels].r_addend = rela.r_addend; \
|
||||
nrels++; \
|
||||
} while (0)
|
||||
|
||||
nrels = 0;
|
||||
cap = 4; /* keep list is usually small. */
|
||||
rel32 = NULL;
|
||||
rel64 = NULL;
|
||||
rela32 = NULL;
|
||||
rela64 = NULL;
|
||||
if ((id = elf_getdata(s->is, NULL)) == NULL)
|
||||
errx(EXIT_FAILURE, "elf_getdata() failed: %s",
|
||||
elf_errmsg(-1));
|
||||
n = ish.sh_size / ish.sh_entsize;
|
||||
for(i = 0; (uint64_t)i < n; i++) {
|
||||
if (s->type == SHT_REL) {
|
||||
if (gelf_getrel(id, i, &rel) != &rel)
|
||||
errx(EXIT_FAILURE, "gelf_getrel failed: %s",
|
||||
elf_errmsg(-1));
|
||||
sym = GELF_R_SYM(rel.r_info);
|
||||
} else {
|
||||
if (gelf_getrela(id, i, &rela) != &rela)
|
||||
errx(EXIT_FAILURE, "gelf_getrel failed: %s",
|
||||
elf_errmsg(-1));
|
||||
sym = GELF_R_SYM(rela.r_info);
|
||||
}
|
||||
/*
|
||||
* If a relocation references a symbol and we are omitting
|
||||
* either that symbol or the entire symbol table we cannot
|
||||
* produce valid output, and so just omit the relocation.
|
||||
* Broken output like this is generally not useful, but some
|
||||
* uses of elfcopy/strip rely on it - for example, GCC's build
|
||||
* process uses it to check for build reproducibility by
|
||||
* stripping objects and comparing them.
|
||||
*
|
||||
* Relocations that do not reference a symbol are retained.
|
||||
*/
|
||||
if (sym != 0) {
|
||||
if (ish.sh_link == 0 || ecp->secndx[ish.sh_link] == 0)
|
||||
continue;
|
||||
name = elf_strptr(ecp->ein, elf_ndxscn(ecp->strtab->is),
|
||||
sym);
|
||||
if (name == NULL)
|
||||
errx(EXIT_FAILURE, "elf_strptr failed: %s",
|
||||
elf_errmsg(-1));
|
||||
if (lookup_symop_list(ecp, name, SYMOP_KEEP) == NULL)
|
||||
continue;
|
||||
}
|
||||
if (ecp->oec == ELFCLASS32) {
|
||||
if (s->type == SHT_REL)
|
||||
COPYREL(rel, 32);
|
||||
else
|
||||
COPYREL(rela, 32);
|
||||
} else {
|
||||
if (s->type == SHT_REL)
|
||||
COPYREL(rel, 64);
|
||||
else
|
||||
COPYREL(rela, 64);
|
||||
}
|
||||
}
|
||||
elferr = elf_errno();
|
||||
if (elferr != 0)
|
||||
errx(EXIT_FAILURE, "elf_getdata() failed: %s",
|
||||
elf_errmsg(elferr));
|
||||
|
||||
if (ecp->oec == ELFCLASS32) {
|
||||
if (s->type == SHT_REL)
|
||||
s->buf = rel32;
|
||||
else
|
||||
s->buf = rela32;
|
||||
} else {
|
||||
if (s->type == SHT_REL)
|
||||
s->buf = rel64;
|
||||
else
|
||||
s->buf = rela64;
|
||||
}
|
||||
s->sz = gelf_fsize(ecp->eout, (s->type == SHT_REL ? ELF_T_REL :
|
||||
ELF_T_RELA), nrels, EV_CURRENT);
|
||||
s->nocopy = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
update_reloc(struct elfcopy *ecp, struct section *s)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#undef JEMALLOC_OVERRIDE_VALLOC
|
||||
|
||||
#ifndef MALLOC_PRODUCTION
|
||||
#define JEMALLOC_DEBUG
|
||||
#define MALLOC_PRODUCTION
|
||||
#endif
|
||||
|
||||
#undef JEMALLOC_DSS
|
||||
|
||||
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell command like
|
||||
'diff -u old/europe new/europe >myfix.patch', and attach
|
||||
myfix.patch to the email.
|
||||
|
||||
For more-elaborate changes, please read the theory.html file and browse
|
||||
the mailing list archives <https://mm.icann.org/pipermail/tz/> for
|
||||
examples of patches that tend to work well. Additions to
|
||||
data should contain commentary citing reliable sources as
|
||||
justification. Citations should use https: URLs if available.
|
||||
For more-elaborate or possibly-controversial changes,
|
||||
such as renaming, adding or removing zones, please read
|
||||
<https://www.iana.org/time-zones/repository/theory.html> or the file
|
||||
theory.html. It is also good to browse the mailing list archives
|
||||
<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
|
||||
to work well. Additions to data should contain commentary citing
|
||||
reliable sources as justification. Citations should use https: URLs
|
||||
if available.
|
||||
|
||||
Please submit changes against either the latest release in
|
||||
<https://www.iana.org/time-zones> or the master branch of the development
|
||||
|
||||
+199
-129
@@ -1,3 +1,5 @@
|
||||
# Make and install tzdb code and data.
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -19,9 +21,9 @@ BUGEMAIL= [email protected]
|
||||
# DATAFORM= rearguard
|
||||
DATAFORM= main
|
||||
|
||||
# Change the line below for your time zone (after finding the zone you want in
|
||||
# the time zone files, or adding it to a time zone file).
|
||||
# Alternatively, if you discover you've got the wrong time zone, you can just
|
||||
# Change the line below for your timezone (after finding the one you want in
|
||||
# one of the $(TDATA) source files, or adding it to a source file).
|
||||
# Alternatively, if you discover you've got the wrong timezone, you can just
|
||||
# zic -l rightzone
|
||||
# to correct things.
|
||||
# Use the command
|
||||
@@ -31,14 +33,14 @@ DATAFORM= main
|
||||
LOCALTIME= GMT
|
||||
|
||||
# If you want something other than Eastern United States time as a template
|
||||
# for handling POSIX-style time zone environment variables,
|
||||
# change the line below (after finding the zone you want in the
|
||||
# time zone files, or adding it to a time zone file).
|
||||
# for handling POSIX-style timezone environment variables,
|
||||
# change the line below (after finding the timezone you want in the
|
||||
# one of the $(TDATA) source files, or adding it to a source file).
|
||||
# When a POSIX-style environment variable is handled, the rules in the
|
||||
# template file are used to determine "spring forward" and "fall back" days and
|
||||
# times; the environment variable itself specifies UT offsets of standard and
|
||||
# daylight saving time.
|
||||
# Alternatively, if you discover you've got the wrong time zone, you can just
|
||||
# Alternatively, if you discover you've got the wrong timezone, you can just
|
||||
# zic -p rightzone
|
||||
# to correct things.
|
||||
# Use the command
|
||||
@@ -75,7 +77,7 @@ DESTDIR =
|
||||
# TOPDIR should be empty or an absolute name unless you're just testing.
|
||||
TOPDIR =
|
||||
|
||||
# The default local time zone is taken from the file TZDEFAULT.
|
||||
# The default local timezone is taken from the file TZDEFAULT.
|
||||
TZDEFAULT = $(TOPDIR)/etc/localtime
|
||||
|
||||
# The subdirectory containing installed program and data files, and
|
||||
@@ -84,7 +86,7 @@ TZDEFAULT = $(TOPDIR)/etc/localtime
|
||||
USRDIR = usr
|
||||
USRSHAREDIR = $(USRDIR)/share
|
||||
|
||||
# "Compiled" time zone information is placed in the "TZDIR" directory
|
||||
# "Compiled" timezone information is placed in the "TZDIR" directory
|
||||
# (and subdirectories).
|
||||
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
|
||||
TZDIR_BASENAME= zoneinfo
|
||||
@@ -106,9 +108,13 @@ MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
|
||||
LIBDIR = $(TOPDIR)/$(USRDIR)/lib
|
||||
|
||||
|
||||
# Types to try, as an alternative to time_t. int64_t should be first.
|
||||
TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
|
||||
# Types to try, as an alternative to time_t.
|
||||
TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
|
||||
TIME_T_ALTERNATIVES_HEAD = int64_t
|
||||
TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
|
||||
|
||||
# What kind of TZif data files to generate.
|
||||
# (TZif is the binary time zone data format that zic generates.)
|
||||
# If you want only POSIX time, with time values interpreted as
|
||||
# seconds since the epoch (not counting leap seconds), use
|
||||
# REDO= posix_only
|
||||
@@ -129,7 +135,7 @@ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
|
||||
|
||||
REDO= posix_right
|
||||
|
||||
# To install data in text form that has all the information of the binary data,
|
||||
# To install data in text form that has all the information of the TZif data,
|
||||
# (optionally incorporating leap second information), use
|
||||
# TZDATA_TEXT= tzdata.zi leapseconds
|
||||
# To install text data without leap second information (e.g., because
|
||||
@@ -171,7 +177,6 @@ LDLIBS=
|
||||
|
||||
# Add the following to the end of the "CFLAGS=" line as needed to override
|
||||
# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1".
|
||||
# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
|
||||
# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
|
||||
# formats that generate only the last two digits of year numbers
|
||||
# -DEPOCH_LOCAL if the 'time' function returns local time not UT
|
||||
@@ -295,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
|
||||
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
|
||||
# "posix2time", and "time2posix" to be added to the time conversion library.
|
||||
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
|
||||
# time (rather than the time specified in the TZ environment variable)
|
||||
# time (rather than the timezone specified in the TZ environment variable)
|
||||
# to be used.
|
||||
# "offtime" is like "gmtime" except that it accepts a second (long) argument
|
||||
# that gives an offset to add to the time_t when converting it.
|
||||
@@ -318,7 +323,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
|
||||
# "posix2time_z" and "time2posix_z" are added as well.
|
||||
# The functions ending in "_z" (or "_rz") are like their unsuffixed
|
||||
# (or suffixed-by-"_r") counterparts, except with an extra first
|
||||
# argument of opaque type timezone_t that specifies the time zone.
|
||||
# argument of opaque type timezone_t that specifies the timezone.
|
||||
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
|
||||
#
|
||||
# If you want to allocate state structures in localtime, add
|
||||
@@ -357,11 +362,14 @@ ZIC= $(zic) $(ZFLAGS)
|
||||
|
||||
ZFLAGS=
|
||||
|
||||
# How to use zic to install tz binary files.
|
||||
# How to use zic to install TZif files.
|
||||
|
||||
ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
|
||||
|
||||
# The name of a Posix-compliant 'awk' on your system.
|
||||
# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core;
|
||||
# on Ubuntu you can work around this with
|
||||
# AWK= gawk
|
||||
AWK= awk
|
||||
|
||||
# The full path name of a Posix-compliant shell, preferably one that supports
|
||||
@@ -410,10 +418,16 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
|
||||
SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
|
||||
SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]'
|
||||
|
||||
# These characters are Latin-1, and so are likely to be displayable
|
||||
# even in editors with limited character sets.
|
||||
UNUSUAL_OK_LATIN_1 = «°±»½¾×
|
||||
# This IPA symbol is represented in Unicode as the composition of
|
||||
# U+0075 and U+032F, and U+032F is not considered alphabetic by some
|
||||
# grep implementations that do not grok composition.
|
||||
UNUSUAL_OK_IPA = u̯
|
||||
# Non-ASCII non-letters that OK_CHAR allows, as these characters are
|
||||
# useful in commentary. XEmacs 21.5.34 displays them correctly,
|
||||
# presumably because they are Latin-1.
|
||||
UNUSUAL_OK_CHARSET= °±½¾×
|
||||
# useful in commentary.
|
||||
UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
|
||||
|
||||
# OK_CHAR matches any character allowed in the distributed files.
|
||||
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
|
||||
@@ -492,11 +506,14 @@ AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
|
||||
ziguard.awk zishrink.awk
|
||||
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
|
||||
TZS_YEAR= 2050
|
||||
TZS_CUTOFF_FLAG= -c $(TZS_YEAR)
|
||||
TZS= to$(TZS_YEAR).tzs
|
||||
TZS_NEW= to$(TZS_YEAR)new.tzs
|
||||
TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \
|
||||
private.h tzfile.h zdump.c zic.c
|
||||
ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi
|
||||
# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
|
||||
EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
|
||||
ENCHILADA = $(EIGHT_YARDS) $(TZS)
|
||||
|
||||
# Consult these files when deciding whether to rebuild the 'version' file.
|
||||
# This list is not the same as the output of 'git ls-files', since
|
||||
@@ -560,14 +577,21 @@ version: $(VERSION_DEPS)
|
||||
printf '%s\n' "$$V" >$@.out
|
||||
mv $@.out $@
|
||||
|
||||
# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
|
||||
# These files can be tailored by setting BACKWARD and PACKRATDATA.
|
||||
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
|
||||
$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
|
||||
$(TDATA) $(PACKRATDATA) >$@.out
|
||||
mv $@.out $@
|
||||
tzdata.zi: $(DATAFORM).zi version
|
||||
# This file has a version comment that attempts to capture any tailoring
|
||||
# via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
|
||||
tzdata.zi: $(DATAFORM).zi version zishrink.awk
|
||||
version=`sed 1q version` && \
|
||||
LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
|
||||
LC_ALL=C $(AWK) \
|
||||
-v dataform='$(DATAFORM)' \
|
||||
-v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
|
||||
-v redo='$(REDO)' \
|
||||
-v version="$$version" \
|
||||
-f zishrink.awk \
|
||||
$(DATAFORM).zi >$@.out
|
||||
mv $@.out $@
|
||||
|
||||
@@ -605,14 +629,16 @@ INSTALLARGS = \
|
||||
YEARISTYPE='$(YEARISTYPE)' \
|
||||
ZIC='$(ZIC)'
|
||||
|
||||
# 'make install_data' installs one set of tz binary files.
|
||||
install_data: zic leapseconds yearistype tzdata.zi
|
||||
INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
|
||||
|
||||
# 'make install_data' installs one set of TZif files.
|
||||
install_data: $(INSTALL_DATA_DEPS)
|
||||
$(ZIC_INSTALL) tzdata.zi
|
||||
|
||||
posix_only:
|
||||
posix_only: $(INSTALL_DATA_DEPS)
|
||||
$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
|
||||
|
||||
right_only:
|
||||
right_only: $(INSTALL_DATA_DEPS)
|
||||
$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
|
||||
install_data
|
||||
|
||||
@@ -639,7 +665,7 @@ posix_right: posix_only
|
||||
|
||||
# This obsolescent rule is present for backwards compatibility with
|
||||
# tz releases 2014g through 2015g. It should go away eventually.
|
||||
posix_packrat:
|
||||
posix_packrat: $(INSTALL_DATA_DEPS)
|
||||
$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
|
||||
|
||||
zones: $(REDO)
|
||||
@@ -650,29 +676,33 @@ ZDS = dummy.zd
|
||||
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
|
||||
# It is separate so that GNU 'make -j' can run instances in parallel.
|
||||
$(ZDS): zdump
|
||||
./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@
|
||||
./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
|
||||
>$@
|
||||
|
||||
$(TZS_NEW): tzdata.zi zdump zic
|
||||
rm -fr tzs.dir
|
||||
mkdir tzs.dir
|
||||
$(zic) -d tzs.dir tzdata.zi
|
||||
TZS_NEW_DEPS = tzdata.zi zdump zic
|
||||
$(TZS_NEW): $(TZS_NEW_DEPS)
|
||||
rm -fr tzs$(TZS_YEAR).dir
|
||||
mkdir tzs$(TZS_YEAR).dir
|
||||
$(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
|
||||
$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
|
||||
tzdata.zi | LC_ALL=C sort >$@.out
|
||||
wd=`pwd` && \
|
||||
set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
|
||||
x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
|
||||
tzdata.zi \
|
||||
| LC_ALL=C sort -t . -k 2,2` && \
|
||||
set x $$x && \
|
||||
shift && \
|
||||
ZDS=$$* && \
|
||||
$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
|
||||
sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out
|
||||
rm -fr tzs.dir
|
||||
$(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
|
||||
ZDS="$$ZDS" $$ZDS && \
|
||||
sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
|
||||
rm -fr tzs$(TZS_YEAR).dir
|
||||
mv $@.out $@
|
||||
|
||||
# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
|
||||
# If it exists but 'make check_tzs' fails, a maintainer should inspect the
|
||||
# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the
|
||||
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
|
||||
$(TZS):
|
||||
$(MAKE) force_tzs
|
||||
touch $@
|
||||
|
||||
force_tzs: $(TZS_NEW)
|
||||
cp $(TZS_NEW) $(TZS)
|
||||
@@ -711,18 +741,21 @@ check_character_set: $(ENCHILADA)
|
||||
$(MISC) $(SOURCES) $(WEB_PAGES) \
|
||||
CONTRIBUTING LICENSE README \
|
||||
version tzdata.zi && \
|
||||
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
|
||||
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
|
||||
Makefile && \
|
||||
! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
|
||||
leapseconds yearistype.sh zone.tab && \
|
||||
! grep -Env $(OK_LINE) $(ENCHILADA); \
|
||||
}
|
||||
touch $@
|
||||
|
||||
check_white_space: $(ENCHILADA)
|
||||
patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
|
||||
! grep -En "$$pat" $(ENCHILADA)
|
||||
! grep -En "$$pat" \
|
||||
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
|
||||
! grep -n '[[:space:]]$$' \
|
||||
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
|
||||
touch $@
|
||||
|
||||
PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
|
||||
FILE_NAME_COMPONENT_TOO_LONG = \
|
||||
@@ -731,6 +764,7 @@ FILE_NAME_COMPONENT_TOO_LONG = \
|
||||
check_name_lengths: $(TDATA_TO_CHECK) backzone
|
||||
! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
|
||||
$(TDATA_TO_CHECK) backzone
|
||||
touch $@
|
||||
|
||||
CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
|
||||
|
||||
@@ -743,52 +777,61 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
|
||||
LC_ALL=C sort -c
|
||||
$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
|
||||
LC_ALL=C sort -cu
|
||||
touch $@
|
||||
|
||||
check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
|
||||
$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
|
||||
$(AWK) -f checklinks.awk tzdata.zi
|
||||
touch $@
|
||||
|
||||
check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
|
||||
for tab in $(ZONETABLES); do \
|
||||
$(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
|
||||
|| exit; \
|
||||
done
|
||||
touch $@
|
||||
|
||||
check_tzs: $(TZS) $(TZS_NEW)
|
||||
diff -u $(TZS) $(TZS_NEW)
|
||||
if test -s $(TZS); then \
|
||||
diff -u $(TZS) $(TZS_NEW); \
|
||||
else \
|
||||
cp $(TZS_NEW) $(TZS); \
|
||||
fi
|
||||
touch $@
|
||||
|
||||
# This checks only the HTML 4.01 strict page.
|
||||
# To check the the other pages, use <https://validator.w3.org/>.
|
||||
check_web: tz-how-to.html
|
||||
$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
|
||||
touch $@
|
||||
|
||||
# Check that zishrink.awk does not alter the data, and that ziguard.awk
|
||||
# preserves main-format data.
|
||||
check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
|
||||
$(DATAFORM).zi tzdata.zi
|
||||
for type in posix right; do \
|
||||
mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
|
||||
time_t.dir/$$type-shrunk && \
|
||||
case $$type in \
|
||||
right) leap='-L leapseconds';; \
|
||||
*) leap=;; \
|
||||
esac && \
|
||||
$(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
|
||||
check_zishrink: check_zishrink_posix check_zishrink_right
|
||||
check_zishrink_posix check_zishrink_right: \
|
||||
zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
|
||||
rm -fr $@.dir $@-t.dir $@-shrunk.dir
|
||||
mkdir $@.dir $@-t.dir $@-shrunk.dir
|
||||
case $@ in \
|
||||
*_right) leap='-L leapseconds';; \
|
||||
*) leap=;; \
|
||||
esac && \
|
||||
$(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
|
||||
$(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
|
||||
case $(DATAFORM) in \
|
||||
main) \
|
||||
$(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
|
||||
$(ZIC) $$leap -d $@-t.dir $(TDATA) && \
|
||||
$(AWK) '/^Rule/' $(TDATA) | \
|
||||
$(ZIC) $$leap -d time_t.dir/$$type-t - \
|
||||
$(PACKRATDATA) && \
|
||||
diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
|
||||
esac && \
|
||||
$(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
|
||||
diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
|
||||
done
|
||||
rm -fr time_t.dir
|
||||
$(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
|
||||
diff -r $@.dir $@-t.dir;; \
|
||||
esac
|
||||
diff -r $@.dir $@-shrunk.dir
|
||||
rm -fr $@.dir $@-t.dir $@-shrunk.dir
|
||||
touch $@
|
||||
|
||||
clean_misc:
|
||||
rm -f core *.o *.out \
|
||||
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
|
||||
check_* core typecheck_* \
|
||||
date tzselect version.h zdump zic yearistype libtz.a
|
||||
clean: clean_misc
|
||||
rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
|
||||
@@ -818,17 +861,17 @@ $(MANTXTS): workman.sh
|
||||
LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
|
||||
mv $@.out $@
|
||||
|
||||
# Set the time stamps to those of the git repository, if available,
|
||||
# Set the timestamps to those of the git repository, if available,
|
||||
# and if the files have not changed since then.
|
||||
# This uses GNU 'touch' syntax 'touch -d@N FILE',
|
||||
# where N is the number of seconds since 1970.
|
||||
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
|
||||
# Also, set the timestamp of each prebuilt file like 'leapseconds'
|
||||
# to be the maximum of the files it depends on.
|
||||
set-timestamps.out: $(ENCHILADA)
|
||||
set-timestamps.out: $(EIGHT_YARDS)
|
||||
rm -f $@
|
||||
if (type git) >/dev/null 2>&1 && \
|
||||
files=`git ls-files $(ENCHILADA)` && \
|
||||
files=`git ls-files $(EIGHT_YARDS)` && \
|
||||
touch -md @1 test.out; then \
|
||||
rm -f test.out && \
|
||||
for file in $$files; do \
|
||||
@@ -846,83 +889,100 @@ set-timestamps.out: $(ENCHILADA)
|
||||
exit; \
|
||||
done
|
||||
touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
|
||||
touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
|
||||
touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
|
||||
touch $@
|
||||
set-tzs-timestamp.out: $(TZS)
|
||||
touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
|
||||
touch $@
|
||||
|
||||
# The zics below ensure that each data file can stand on its own.
|
||||
# We also do an all-files run to catch links to links.
|
||||
|
||||
check_public:
|
||||
$(MAKE) maintainer-clean
|
||||
$(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
|
||||
mkdir -p public.dir
|
||||
for i in $(TDATA_TO_CHECK) tzdata.zi; do \
|
||||
$(zic) -v -d public.dir $$i 2>&1 || exit; \
|
||||
done
|
||||
$(zic) -v -d public.dir $(TDATA_TO_CHECK)
|
||||
check_public: $(VERSION_DEPS)
|
||||
rm -fr public.dir
|
||||
mkdir public.dir
|
||||
ln $(VERSION_DEPS) public.dir
|
||||
cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
|
||||
for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \
|
||||
public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
|
||||
done
|
||||
public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
|
||||
rm -fr public.dir
|
||||
touch $@
|
||||
|
||||
# Check that the code works under various alternative
|
||||
# implementations of time_t.
|
||||
check_time_t_alternatives:
|
||||
if diff -q Makefile Makefile 2>/dev/null; then \
|
||||
quiet_option='-q'; \
|
||||
else \
|
||||
quiet_option=''; \
|
||||
fi && \
|
||||
check_time_t_alternatives: $(TIME_T_ALTERNATIVES)
|
||||
$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD)
|
||||
$(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
|
||||
rm -fr $@.dir
|
||||
mkdir $@.dir
|
||||
ln $(VERSION_DEPS) $@.dir
|
||||
case $@ in \
|
||||
int32_t) range=-2147483648,2147483648;; \
|
||||
u*) range=0,4294967296;; \
|
||||
*) range=-4294967296,4294967296;; \
|
||||
esac && \
|
||||
wd=`pwd` && \
|
||||
zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
|
||||
for type in $(TIME_T_ALTERNATIVES); do \
|
||||
mkdir -p time_t.dir/$$type && \
|
||||
$(MAKE) clean_misc && \
|
||||
$(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
|
||||
CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
|
||||
if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \
|
||||
range_target=; \
|
||||
else \
|
||||
range_target=to$$range.tzs; \
|
||||
fi && \
|
||||
(cd $@.dir && \
|
||||
$(MAKE) TOPDIR="$$wd/$@.dir" \
|
||||
CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \
|
||||
REDO='$(REDO)' \
|
||||
install && \
|
||||
diff $$quiet_option -r \
|
||||
time_t.dir/int64_t/etc \
|
||||
time_t.dir/$$type/etc && \
|
||||
diff $$quiet_option -r \
|
||||
time_t.dir/int64_t/usr/share \
|
||||
time_t.dir/$$type/usr/share && \
|
||||
case $$type in \
|
||||
int32_t) range=-2147483648,2147483647;; \
|
||||
uint32_t) range=0,4294967296;; \
|
||||
int64_t) continue;; \
|
||||
*u*) range=0,10000000000;; \
|
||||
*) range=-10000000000,10000000000;; \
|
||||
esac && \
|
||||
echo checking $$type zones ... && \
|
||||
time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
|
||||
>time_t.dir/int64_t.out && \
|
||||
time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
|
||||
>time_t.dir/$$type.out && \
|
||||
diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
|
||||
|| exit; \
|
||||
done
|
||||
rm -fr time_t.dir
|
||||
D=$$wd/$@.dir \
|
||||
TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
|
||||
install $$range_target) && \
|
||||
test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \
|
||||
(cd $(TIME_T_ALTERNATIVES_HEAD).dir && \
|
||||
$(MAKE) TOPDIR="$$wd/$@.dir" \
|
||||
TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
|
||||
D=$$wd/$@.dir \
|
||||
to$$range.tzs) && \
|
||||
diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \
|
||||
$@.dir/to$$range.tzs && \
|
||||
if diff -q Makefile Makefile 2>/dev/null; then \
|
||||
quiet_option='-q'; \
|
||||
else \
|
||||
quiet_option=''; \
|
||||
fi && \
|
||||
diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \
|
||||
$@.dir/etc && \
|
||||
diff $$quiet_option -r \
|
||||
$(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \
|
||||
$@.dir/usr/share; \
|
||||
}
|
||||
touch $@
|
||||
|
||||
TRADITIONAL_ASC = \
|
||||
tzcode$(VERSION).tar.gz.asc \
|
||||
tzdata$(VERSION).tar.gz.asc
|
||||
ALL_ASC = $(TRADITIONAL_ASC) \
|
||||
tzdata$(VERSION)-rearguard.tar.gz.asc \
|
||||
REARGUARD_ASC = \
|
||||
tzdata$(VERSION)-rearguard.tar.gz.asc
|
||||
ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
|
||||
tzdb-$(VERSION).tar.lz.asc
|
||||
|
||||
tarballs traditional_tarballs signatures traditional_signatures: version
|
||||
tarballs rearguard_tarballs traditional_tarballs \
|
||||
signatures rearguard_signatures traditional_signatures: \
|
||||
version set-timestamps.out rearguard.zi
|
||||
VERSION=`cat version` && \
|
||||
$(MAKE) VERSION="$$VERSION" $@_version
|
||||
|
||||
# These *_version rules are intended for use if VERSION is set by some
|
||||
# other means. Ordinarily these rules are used only by the above
|
||||
# non-_version rules, which set VERSION on the 'make' command line.
|
||||
tarballs_version: traditional_tarballs_version \
|
||||
tzdata$(VERSION)-rearguard.tar.gz \
|
||||
tarballs_version: traditional_tarballs_version rearguard_tarballs_version \
|
||||
tzdb-$(VERSION).tar.lz
|
||||
rearguard_tarballs_version: \
|
||||
tzdata$(VERSION)-rearguard.tar.gz
|
||||
traditional_tarballs_version: \
|
||||
tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
|
||||
signatures_version: $(ALL_ASC)
|
||||
rearguard_signatures_version: $(REARGUARD_ASC)
|
||||
traditional_signatures_version: $(TRADITIONAL_ASC)
|
||||
|
||||
tzcode$(VERSION).tar.gz: set-timestamps.out
|
||||
@@ -958,7 +1018,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
|
||||
gzip $(GZIPFLAGS)) >$@.out
|
||||
mv $@.out $@
|
||||
|
||||
tzdb-$(VERSION).tar.lz: set-timestamps.out
|
||||
tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
|
||||
rm -fr tzdb-$(VERSION)
|
||||
mkdir tzdb-$(VERSION)
|
||||
ln $(ENCHILADA) tzdb-$(VERSION)
|
||||
@@ -972,16 +1032,26 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
|
||||
tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
|
||||
tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
|
||||
$(ALL_ASC):
|
||||
gpg --armor --detach-sign $?
|
||||
gpg2 --armor --detach-sign $?
|
||||
|
||||
typecheck:
|
||||
$(MAKE) clean
|
||||
for i in "long long" unsigned; \
|
||||
do \
|
||||
$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
|
||||
./zdump -v Europe/Rome ; \
|
||||
$(MAKE) clean ; \
|
||||
done
|
||||
TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
|
||||
typecheck: typecheck_long_long typecheck_unsigned
|
||||
typecheck_long_long typecheck_unsigned: $(VERSION_DEPS)
|
||||
rm -fr $@.dir
|
||||
mkdir $@.dir
|
||||
ln $(VERSION_DEPS) $@.dir
|
||||
cd $@.dir && \
|
||||
case $@ in \
|
||||
*_long_long) i="long long";; \
|
||||
*_unsigned ) i="unsigned" ;; \
|
||||
esac && \
|
||||
typecheck_cflags='' && \
|
||||
$(MAKE) \
|
||||
CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \
|
||||
TOPDIR="`pwd`" \
|
||||
install
|
||||
$@.dir/zdump -i -c 1970,1971 Europe/Rome
|
||||
touch $@
|
||||
|
||||
zonenames: tzdata.zi
|
||||
@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
|
||||
@@ -997,14 +1067,14 @@ zic.o: private.h tzfile.h version.h
|
||||
.KEEP_STATE:
|
||||
|
||||
.PHONY: ALL INSTALL all
|
||||
.PHONY: check check_character_set check_links check_name_lengths
|
||||
.PHONY: check_public check_sorted check_tables
|
||||
.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
|
||||
.PHONY: check check_time_t_alternatives
|
||||
.PHONY: check_zishrink
|
||||
.PHONY: clean clean_misc dummy.zd force_tzs
|
||||
.PHONY: install install_data maintainer-clean names
|
||||
.PHONY: posix_only posix_packrat posix_right
|
||||
.PHONY: public right_only right_posix signatures signatures_version
|
||||
.PHONY: posix_only posix_packrat posix_right public
|
||||
.PHONY: rearguard_signatures rearguard_signatures_version
|
||||
.PHONY: rearguard_tarballs rearguard_tarballs_version
|
||||
.PHONY: right_only right_posix signatures signatures_version
|
||||
.PHONY: tarballs tarballs_version
|
||||
.PHONY: traditional_signatures traditional_signatures_version
|
||||
.PHONY: traditional_tarballs traditional_tarballs_version
|
||||
|
||||
+256
-90
@@ -1,5 +1,171 @@
|
||||
News for the tz database
|
||||
|
||||
Release 2018g - 2018-10-26 22:22:45 -0700
|
||||
|
||||
Briefly:
|
||||
Morocco switches to permanent +01 on 2018-10-27.
|
||||
|
||||
Changes to future timestamps
|
||||
|
||||
Morocco switches from +00/+01 to permanent +01 effective 2018-10-27,
|
||||
so its clocks will not fall back on 2018-10-28 as previously scheduled.
|
||||
(Thanks to Mohamed Essedik Najd and Brian Inglis.)
|
||||
|
||||
Changes to code
|
||||
|
||||
When generating TZif files with leap seconds, zic no longer uses a
|
||||
format that trips up older 32-bit clients, fixing a bug introduced
|
||||
in 2018f. (Reported by Daniel Fischer.) Also, the zic workaround
|
||||
for QTBUG-53071 now also works for TZif files with leap seconds.
|
||||
|
||||
The translator to rearguard format now rewrites the line
|
||||
"Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
|
||||
"Rule Japan 1948 1951 - Sep Sun>=9 1:00 0 S".
|
||||
This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
|
||||
and earlier. (Reported by Christos Zoulas.)
|
||||
|
||||
Changes to past time zone abbreviations
|
||||
|
||||
Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii.
|
||||
This reverts to 2011h, as the abbreviation change in 2011i was
|
||||
likely inadvertent.
|
||||
|
||||
Changes to documentation
|
||||
|
||||
tzfile.5 has new sections on interoperability issues.
|
||||
|
||||
|
||||
Release 2018f - 2018-10-18 00:14:18 -0700
|
||||
|
||||
Briefly:
|
||||
Volgograd moves from +03 to +04 on 2018-10-28.
|
||||
Fiji ends DST 2019-01-13, not 2019-01-20.
|
||||
Most of Chile changes DST dates, effective 2019-04-06.
|
||||
|
||||
Changes to future timestamps
|
||||
|
||||
Volgograd moves from +03 to +04 on 2018-10-28 at 02:00.
|
||||
(Thanks to Alexander Fetisov and Stepan Golosunov.)
|
||||
|
||||
Fiji ends DST 2019-01-13 instead of the 2019-01-20 previously
|
||||
predicted. (Thanks to Raymond Kumar.) Adjust future predictions
|
||||
accordingly.
|
||||
|
||||
Most of Chile will end DST on the first Saturday in April at 24:00 mainland
|
||||
time, and resume DST on the first Saturday in September at 24:00 mainland
|
||||
time. The changes are effective from 2019-04-06, and do not affect the
|
||||
Magallanes region modeled by America/Punta_Arenas. (Thanks to Juan Correa
|
||||
and Tim Parenti.) Adjust future predictions accordingly.
|
||||
|
||||
Changes to past timestamps
|
||||
|
||||
The 2018-05-05 North Korea 30-minute time zone change took place
|
||||
at 23:30 the previous day, not at 00:00 that day.
|
||||
|
||||
China's 1988 spring-forward transition was on April 17, not
|
||||
April 10. Its DST transitions in 1986/91 were at 02:00, not 00:00.
|
||||
(Thanks to P Chan.)
|
||||
|
||||
Fix several issues for Macau before 1992. Macau's pre-1904 LMT
|
||||
was off by 10 s. Macau switched to +08 in 1904 not 1912, and
|
||||
temporarily switched to +09/+10 during World War II. Macau
|
||||
observed DST in 1942/79, not 1961/80, and there were several
|
||||
errors for transition times and dates. (Thanks to P Chan.)
|
||||
|
||||
The 1948-1951 fallback transitions in Japan were at 25:00 on
|
||||
September's second Saturday, not at 24:00. (Thanks to Phake Nick.)
|
||||
zic turns this into 01:00 on the day after September's second
|
||||
Saturday, which is the best that POSIX or C platforms can do.
|
||||
|
||||
Incorporate 1940-1949 Asia/Shanghai DST transitions from a 2014
|
||||
paper by Li Yu, replacing more-questionable data from Shanks.
|
||||
|
||||
Changes to time zone abbreviations
|
||||
|
||||
Use "PST" and "PDT" for Philippine time. (Thanks to Paul Goyette.)
|
||||
|
||||
Changes to code
|
||||
|
||||
zic now always generates TZif files where time type 0 is used for
|
||||
timestamps before the first transition. This simplifies the
|
||||
reading of TZif files and should not affect behavior of existing
|
||||
TZif readers because the same set of time types is used; only
|
||||
their internal indexes may have changed. This affects only the
|
||||
legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and
|
||||
EET, which previously used nonzero types for these timestamps.
|
||||
|
||||
Because of the type 0 change, zic no longer outputs a dummy
|
||||
transition at time -2**59 (before the Big Bang), as clients should
|
||||
no longer need this to handle historical timestamps correctly.
|
||||
This reverts a change introduced in 2013d and shrinks most TZif
|
||||
files by a few bytes.
|
||||
|
||||
zic now supports negative time-of-day in Rule and Leap lines, e.g.,
|
||||
"Rule X min max - Apr lastSun -6:00 1:00 -" means the transition
|
||||
occurs at 18:00 on the Saturday before the last Sunday in April.
|
||||
This behavior was documented in 2018a but the code did not
|
||||
entirely match the documentation.
|
||||
|
||||
localtime.c no longer requires at least one time type in TZif
|
||||
files that lack transitions or have a POSIX-style TZ string. This
|
||||
future-proofs the code against possible future extensions to the
|
||||
format that would allow TZif files with POSIX-style TZ strings and
|
||||
without transitions or time types.
|
||||
|
||||
A read-access subscript error in localtime.c has been fixed.
|
||||
It could occur only in TZif files with timecnt == 0, something that
|
||||
does not happen in practice now but could happen in future versions.
|
||||
|
||||
localtime.c no longer ignores TZif POSIX-style TZ strings that
|
||||
specify only standard time. Instead, these TZ strings now
|
||||
override the default time type for timestamps after the last
|
||||
transition (or for all time stamps if there are no transitions),
|
||||
just as DST strings specifying DST have always done.
|
||||
|
||||
leapseconds.awk now outputs "#updated" and "#expires" comments,
|
||||
and supports leap seconds at the ends of months other than June
|
||||
and December. (Inspired by suggestions from Chris Woodbury.)
|
||||
|
||||
Changes to documentation
|
||||
|
||||
New restrictions: A Rule name must start with a character that
|
||||
is neither an ASCII digit nor "-" nor "+", and an unquoted name
|
||||
should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~".
|
||||
The latter restriction makes room for future extensions (a
|
||||
possibility noted by Tom Lane).
|
||||
|
||||
tzfile.5 now documents what time types apply before the first and
|
||||
after the last transition, if any.
|
||||
|
||||
Documentation now uses the spelling "timezone" for a TZ setting
|
||||
that determines timestamp history, and "time zone" for a
|
||||
geographic region currently sharing the same standard time.
|
||||
|
||||
The name "TZif" is now used for the tz binary data format.
|
||||
|
||||
tz-link.htm now mentions the A0 TimeZone Migration utilities.
|
||||
(Thanks to Aldrin Martoq for the link.)
|
||||
|
||||
Changes to build procedure
|
||||
|
||||
New 'make' target 'rearguard_tarballs' to build the rearguard
|
||||
tarball only. This is a convenience on platforms that lack lzip
|
||||
if you want to build the rearguard tarball. (Problem reported by
|
||||
Deborah Goldsmith.)
|
||||
|
||||
tzdata.zi is now more stable from release to release. (Problem
|
||||
noted by Tom Lane.) It is also a bit shorter.
|
||||
|
||||
tzdata.zi now can contain comment lines documenting configuration
|
||||
information, such as which data format was selected, which input
|
||||
files were used, and how leap seconds are treated. (Problems
|
||||
noted by Lester Caine and Brian Inglis.) If the Makefile defaults
|
||||
are used these comment lines are absent, for backward
|
||||
compatibility. A redistributor intending to alter its copy of the
|
||||
files should also append "-LABEL" to the 'version' file's first
|
||||
line, where "LABEL" identifies the redistributor's change.
|
||||
|
||||
|
||||
Release 2018e - 2018-05-01 23:42:51 -0700
|
||||
|
||||
Briefly:
|
||||
@@ -9,7 +175,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
|
||||
'make tarballs' now also builds a rearguard tarball.
|
||||
New 's' and 'd' suffixes in SAVE columns of Rule and Zone lines.
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
North Korea switches back from +0830 to +09 on 2018-05-05.
|
||||
(Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon,
|
||||
@@ -17,9 +183,9 @@ Release 2018e - 2018-05-01 23:42:51 -0700
|
||||
|
||||
Bring back the negative-DST changes of 2018a, except be more
|
||||
compatible with data parsers that do not support negative DST.
|
||||
Also, this now affects historical time stamps in Namibia and the
|
||||
Also, this now affects historical timestamps in Namibia and the
|
||||
former Czechoslovakia, not just Ireland. The main format now uses
|
||||
negative DST to model time stamps in Europe/Dublin (from 1971 on),
|
||||
negative DST to model timestamps in Europe/Dublin (from 1971 on),
|
||||
Europe/Prague (1946/7), and Africa/Windhoek (1994/2017). This
|
||||
does not affect UT offsets, only time zone abbreviations and the
|
||||
tm_isdst flag. Also, this does not affect rearguard or vanguard
|
||||
@@ -44,7 +210,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700
|
||||
in tzdata, it could be used to specify the legal time in Namibia
|
||||
1994-2017, as opposed to the popular time (see below).
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
From 1994 through 2017 Namibia observed DST in winter, not summer.
|
||||
That is, it used negative DST, as Ireland still does. This change
|
||||
@@ -54,12 +220,12 @@ Release 2018e - 2018-05-01 23:42:51 -0700
|
||||
both simply called "standard time" in Namibian law, in common
|
||||
practice winter time was considered to be DST (as noted by Stephen
|
||||
Colebourne). The full effect of this change is only in vanguard
|
||||
format; in rearguard and main format, the tm_isdst flag is still
|
||||
and main format; in rearguard format, the tm_isdst flag is still
|
||||
zero in winter and nonzero in summer.
|
||||
|
||||
In 1946/7 Czechoslovakia also observed negative DST in winter.
|
||||
The full effect of this change is only in vanguard format; in
|
||||
rearguard and main formats, it is modeled as plain GMT without
|
||||
The full effect of this change is only in vanguard and main
|
||||
formats; in rearguard format, it is modeled as plain GMT without
|
||||
daylight saving. Also, the dates of some 1944/5 DST transitions
|
||||
in Czechoslovakia have been changed.
|
||||
|
||||
@@ -72,17 +238,17 @@ Release 2018d - 2018-03-22 07:05:46 -0700
|
||||
Add support for vanguard and rearguard data consumers.
|
||||
Add subsecond precision to source data format, though not to data.
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
In 2018, Palestine starts DST on March 24, not March 31.
|
||||
Adjust future predictions accordingly. (Thanks to Sharef Mustafa.)
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
|
||||
at 04:00. (Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Historical transitions for Uruguay, represented by
|
||||
America/Montevideo, have been updated per official legal documents,
|
||||
@@ -224,7 +390,7 @@ Release 2018c - 2018-01-22 23:00:44 -0800
|
||||
change is reapplied. (Problems reported by Deborah Goldsmith and
|
||||
Stephen Colebourne.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Japanese DST transitions (1948-1951) were Sundays at 00:00, not
|
||||
Saturdays or Sundays at 02:00. (Thanks to Takayuki Nikai.)
|
||||
@@ -256,18 +422,18 @@ Release 2018a - 2018-01-12 22:29:21 -0800
|
||||
Use Debian-style installation locations, instead of 4.3BSD-style.
|
||||
New zic option -t.
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at
|
||||
01:00. (Thanks to Steffen Thorsen and Michael Deckers.)
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Starting in 2018 southern Brazil will begin DST on November's
|
||||
first Sunday instead of October's third Sunday. (Thanks to
|
||||
Steffen Thorsen.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
A discrepancy of 4 s in timestamps before 1931 in South Sudan has
|
||||
been corrected. The 'backzone' and 'zone.tab' files did not agree
|
||||
@@ -355,7 +521,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
|
||||
A new file tzdata.zi now holds a small text copy of all data.
|
||||
The zic input format has been regularized slightly.
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Northern Cyprus has decided to resume EU rules starting
|
||||
2017-10-29, thus reinstituting winter time.
|
||||
@@ -381,7 +547,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700
|
||||
2018-03-11 at 03:00. This affects UT offsets starting 2018-11-04
|
||||
at 02:00. (Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03.
|
||||
(Thanks to Arthur David Olson.)
|
||||
@@ -511,11 +677,11 @@ Release 2017b - 2017-03-17 07:30:38 -0700
|
||||
|
||||
Briefly: Haiti has resumed DST.
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
|
||||
|
||||
@@ -527,7 +693,7 @@ Release 2017b - 2017-03-17 07:30:38 -0700
|
||||
The reference localtime implementation now falls back on the
|
||||
current US daylight-saving transition rules rather than the
|
||||
1987-2006 rules. This fallback occurs only when (1) the TZ
|
||||
environment variable's value has a name like "AST4ADT" that asks
|
||||
environment variable has a value like "AST4ADT" that asks
|
||||
for daylight saving time but does not specify the rules, (2) there
|
||||
is no file by that name, and (3) the TZDEFRULES file cannot be
|
||||
loaded. (Thanks to Tom Lane.)
|
||||
@@ -538,7 +704,7 @@ Release 2017a - 2017-02-28 00:05:36 -0800
|
||||
Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
|
||||
discontinues DST.
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.)
|
||||
|
||||
@@ -549,12 +715,12 @@ Release 2017a - 2017-02-28 00:05:36 -0800
|
||||
assume it's permanent. (Thanks to Juan Correa and Deborah
|
||||
Goldsmith.) This also affects Antarctica/Palmer.
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Fix many entries for historical time stamps for Europe/Madrid
|
||||
Fix many entries for historical timestamps for Europe/Madrid
|
||||
before 1979, to agree with tables compiled by Pere Planesas of the
|
||||
National Astronomical Observatory of Spain. As a side effect,
|
||||
this changes some time stamps for Africa/Ceuta before 1929, which
|
||||
this changes some timestamps for Africa/Ceuta before 1929, which
|
||||
are probably guesswork anyway. (Thanks to Steve Allen and
|
||||
Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
|
||||
correcting the 1901 transition.)
|
||||
@@ -645,13 +811,13 @@ Release 2016j - 2016-11-22 23:17:13 -0800
|
||||
|
||||
Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04.
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00.
|
||||
This hives off a new zone Europe/Saratov from Europe/Volgograd.
|
||||
(Thanks to Yuri Konotopov and Stepan Golosunov.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
The new zone Asia/Atyrau for Atyraū Region, Kazakhstan, is like
|
||||
Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring
|
||||
@@ -687,7 +853,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
|
||||
Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga
|
||||
reintroduces DST on 2016-11-06.
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on
|
||||
2017-01-15 at 03:00. Assume future observances in Tonga will be
|
||||
@@ -695,7 +861,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
|
||||
January, like Fiji. (Thanks to Pulu ʻAnau.) Switch to numeric
|
||||
time zone abbreviations for this zone.
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
Northern Cyprus is now +03 year round, causing a split in Cyprus
|
||||
time zones starting 2016-10-30 at 04:00. This creates a zone
|
||||
@@ -704,9 +870,9 @@ Release 2016i - 2016-11-01 23:19:52 -0700
|
||||
Antarctica/Casey switched from +08 to +11 on 2016-10-22.
|
||||
(Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
Several corrections were made for pre-1975 time stamps in Italy.
|
||||
Several corrections were made for pre-1975 timestamps in Italy.
|
||||
These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and
|
||||
Europe/Vatican.
|
||||
|
||||
@@ -744,7 +910,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700
|
||||
|
||||
Release 2016h - 2016-10-19 23:17:57 -0700
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not
|
||||
2016-10-21 at 00:00. (Thanks to Sharef Mustafa.) Predict that
|
||||
@@ -752,7 +918,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
|
||||
at 01:00, which is consistent with predicted spring transitions
|
||||
on the last Saturday of March. (Thanks to Tim Parenti.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
In Turkey, transitions in 1986-1990 were at 01:00 standard time
|
||||
not at 02:00, and the spring 1994 transition was on March 20, not
|
||||
@@ -801,7 +967,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700
|
||||
|
||||
Release 2016g - 2016-09-13 08:56:38 -0700
|
||||
|
||||
Changes to future time stamps
|
||||
Changes to future timestamps
|
||||
|
||||
Turkey switched from EET/EEST (+02/+03) to permanent +03,
|
||||
effective 2016-09-07. (Thanks to Burak AYDIN.) Use "+03" rather
|
||||
@@ -810,7 +976,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
|
||||
New leap second 2016-12-31 23:59:60 UTC as per IERS Bulletin C 52.
|
||||
(Thanks to Tim Parenti.)
|
||||
|
||||
Changes to past time stamps
|
||||
Changes to past timestamps
|
||||
|
||||
For America/Los_Angeles, spring-forward transition times have been
|
||||
corrected from 02:00 to 02:01 in 1948, and from 02:00 to 01:00 in
|
||||
@@ -859,9 +1025,9 @@ Release 2016g - 2016-09-13 08:56:38 -0700
|
||||
zic no longer generates binary files containing POSIX TZ-like
|
||||
strings that disagree with the local time type after the last
|
||||
explicit transition in the data. This fixes a bug with
|
||||
Africa/Casablanca and Africa/El_Aaiun in some year-2037 time
|
||||
stamps on the reference platform. (Thanks to Alexander Belopolsky
|
||||
for reporting the bug and suggesting a way forward.)
|
||||
Africa/Casablanca and Africa/El_Aaiun in some year-2037 timestamps
|
||||
on the reference platform. (Thanks to Alexander Belopolsky for
|
||||
reporting the bug and suggesting a way forward.)
|
||||
|
||||
If the installed localtime and/or posixrules files are symbolic
|
||||
links, zic now keeps them symbolic links when updating them, for
|
||||
@@ -924,7 +1090,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
|
||||
|
||||
Release 2016f - 2016-07-05 16:26:51 +0200
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
The Egyptian government changed its mind on short notice, and
|
||||
Africa/Cairo will not introduce DST starting 2016-07-07 after all.
|
||||
@@ -933,12 +1099,12 @@ Release 2016f - 2016-07-05 16:26:51 +0200
|
||||
Asia/Novosibirsk switches from +06 to +07 on 2016-07-24 at 02:00.
|
||||
(Thanks to Stepan Golosunov.)
|
||||
|
||||
Changes to past and future time stamps
|
||||
Changes to past and future timestamps
|
||||
|
||||
Asia/Novokuznetsk and Asia/Novosibirsk now use numeric time zone
|
||||
abbreviations instead of invented ones.
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Europe/Minsk's 1992-03-29 spring-forward transition was at 02:00 not 00:00.
|
||||
(Thanks to Stepan Golosunov.)
|
||||
@@ -946,14 +1112,14 @@ Release 2016f - 2016-07-05 16:26:51 +0200
|
||||
|
||||
Release 2016e - 2016-06-14 08:46:16 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Africa/Cairo observes DST in 2016 from July 7 to the end of October.
|
||||
Guess October 27 and 24:00 transitions. (Thanks to Steffen Thorsen.)
|
||||
For future years, guess April's last Thursday to October's last
|
||||
Thursday except for Ramadan.
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Locations while uninhabited now use '-00', not 'zzz', as a
|
||||
placeholder time zone abbreviation. This is inspired by Internet
|
||||
@@ -982,7 +1148,7 @@ Release 2016e - 2016-06-14 08:46:16 -0700
|
||||
|
||||
Release 2016d - 2016-04-17 22:50:29 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
America/Caracas switches from -0430 to -04 on 2016-05-01 at 02:30.
|
||||
(Thanks to Alexander Krivenyshev for the heads-up.)
|
||||
@@ -994,7 +1160,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
|
||||
Tomsk Oblast, Russia, which switches from +06 to +07 on 2016-05-29
|
||||
at 02:00. (Thanks to Stepan Golosunov.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
New zone Europe/Kirov, split off from Europe/Volgograd. It covers
|
||||
Kirov Oblast, Russia, which switched from +04/+05 to +03/+04 on
|
||||
@@ -1017,7 +1183,7 @@ Release 2016d - 2016-04-17 22:50:29 -0700
|
||||
|
||||
Release 2016c - 2016-03-23 00:51:27 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Azerbaijan no longer observes DST. (Thanks to Steffen Thorsen.)
|
||||
|
||||
@@ -1028,7 +1194,7 @@ Release 2016c - 2016-03-23 00:51:27 -0700
|
||||
2014-09-07 through 2016-05-14 daylight saving time instead of
|
||||
standard time, as that seems more appropriate now.
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
|
||||
+02/+03 on 1989-03-26, not 1991-03-31. Europe/Volgograd changed
|
||||
@@ -1053,7 +1219,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
|
||||
POSIX.1-1988 that was removed in POSIX.1-2001. One way to suppress the
|
||||
warnings is to upgrade to zic derived from tz releases 2015f and later.
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
|
||||
Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
|
||||
@@ -1077,7 +1243,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
|
||||
(Thanks to Hannah Kreitem.) Guess future transitions will be March's last
|
||||
Saturday at 01:00, not March's last Friday at 24:00.
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Europe/Chisinau observed DST during 1990, and switched from +04 to
|
||||
+03 at 1990-05-06 02:00, instead of switching from +03 to +02.
|
||||
@@ -1112,7 +1278,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800
|
||||
|
||||
Release 2016a - 2016-01-26 23:28:02 -0800
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
America/Cayman will not observe daylight saving this year after all.
|
||||
Revert our guess that it would. (Thanks to Matt Johnson.)
|
||||
@@ -1124,7 +1290,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
|
||||
to be March 21 00:00 to September 21 00:00. This is likely better
|
||||
than predicting no DST, albeit off by a day every now and then.
|
||||
|
||||
Changes affecting past and future time stamps
|
||||
Changes affecting past and future timestamps
|
||||
|
||||
America/Metlakatla switched from PST all year to AKST/AKDT on
|
||||
2015-11-01 at 02:00. (Thanks to Steffen Thorsen.)
|
||||
@@ -1133,7 +1299,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
|
||||
backward compatibility link to America/Tijuana. Its contents were
|
||||
apparently based on a misreading of Mexican legislation.
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Asia/Karachi's two transition times in 2002 were off by a minute.
|
||||
(Thanks to Matt Johnson.)
|
||||
@@ -1167,7 +1333,7 @@ Release 2016a - 2016-01-26 23:28:02 -0800
|
||||
|
||||
Release 2015g - 2015-10-01 00:39:51 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.
|
||||
(Thanks to Fatih.)
|
||||
@@ -1182,7 +1348,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
|
||||
effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
|
||||
New zone America/Fort_Nelson. (Thanks to Matt Johnson.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Norfolk observed DST from 1974-10-27 02:00 to 1975-03-02 02:00.
|
||||
|
||||
@@ -1212,7 +1378,7 @@ Release 2015g - 2015-10-01 00:39:51 -0700
|
||||
|
||||
Release 2015f - 2015-08-10 18:06:56 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
North Korea switches to +0830 on 2015-08-15. (Thanks to Steffen Thorsen.)
|
||||
The abbreviation remains "KST". (Thanks to Robert Elz.)
|
||||
@@ -1220,7 +1386,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
|
||||
Uruguay no longer observes DST. (Thanks to Steffen Thorsen
|
||||
and Pablo Camargo.)
|
||||
|
||||
Changes affecting past and future time stamps
|
||||
Changes affecting past and future timestamps
|
||||
|
||||
Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC.
|
||||
(Thanks to Roman Tudos.)
|
||||
@@ -1279,7 +1445,7 @@ Release 2015f - 2015-08-10 18:06:56 -0700
|
||||
|
||||
Release 2015e - 2015-06-13 10:56:02 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
|
||||
not 06-13 and 07-18 as we had guessed. (Thanks to Milamber.)
|
||||
@@ -1307,13 +1473,13 @@ Release 2015e - 2015-06-13 10:56:02 -0700
|
||||
|
||||
Release 2015d - 2015-04-24 08:09:46 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Egypt will not observe DST in 2015 and will consider canceling it
|
||||
permanently. For now, assume no DST indefinitely.
|
||||
(Thanks to Ahmed Nazmy and Tim Parenti.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
America/Whitehorse switched from UT -09 to -08 on 1967-05-28, not
|
||||
1966-07-01. Also, Yukon's time zone history is documented better.
|
||||
@@ -1333,16 +1499,16 @@ Release 2015d - 2015-04-24 08:09:46 -0700
|
||||
|
||||
Release 2015c - 2015-04-11 08:55:55 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Egypt's spring-forward transition is at 24:00 on April's last Thursday,
|
||||
not 00:00 on April's last Friday. 2015's transition will therefore be on
|
||||
Thursday, April 30 at 24:00, not Friday, April 24 at 00:00. Similar fixes
|
||||
apply to 2026, 2037, 2043, etc. (Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
The following changes affect some pre-1991 Chile-related time stamps
|
||||
The following changes affect some pre-1991 Chile-related timestamps
|
||||
in America/Santiago, Antarctica/Palmer, and Pacific/Easter.
|
||||
|
||||
The 1910 transition was January 10, not January 1.
|
||||
@@ -1367,8 +1533,8 @@ Release 2015c - 2015-04-11 08:55:55 -0700
|
||||
since we have no data suggesting that they existed.
|
||||
|
||||
One more zone has been turned into a link, as it differed
|
||||
from an existing zone only for older time stamps. As usual,
|
||||
this change affects UT offsets in pre-1970 time stamps only.
|
||||
from an existing zone only for older timestamps. As usual,
|
||||
this change affects UT offsets in pre-1970 timestamps only.
|
||||
The zone's old contents have been moved to the 'backzone' file.
|
||||
The affected zone is America/Montreal.
|
||||
|
||||
@@ -1381,7 +1547,7 @@ Release 2015c - 2015-04-11 08:55:55 -0700
|
||||
|
||||
Release 2015b - 2015-03-19 23:28:11 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Mongolia will start observing DST again this year, from the last
|
||||
Saturday in March at 02:00 to the last Saturday in September at 00:00.
|
||||
@@ -1391,14 +1557,14 @@ Release 2015b - 2015-03-19 23:28:11 -0700
|
||||
correct the fall 2014 transition from September 26 to October 24.
|
||||
Adjust future predictions accordingly. (Thanks to Steffen Thorsen.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
|
||||
regression. (Thanks to Stuart Bishop for reporting the problem.)
|
||||
|
||||
Some more zones have been turned into links, when they differed
|
||||
from existing zones only for older time stamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 time stamps only.
|
||||
from existing zones only for older timestamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 timestamps only.
|
||||
Their old contents have been moved to the 'backzone' file.
|
||||
The affected zones are: America/Antigua, America/Cayman,
|
||||
Pacific/Midway, and Pacific/Saipan.
|
||||
@@ -1429,7 +1595,7 @@ Release 2015b - 2015-03-19 23:28:11 -0700
|
||||
|
||||
Release 2015a - 2015-01-29 22:35:20 -0800
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
The Mexican state of Quintana Roo, represented by America/Cancun,
|
||||
will shift from Central Time with DST to Eastern Time without DST
|
||||
@@ -1442,15 +1608,15 @@ Release 2015a - 2015-01-29 22:35:20 -0800
|
||||
New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
|
||||
(Thanks to Tim Parenti.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Iceland observed DST in 1919 and 1921, and its 1939 fallback
|
||||
transition was Oct. 29, not Nov. 29. Remove incorrect data from
|
||||
Shanks about time in Iceland between 1837 and 1908.
|
||||
|
||||
Some more zones have been turned into links, when they differed
|
||||
from existing zones only for older time stamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 time stamps only.
|
||||
from existing zones only for older timestamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 timestamps only.
|
||||
Their old contents have been moved to the 'backzone' file.
|
||||
The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
|
||||
and Asia/Muscat.
|
||||
@@ -1481,23 +1647,23 @@ Release 2015a - 2015-01-29 22:35:20 -0800
|
||||
|
||||
Release 2014j - 2014-11-10 17:37:11 -0800
|
||||
|
||||
Changes affecting current and future time stamps
|
||||
Changes affecting current and future timestamps
|
||||
|
||||
Turks & Caicos' switch from US eastern time to UT -04 year-round
|
||||
did not occur on 2014-11-02 at 02:00. It's currently scheduled
|
||||
for 2015-11-01 at 02:00. (Thanks to Chris Walton.)
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Many pre-1989 time stamps have been corrected for Asia/Seoul and
|
||||
Many pre-1989 timestamps have been corrected for Asia/Seoul and
|
||||
Asia/Pyongyang, based on sources for the Korean-language Wikipedia
|
||||
entry for time in Korea. (Thanks to Sanghyuk Jung.) Also, no
|
||||
longer guess that Pyongyang mimicked Seoul time after World War II,
|
||||
as this is politically implausible.
|
||||
|
||||
Some more zones have been turned into links, when they differed
|
||||
from existing zones only for older time stamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 time stamps only.
|
||||
from existing zones only for older timestamps. As usual,
|
||||
these changes affect UT offsets in pre-1970 timestamps only.
|
||||
Their old contents have been moved to the 'backzone' file.
|
||||
The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
|
||||
Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
|
||||
@@ -1512,7 +1678,7 @@ Release 2014j - 2014-11-10 17:37:11 -0800
|
||||
|
||||
Release 2014i - 2014-10-21 22:04:57 -0700
|
||||
|
||||
Changes affecting future time stamps
|
||||
Changes affecting future timestamps
|
||||
|
||||
Pacific/Fiji will observe DST from 2014-11-02 02:00 to 2015-01-18 03:00.
|
||||
(Thanks to Ken Rylander for the heads-up.) Guess that future
|
||||
@@ -1532,17 +1698,17 @@ Release 2014i - 2014-10-21 22:04:57 -0700
|
||||
The new abbreviation IDT stands for the pre-1976 use of UT +08 in
|
||||
Indochina, to distinguish it better from ICT (+07).
|
||||
|
||||
Changes affecting past time stamps
|
||||
Changes affecting past timestamps
|
||||
|
||||
Many time stamps have been corrected for Asia/Ho_Chi_Minh before 1976
|
||||
Many timestamps have been corrected for Asia/Ho_Chi_Minh before 1976
|
||||
(thanks to Trần Ngọc Quân for an indirect pointer to Trần Tiến Bình's
|
||||
authoritative book). Asia/Ho_Chi_Minh has been added to
|
||||
zone1970.tab, to give tzselect users in Vietnam two choices,
|
||||
since north and south Vietnam disagreed after our 1970 cutoff.
|
||||
|
||||
Asia/Phnom_Penh and Asia/Vientiane have been turned into links, as
|
||||
they differed from existing zones only for older time stamps. As
|
||||
usual, these changes affect pre-1970 time stamps only. Their old
|
||||
they differed from existing zones only for older timestamps. As
|
||||
usual, these changes affect pre-1970 timestamps only. Their old
|
||||
contents have been moved to the 'backzone' file.
|
||||
|
||||
Changes affecting code
|
||||
@@ -1682,7 +1848,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
|
||||
|
||||
Unless NETBSD_INSPIRED is defined to 0, the tz library now
|
||||
supplies functions for creating and using objects that represent
|
||||
time zones. The new functions are tzalloc, tzfree, localtime_rz,
|
||||
timezones. The new functions are tzalloc, tzfree, localtime_rz,
|
||||
mktime_z, and (if STD_INSPIRED is also defined) posix2time_z and
|
||||
time2posix_z. They are intended for performance: for example,
|
||||
localtime_rz (unlike localtime_r) is trivially thread-safe without
|
||||
@@ -1696,7 +1862,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
|
||||
TZDOBJS=zdump.o CHECK_TIME_T_ALTERNATIVES='.
|
||||
|
||||
zdump now uses localtime_rz if available, as it's significantly faster,
|
||||
and it can help zdump better diagnose invalid time zone names.
|
||||
and it can help zdump better diagnose invalid timezone names.
|
||||
Define HAVE_LOCALTIME_RZ to 0 to suppress this. HAVE_LOCALTIME_RZ
|
||||
defaults to 1 if NETBSD_INSPIRED && USE_LTZ. When localtime_rz is
|
||||
not available, zdump now uses localtime_r and tzset if available,
|
||||
@@ -1712,7 +1878,7 @@ Release 2014g - 2014-08-28 12:31:23 -0700
|
||||
invalid or outlandish input.
|
||||
|
||||
The tz library no longer mishandles leap seconds on platforms with
|
||||
unsigned time_t in time zones that lack ordinary transitions after 1970.
|
||||
unsigned time_t in timezones that lack ordinary transitions after 1970.
|
||||
|
||||
The tz code now attempts to infer TM_GMTOFF and TM_ZONE if not
|
||||
already defined, to make it easier to configure on common platforms.
|
||||
@@ -2036,8 +2202,8 @@ Release 2014d - 2014-05-27 21:34:40 -0700
|
||||
Changes affecting code
|
||||
|
||||
zic no longer generates files containing timestamps before the Big Bang.
|
||||
This works around GNOME bug 730332
|
||||
<https://bugzilla.gnome.org/show_bug.cgi?id=730332>.
|
||||
This works around GNOME glib bug 878
|
||||
<https://gitlab.gnome.org/GNOME/glib/issues/878>
|
||||
(Thanks to Leonardo Chiquitto for reporting the bug, and to
|
||||
Arthur David Olson and James Cloos for suggesting improvements to the fix.)
|
||||
|
||||
@@ -3490,7 +3656,7 @@ Release 2005j - 2005-06-13 14:34:13 -0400
|
||||
These reflect changes to limit the length of time zone abbreviations
|
||||
and the characters used in those abbreviations.
|
||||
|
||||
There are also changes to handle POSIX-style "quoted" time zone
|
||||
There are also changes to handle POSIX-style "quoted" timezone
|
||||
environment variables.
|
||||
|
||||
The changes were circulated on the time zone mailing list; the only
|
||||
@@ -3816,7 +3982,7 @@ Release 1999f - 1999-09-23 09:48:14 -0400
|
||||
Release 1999e - 1999-08-17 15:20:54 -0400
|
||||
|
||||
changes circulated by Paul Eggert, although the change to handling
|
||||
of DST-specifying time zone names has been commented out for now
|
||||
of DST-specifying timezone names has been commented out for now
|
||||
(search for "XXX" in "localtime.c" for details). These files also
|
||||
do not make any changes to the start of DST in Brazil.
|
||||
|
||||
@@ -3941,7 +4107,7 @@ Release code1997i-data1997k - 1997-12-29 09:53:41 -0500
|
||||
|
||||
Release code1997h-data1997j - 1997-12-18 17:47:35 -0500
|
||||
|
||||
minor changes to put "TZif" at the start of each time zone information file
|
||||
minor changes to put "TZif" at the start of each timezone information file
|
||||
|
||||
a rule has also been added to the Makefile so you can
|
||||
make zones
|
||||
@@ -4451,8 +4617,8 @@ consisting of a single tarball tzdb-R.tar.lz with extra data.
|
||||
Release timestamps are taken from the release's commit (for newer,
|
||||
Git-based releases), from the newest file in the tarball (for older
|
||||
releases, where this info is available) or from the email announcing
|
||||
the release (if all else fails; these are marked with a time zone of
|
||||
-0000 and an "is missing!" comment).
|
||||
the release (if all else fails; these are marked with a time zone
|
||||
abbreviation of -0000 and an "is missing!" comment).
|
||||
|
||||
Earlier versions of the code and data were not announced on the tz
|
||||
list and are not summarized here.
|
||||
|
||||
@@ -4,7 +4,7 @@ README for the tz distribution
|
||||
"Any time you want it to be." -- Frank Baxter as The Scientist
|
||||
(from the Bell System film "About Time")
|
||||
|
||||
The Time Zone Database (often called tz or zoneinfo) contains code and
|
||||
The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
|
||||
data that represent the history of local time for many representative
|
||||
locations around the globe. It is updated periodically to reflect
|
||||
changes made by political bodies to time zone boundaries, UTC offsets,
|
||||
@@ -20,17 +20,15 @@ substituting your desired installation directory for "$HOME/tzdir":
|
||||
make TOPDIR=$HOME/tzdir install
|
||||
$HOME/tzdir/usr/bin/zdump -v America/Los_Angeles
|
||||
|
||||
Historical local time information has been included here to:
|
||||
This database of historical local time information has several goals:
|
||||
|
||||
* provide a compendium of data about the history of civil time
|
||||
that is useful even if not 100% accurate;
|
||||
* Provide a compendium of data about the history of civil time that
|
||||
is useful even if not 100% accurate.
|
||||
|
||||
* give an idea of the variety of local time rules that have
|
||||
existed in the past and thus an idea of the variety that may be
|
||||
expected in the future;
|
||||
* Give an idea of the variety of local time rules that have existed
|
||||
in the past and thus may be expected in the future.
|
||||
|
||||
* provide a test of the generality of the local time rule description
|
||||
system.
|
||||
* Test the generality of the local time rule description system.
|
||||
|
||||
The information in the time zone data files is by no means authoritative;
|
||||
fixes and enhancements are welcome. Please see the file CONTRIBUTING
|
||||
|
||||
+50
-71
@@ -1,3 +1,5 @@
|
||||
# tzdb data for Africa and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -6,7 +8,7 @@
|
||||
# [email protected] for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2017-04-09):
|
||||
# From Paul Eggert (2018-05-27):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
@@ -51,13 +53,15 @@
|
||||
# I vaguely recall 'WAT' also being used for -01 in the past but
|
||||
# cannot now come up with solid citations.
|
||||
#
|
||||
# I invented the following abbreviations; corrections are welcome!
|
||||
# +02 WAST West Africa Summer Time (no longer used)
|
||||
# +03 CAST Central Africa Summer Time (no longer used)
|
||||
# +03 SAST South Africa Summer Time (no longer used)
|
||||
# I invented the following abbreviations in the 1990s:
|
||||
# +02 WAST West Africa Summer Time
|
||||
# +03 CAST Central Africa Summer Time
|
||||
# +03 SAST South Africa Summer Time
|
||||
# +03 EAT East Africa Time
|
||||
# 'EAT' also seems to have caught on; the others are rare but are paired
|
||||
# with better-attested non-DST abbreviations.
|
||||
# 'EAT' seems to have caught on and is in current timestamps, and though
|
||||
# the other abbreviations are rarer and are only in past timestamps,
|
||||
# they are paired with better-attested non-DST abbreviations.
|
||||
# Corrections are welcome.
|
||||
|
||||
# Algeria
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
@@ -362,6 +366,13 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
|
||||
# Eritrea
|
||||
# Ethiopia
|
||||
# See Africa/Nairobi.
|
||||
#
|
||||
# Unfortunately tzdb records only Western clock time in use in Ethiopia,
|
||||
# as the tzdb format is not up to properly recording a common Ethiopian
|
||||
# timekeeping practice that is based on solar time. See:
|
||||
# Mortada D. If you have a meeting in Ethiopia, you'd better double
|
||||
# check the time. PRI's The World. 2015-01-30 15:15 -05.
|
||||
# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time
|
||||
|
||||
# Gabon
|
||||
# See Africa/Lagos.
|
||||
@@ -833,94 +844,61 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
|
||||
# <https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
|
||||
# with the patch.
|
||||
|
||||
# From Paul Eggert (2015-06-08):
|
||||
# For now, guess that later spring and fall transitions will use 2015's rules,
|
||||
# and guess that Morocco will switch to standard time at 03:00 the last
|
||||
# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after
|
||||
# Ramadan. To implement this, transition dates for 2016 through 2037 were
|
||||
# determined by running the following program under GNU Emacs 24.3, with the
|
||||
# results integrated by hand into the table below.
|
||||
# (let ((islamic-year 1437))
|
||||
# (require 'cal-islam)
|
||||
# (while (< islamic-year 1460)
|
||||
# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
|
||||
# (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
|
||||
# (sunday 0))
|
||||
# (while (/= sunday (mod (setq a (1- a)) 7)))
|
||||
# (while (/= sunday (mod b 7))
|
||||
# (setq b (1+ b)))
|
||||
# (setq a (calendar-gregorian-from-absolute a))
|
||||
# (setq b (calendar-gregorian-from-absolute b))
|
||||
# (insert
|
||||
# (format
|
||||
# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n"
|
||||
# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n")
|
||||
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
|
||||
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
|
||||
# (setq islamic-year (+ 1 islamic-year))))
|
||||
# From Mohamed Essedik Najd (2018-10-26):
|
||||
# Today, a Moroccan government council approved the perpetual addition
|
||||
# of 60 minutes to the regular Moroccan timezone.
|
||||
# From Brian Inglis (2018-10-26):
|
||||
# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le
|
||||
|
||||
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
|
||||
Rule Morocco 1939 only - Sep 12 0:00 1:00 S
|
||||
Rule Morocco 1939 only - Sep 12 0:00 1:00 -
|
||||
Rule Morocco 1939 only - Nov 19 0:00 0 -
|
||||
Rule Morocco 1940 only - Feb 25 0:00 1:00 S
|
||||
Rule Morocco 1940 only - Feb 25 0:00 1:00 -
|
||||
Rule Morocco 1945 only - Nov 18 0:00 0 -
|
||||
Rule Morocco 1950 only - Jun 11 0:00 1:00 S
|
||||
Rule Morocco 1950 only - Jun 11 0:00 1:00 -
|
||||
Rule Morocco 1950 only - Oct 29 0:00 0 -
|
||||
Rule Morocco 1967 only - Jun 3 12:00 1:00 S
|
||||
Rule Morocco 1967 only - Jun 3 12:00 1:00 -
|
||||
Rule Morocco 1967 only - Oct 1 0:00 0 -
|
||||
Rule Morocco 1974 only - Jun 24 0:00 1:00 S
|
||||
Rule Morocco 1974 only - Jun 24 0:00 1:00 -
|
||||
Rule Morocco 1974 only - Sep 1 0:00 0 -
|
||||
Rule Morocco 1976 1977 - May 1 0:00 1:00 S
|
||||
Rule Morocco 1976 1977 - May 1 0:00 1:00 -
|
||||
Rule Morocco 1976 only - Aug 1 0:00 0 -
|
||||
Rule Morocco 1977 only - Sep 28 0:00 0 -
|
||||
Rule Morocco 1978 only - Jun 1 0:00 1:00 S
|
||||
Rule Morocco 1978 only - Jun 1 0:00 1:00 -
|
||||
Rule Morocco 1978 only - Aug 4 0:00 0 -
|
||||
Rule Morocco 2008 only - Jun 1 0:00 1:00 S
|
||||
Rule Morocco 2008 only - Jun 1 0:00 1:00 -
|
||||
Rule Morocco 2008 only - Sep 1 0:00 0 -
|
||||
Rule Morocco 2009 only - Jun 1 0:00 1:00 S
|
||||
Rule Morocco 2009 only - Jun 1 0:00 1:00 -
|
||||
Rule Morocco 2009 only - Aug 21 0:00 0 -
|
||||
Rule Morocco 2010 only - May 2 0:00 1:00 S
|
||||
Rule Morocco 2010 only - May 2 0:00 1:00 -
|
||||
Rule Morocco 2010 only - Aug 8 0:00 0 -
|
||||
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
|
||||
Rule Morocco 2011 only - Apr 3 0:00 1:00 -
|
||||
Rule Morocco 2011 only - Jul 31 0:00 0 -
|
||||
Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S
|
||||
Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 -
|
||||
Rule Morocco 2012 only - Jul 20 3:00 0 -
|
||||
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
|
||||
Rule Morocco 2012 only - Aug 20 2:00 1:00 -
|
||||
Rule Morocco 2012 only - Sep 30 3:00 0 -
|
||||
Rule Morocco 2013 only - Jul 7 3:00 0 -
|
||||
Rule Morocco 2013 only - Aug 10 2:00 1:00 S
|
||||
Rule Morocco 2013 max - Oct lastSun 3:00 0 -
|
||||
Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S
|
||||
Rule Morocco 2013 only - Aug 10 2:00 1:00 -
|
||||
Rule Morocco 2013 2018 - Oct lastSun 3:00 0 -
|
||||
Rule Morocco 2014 2018 - Mar lastSun 2:00 1:00 -
|
||||
Rule Morocco 2014 only - Jun 28 3:00 0 -
|
||||
Rule Morocco 2014 only - Aug 2 2:00 1:00 S
|
||||
Rule Morocco 2014 only - Aug 2 2:00 1:00 -
|
||||
Rule Morocco 2015 only - Jun 14 3:00 0 -
|
||||
Rule Morocco 2015 only - Jul 19 2:00 1:00 S
|
||||
Rule Morocco 2015 only - Jul 19 2:00 1:00 -
|
||||
Rule Morocco 2016 only - Jun 5 3:00 0 -
|
||||
Rule Morocco 2016 only - Jul 10 2:00 1:00 S
|
||||
Rule Morocco 2016 only - Jul 10 2:00 1:00 -
|
||||
Rule Morocco 2017 only - May 21 3:00 0 -
|
||||
Rule Morocco 2017 only - Jul 2 2:00 1:00 S
|
||||
Rule Morocco 2017 only - Jul 2 2:00 1:00 -
|
||||
Rule Morocco 2018 only - May 13 3:00 0 -
|
||||
Rule Morocco 2018 only - Jun 17 2:00 1:00 S
|
||||
Rule Morocco 2019 only - May 5 3:00 0 -
|
||||
Rule Morocco 2019 only - Jun 9 2:00 1:00 S
|
||||
Rule Morocco 2020 only - Apr 19 3:00 0 -
|
||||
Rule Morocco 2020 only - May 24 2:00 1:00 S
|
||||
Rule Morocco 2021 only - Apr 11 3:00 0 -
|
||||
Rule Morocco 2021 only - May 16 2:00 1:00 S
|
||||
Rule Morocco 2022 only - May 8 2:00 1:00 S
|
||||
Rule Morocco 2023 only - Apr 23 2:00 1:00 S
|
||||
Rule Morocco 2024 only - Apr 14 2:00 1:00 S
|
||||
Rule Morocco 2025 only - Apr 6 2:00 1:00 S
|
||||
Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
|
||||
Rule Morocco 2036 only - Oct 19 3:00 0 -
|
||||
Rule Morocco 2037 only - Oct 4 3:00 0 -
|
||||
Rule Morocco 2018 only - Jun 17 2:00 1:00 -
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
|
||||
0:00 Morocco WE%sT 1984 Mar 16
|
||||
1:00 - CET 1986
|
||||
0:00 Morocco WE%sT
|
||||
0:00 Morocco +00/+01 1984 Mar 16
|
||||
1:00 - +01 1986
|
||||
0:00 Morocco +00/+01 2018 Oct 27
|
||||
1:00 - +01
|
||||
|
||||
# Western Sahara
|
||||
#
|
||||
@@ -935,7 +913,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
|
||||
|
||||
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
|
||||
-1:00 - -01 1976 Apr 14
|
||||
0:00 Morocco WE%sT
|
||||
0:00 Morocco +00/+01 2018 Oct 27
|
||||
1:00 - +01
|
||||
|
||||
# Mozambique
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for Antarctica and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
|
||||
+267
-47
@@ -1,3 +1,5 @@
|
||||
# tzdb data for Asia and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -6,7 +8,7 @@
|
||||
# [email protected] for general use in the future). For more, please see
|
||||
# the file CONTRIBUTING in the tz distribution.
|
||||
|
||||
# From Paul Eggert (2017-01-13):
|
||||
# From Paul Eggert (2018-06-19):
|
||||
#
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
@@ -35,7 +37,8 @@
|
||||
# A reliable and entertaining source about time zones is
|
||||
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
|
||||
#
|
||||
# The following alphabetic abbreviations appear in these tables:
|
||||
# The following alphabetic abbreviations appear in these tables
|
||||
# (corrections are welcome):
|
||||
# std dst
|
||||
# LMT Local Mean Time
|
||||
# 2:00 EET EEST Eastern European Time
|
||||
@@ -44,11 +47,13 @@
|
||||
# 7:00 WIB west Indonesia (Waktu Indonesia Barat)
|
||||
# 8:00 WITA central Indonesia (Waktu Indonesia Tengah)
|
||||
# 8:00 CST China
|
||||
# 8:00 PST PDT* Philippine Standard Time
|
||||
# 8:30 KST KDT Korea when at +0830
|
||||
# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
|
||||
# 9:00 JST JDT Japan
|
||||
# 9:00 KST KDT Korea when at +09
|
||||
# 9:30 ACST Australian Central Standard Time
|
||||
# *I invented the abbreviation PDT; see "Philippines" below.
|
||||
# Otherwise, these tables typically use numeric abbreviations like +03
|
||||
# and +0330 for integer hour and minute UT offsets. Although earlier
|
||||
# editions invented alphabetic time zone abbreviations for every
|
||||
@@ -281,6 +286,29 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
|
||||
|
||||
# China
|
||||
|
||||
# From Paul Eggert (2018-10-02):
|
||||
# The following comes from Table 1 of:
|
||||
# Li Yu. Research on the daylight saving movement in 1940s Shanghai.
|
||||
# Nanjing Journal of Social Sciences. 2014;(2):144-50.
|
||||
# http://oversea.cnki.net/kns55/detail.aspx?dbname=CJFD2014&filename=NJSH201402020
|
||||
# The table lists dates only; I am guessing 00:00 and 24:00 transition times.
|
||||
# Also, the table lists the planned end of DST in 1949, but the corresponding
|
||||
# zone line cuts this off on May 28, when the Communists took power.
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Shang 1940 only - Jun 1 0:00 1:00 D
|
||||
Rule Shang 1940 only - Oct 12 24:00 0 S
|
||||
Rule Shang 1941 only - Mar 15 0:00 1:00 D
|
||||
Rule Shang 1941 only - Nov 1 24:00 0 S
|
||||
Rule Shang 1942 only - Jan 31 0:00 1:00 D
|
||||
Rule Shang 1945 only - Sep 1 24:00 0 S
|
||||
Rule Shang 1946 only - May 15 0:00 1:00 D
|
||||
Rule Shang 1946 only - Sep 30 24:00 0 S
|
||||
Rule Shang 1947 only - Apr 15 0:00 1:00 D
|
||||
Rule Shang 1947 only - Oct 31 24:00 0 S
|
||||
Rule Shang 1948 1949 - May 1 0:00 1:00 D
|
||||
Rule Shang 1948 1949 - Sep 30 24:00 0 S #plan
|
||||
|
||||
# From Guy Harris:
|
||||
# People's Republic of China. Yes, they really have only one time zone.
|
||||
|
||||
@@ -307,18 +335,33 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
|
||||
# time - sort of", Los Angeles Times, 1986-05-05 ... [says] that China began
|
||||
# observing daylight saving time in 1986.
|
||||
|
||||
# From Paul Eggert (2014-06-30):
|
||||
# Shanks & Pottenger have China switching to a single time zone in 1980, but
|
||||
# this doesn't seem to be correct. They also write that China observed summer
|
||||
# DST from 1986 through 1991, which seems to match the above commentary, so
|
||||
# go with them for DST rules as follows:
|
||||
# From P Chan (2018-05-07):
|
||||
# The start and end time of DST in China [from 1986 on] should be 2:00
|
||||
# (i.e. 2:00 to 3:00 at the start and 2:00 to 1:00 at the end)....
|
||||
# Government notices about summer time:
|
||||
#
|
||||
# 1986-04-12 http://www.zj.gov.cn/attach/zfgb/198608.pdf p.21-22
|
||||
# (To establish summer time from 1986. On 4 May, set the clocks ahead one hour
|
||||
# at 2 am. On 14 September, set the clocks backward one hour at 2 am.)
|
||||
#
|
||||
# 1987-02-15 http://www.gov.cn/gongbao/shuju/1987/gwyb198703.pdf p.114
|
||||
# (Summer time in 1987 to start from 12 April until 13 September)
|
||||
#
|
||||
# 1987-09-09 http://www.gov.cn/gongbao/shuju/1987/gwyb198721.pdf p.709
|
||||
# (From 1988, summer time to start from 2 am of the first Sunday of mid-April
|
||||
# until 2 am of the first Sunday of mid-September)
|
||||
#
|
||||
# 1992-03-03 http://www.gov.cn/gongbao/shuju/1992/gwyb199205.pdf p.152
|
||||
# (To suspend summer time from 1992)
|
||||
#
|
||||
# The first page of People's Daily on 12 April 1988 stating that summer time
|
||||
# to begin on 17 April.
|
||||
# http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Shang 1940 only - Jun 3 0:00 1:00 D
|
||||
Rule Shang 1940 1941 - Oct 1 0:00 0 S
|
||||
Rule Shang 1941 only - Mar 16 0:00 1:00 D
|
||||
Rule PRC 1986 only - May 4 0:00 1:00 D
|
||||
Rule PRC 1986 1991 - Sep Sun>=11 0:00 0 S
|
||||
Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
|
||||
Rule PRC 1986 only - May 4 2:00 1:00 D
|
||||
Rule PRC 1986 1991 - Sep Sun>=11 2:00 0 S
|
||||
Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D
|
||||
|
||||
# From Anthony Fok (2001-12-20):
|
||||
# BTW, I did some research on-line and found some info regarding these five
|
||||
@@ -340,10 +383,11 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
|
||||
# Alois Treindl kindly sent me translations of the following two sources:
|
||||
#
|
||||
# (1)
|
||||
# Guo Qingsheng (National Time-Service Center, CAS, Xi'an 710600, China)
|
||||
# Guo Qing-sheng (National Time-Service Center, CAS, Xi'an 710600, China)
|
||||
# Beijing Time at the Beginning of the PRC
|
||||
# China Historical Materials of Science and Technology
|
||||
# (Zhongguo ke ji shi liao, 中国科技史料), Vol. 24, No. 1 (2003)
|
||||
# (Zhongguo ke ji shi liao, 中国科技史料). 2003;24(1):5-9.
|
||||
# http://oversea.cnki.net/kcms/detail/detail.aspx?filename=ZGKS200301000&dbname=CJFD2003
|
||||
# It gives evidence that at the beginning of the PRC, Beijing time was
|
||||
# officially apparent solar time! However, Guo also says that the
|
||||
# evidence is dubious, as the relevant institute of astronomy had not
|
||||
@@ -520,7 +564,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
# Beijing time, used throughout China; represented by Shanghai.
|
||||
Zone Asia/Shanghai 8:05:43 - LMT 1901
|
||||
8:00 Shang C%sT 1949
|
||||
8:00 Shang C%sT 1949 May 28
|
||||
8:00 PRC C%sT
|
||||
# Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
|
||||
# / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.)
|
||||
@@ -749,24 +793,140 @@ Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1
|
||||
8:00 Taiwan C%sT
|
||||
|
||||
# Macau (Macao, Aomen)
|
||||
#
|
||||
# From P Chan (2018-05-10):
|
||||
# * LegisMac
|
||||
# http://legismac.safp.gov.mo/legismac/descqry/Descqry.jsf?lang=pt
|
||||
# A database for searching titles of legal documents of Macau in
|
||||
# Chinese and Portuguese. The term "HORÁRIO DE VERÃO" can be used for
|
||||
# searching decrees about summer time.
|
||||
# * Archives of Macao
|
||||
# http://www.archives.gov.mo/en/bo/
|
||||
# It contains images of old official gazettes.
|
||||
# * The Macao Meteorological and Geophysical Bureau have a page listing the
|
||||
# summer time history. But it is not complete and has some mistakes.
|
||||
# http://www.smg.gov.mo/smg/geophysics/e_t_Summer%20Time.htm
|
||||
# Macau adopted GMT+8 on 30 Oct 1904 to follow Hong Kong. Clocks were
|
||||
# advanced by 25 minutes and 50 seconds. Which means the LMT used was
|
||||
# +7:34:10. As stated in the "Portaria No. 204" dated 21 October 1904
|
||||
# and published in the Official Gazette on 29 October 1904.
|
||||
# http://igallery.icm.gov.mo/Images/Archives/BO/MO_AH_PUB_BO_1904_10/MO_AH_PUB_BO_1904_10_00025_Grey.JPG
|
||||
#
|
||||
# Therefore the 1911 decree of Portugal did not change time in Macau.
|
||||
#
|
||||
# From LegisMac, here is a list of decrees that changed the time ...
|
||||
# [Decree Gazette-no. date; titles omitted in this quotation]
|
||||
# DIL 732 BOCM 51 1941.12.20
|
||||
# DIL 764 BOCM 9S 1942.04.30
|
||||
# DIL 781 BOCM 21 1942.10.10
|
||||
# PT 3434 BOCM 8S 1943.04.17
|
||||
# PT 3504 BOCM 20 1943.09.25
|
||||
# PT 3843 BOCM 39 1945.09.29
|
||||
# PT 3961 BOCM 17 1946.04.27
|
||||
# PT 4026 BOCM 39 1946.09.28
|
||||
# PT 4153 BOCM 16 1947.04.10
|
||||
# PT 4271 BOCM 48 1947.11.29
|
||||
# PT 4374 BOCM 18 1948.05.01
|
||||
# PT 4465 BOCM 44 1948.10.30
|
||||
# PT 4590 BOCM 14 1949.04.02
|
||||
# PT 4666 BOCM 44 1949.10.29
|
||||
# PT 4771 BOCM 12 1950.03.25
|
||||
# PT 4838 BOCM 43 1950.10.28
|
||||
# PT 4946 BOCM 12 1951.03.24
|
||||
# PT 5025 BO 43 1951.10.27
|
||||
# PT 5149 BO 14 1952.04.05
|
||||
# PT 5251 BO 43 1952.10.25
|
||||
# PT 5366 BO 13 1953.03.28
|
||||
# PT 5444 BO 44 1953.10.31
|
||||
# PT 5540 BO 12 1954.03.20
|
||||
# PT 5589 BO 44 1954.10.30
|
||||
# PT 5676 BO 12 1955.03.19
|
||||
# PT 5739 BO 45 1955.11.05
|
||||
# PT 5823 BO 11 1956.03.17
|
||||
# PT 5891 BO 44 1956.11.03
|
||||
# PT 5981 BO 12 1957.03.23
|
||||
# PT 6064 BO 43 1957.10.26
|
||||
# PT 6172 BO 12 1958.03.22
|
||||
# PT 6243 BO 43 1958.10.25
|
||||
# PT 6341 BO 12 1959.03.21
|
||||
# PT 6411 BO 43 1959.10.24
|
||||
# PT 6514 BO 11 1960.03.12
|
||||
# PT 6584 BO 44 1960.10.29
|
||||
# PT 6721 BO 10 1961.03.11
|
||||
# PT 6815 BO 43 1961.10.28
|
||||
# PT 6947 BO 10 1962.03.10
|
||||
# PT 7080 BO 43 1962.10.27
|
||||
# PT 7218 BO 12 1963.03.23
|
||||
# PT 7340 BO 43 1963.10.26
|
||||
# PT 7491 BO 11 1964.03.14
|
||||
# PT 7664 BO 43 1964.10.24
|
||||
# PT 7846 BO 15 1965.04.10
|
||||
# PT 7979 BO 42 1965.10.16
|
||||
# PT 8146 BO 15 1966.04.09
|
||||
# PT 8252 BO 41 1966.10.08
|
||||
# PT 8429 BO 15 1967.04.15
|
||||
# PT 8540 BO 41 1967.10.14
|
||||
# PT 8735 BO 15 1968.04.13
|
||||
# PT 8860 BO 41 1968.10.12
|
||||
# PT 9035 BO 16 1969.04.19
|
||||
# PT 9156 BO 42 1969.10.18
|
||||
# PT 9328 BO 15 1970.04.11
|
||||
# PT 9418 BO 41 1970.10.10
|
||||
# PT 9587 BO 14 1971.04.03
|
||||
# PT 9702 BO 41 1971.10.09
|
||||
# PT 38-A/72 BO 14 1972.04.01
|
||||
# PT 126-A/72 BO 41 1972.10.07
|
||||
# PT 61/73 BO 14 1973.04.07
|
||||
# PT 182/73 BO 40 1973.10.06
|
||||
# PT 282/73 BO 51 1973.12.22
|
||||
# PT 177/74 BO 41 1974.10.12
|
||||
# PT 51/75 BO 15 1975.04.12
|
||||
# PT 173/75 BO 41 1975.10.11
|
||||
# PT 67/76/M BO 14 1976.04.03
|
||||
# PT 169/76/M BO 41 1976.10.09
|
||||
# PT 78/79/M BO 19 1979.05.12
|
||||
# PT 166/79/M BO 42 1979.10.20
|
||||
# Note that DIL 732 does not belong to "HORÁRIO DE VERÃO" according to
|
||||
# LegisMac.... Note that between 1942 and 1945, the time switched
|
||||
# between GMT+9 and GMT+10. Also in 1965 and 1965 the DST ended at 2:30am.
|
||||
|
||||
# From Paul Eggert (2018-05-10):
|
||||
# The 1904 decree says that Macau changed from the meridian of
|
||||
# Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT.
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Macau 1961 1962 - Mar Sun>=16 3:30 1:00 D
|
||||
Rule Macau 1961 1964 - Nov Sun>=1 3:30 0 S
|
||||
Rule Macau 1963 only - Mar Sun>=16 0:00 1:00 D
|
||||
Rule Macau 1964 only - Mar Sun>=16 3:30 1:00 D
|
||||
Rule Macau 1965 only - Mar Sun>=16 0:00 1:00 D
|
||||
Rule Macau 1965 only - Oct 31 0:00 0 S
|
||||
Rule Macau 1966 1971 - Apr Sun>=16 3:30 1:00 D
|
||||
Rule Macau 1966 1971 - Oct Sun>=16 3:30 0 S
|
||||
Rule Macau 1972 1974 - Apr Sun>=15 0:00 1:00 D
|
||||
Rule Macau 1972 1973 - Oct Sun>=15 0:00 0 S
|
||||
Rule Macau 1974 1977 - Oct Sun>=15 3:30 0 S
|
||||
Rule Macau 1975 1977 - Apr Sun>=15 3:30 1:00 D
|
||||
Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 D
|
||||
Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 S
|
||||
# See Europe/Lisbon for info about the 1912 transition.
|
||||
Rule Macau 1942 1943 - Apr 30 23:00 1:00 -
|
||||
Rule Macau 1942 only - Nov 17 23:00 0 -
|
||||
Rule Macau 1943 only - Sep 30 23:00 0 S
|
||||
Rule Macau 1946 only - Apr 30 23:00s 1:00 D
|
||||
Rule Macau 1946 only - Sep 30 23:00s 0 S
|
||||
Rule Macau 1947 only - Apr 19 23:00s 1:00 D
|
||||
Rule Macau 1947 only - Nov 30 23:00s 0 S
|
||||
Rule Macau 1948 only - May 2 23:00s 1:00 D
|
||||
Rule Macau 1948 only - Oct 31 23:00s 0 S
|
||||
Rule Macau 1949 1950 - Apr Sat>=1 23:00s 1:00 D
|
||||
Rule Macau 1949 1950 - Oct lastSat 23:00s 0 S
|
||||
Rule Macau 1951 only - Mar 31 23:00s 1:00 D
|
||||
Rule Macau 1951 only - Oct 28 23:00s 0 S
|
||||
Rule Macau 1952 1953 - Apr Sat>=1 23:00s 1:00 D
|
||||
Rule Macau 1952 only - Nov 1 23:00s 0 S
|
||||
Rule Macau 1953 1954 - Oct lastSat 23:00s 0 S
|
||||
Rule Macau 1954 1956 - Mar Sat>=17 23:00s 1:00 D
|
||||
Rule Macau 1955 only - Nov 5 23:00s 0 S
|
||||
Rule Macau 1956 1964 - Nov Sun>=1 03:30 0 S
|
||||
Rule Macau 1957 1964 - Mar Sun>=18 03:30 1:00 D
|
||||
Rule Macau 1965 1973 - Apr Sun>=16 03:30 1:00 D
|
||||
Rule Macau 1965 1966 - Oct Sun>=16 02:30 0 S
|
||||
Rule Macau 1967 1976 - Oct Sun>=16 03:30 0 S
|
||||
Rule Macau 1973 only - Dec 30 03:30 1:00 D
|
||||
Rule Macau 1975 1976 - Apr Sun>=16 03:30 1:00 D
|
||||
Rule Macau 1979 only - May 13 03:30 1:00 D
|
||||
Rule Macau 1979 only - Oct Sun>=16 03:30 0 S
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Macau 7:34:20 - LMT 1911 Dec 31 16:00u
|
||||
Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30
|
||||
8:00 - CST 1941 Dec 21 23:00
|
||||
9:00 Macau +09/+10 1945 Sep 30 24:00
|
||||
8:00 Macau C%sT
|
||||
|
||||
|
||||
@@ -1471,9 +1631,29 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880
|
||||
# http://www.shugiin.go.jp/internet/itdb_housei.nsf/html/houritsu/00719500331039.htm
|
||||
# ... In summary, it is written as follows. From 24:00 on the first Saturday
|
||||
# in May, until 0:00 on the day after the second Saturday in September.
|
||||
|
||||
# From Phake Nick (2018-09-27):
|
||||
# [T]he webpage authored by National Astronomical Observatory of Japan
|
||||
# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EF.html
|
||||
# ... mentioned that using Showa 23 (year 1948) as example, 13pm of September
|
||||
# 11 in summer time will equal to 0am of September 12 in standard time.
|
||||
# It cited a document issued by the Liaison Office which briefly existed
|
||||
# during the postwar period of Japan, where the detail on implementation
|
||||
# of the summer time is described in the document.
|
||||
# https://eco.mtk.nao.ac.jp/koyomi/wiki/BBFEB9EF2FB2C6BBFEB9EFB2C6BBFEB9EFA4CEBCC2BBDCA4CBA4C4A4A4A4C6.pdf
|
||||
# The text in the document do instruct a fall back to occur at
|
||||
# September 11, 13pm in summer time, while ordinary citizens can
|
||||
# change the clock before they sleep.
|
||||
#
|
||||
# From Paul Eggert (2018-09-27):
|
||||
# This instruction is equivalent to "Sat>=8 25:00", so use that. zic treats
|
||||
# it like "Sun>=9 01:00", which is not quite the same but is the best we can
|
||||
# do in any POSIX or C platform. The "25:00" assumes zic from 2007 or later,
|
||||
# which should be safe now.
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Japan 1948 only - May Sat>=1 24:00 1:00 D
|
||||
Rule Japan 1948 1951 - Sep Sun>=9 0:00 0 S
|
||||
Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S
|
||||
Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D
|
||||
Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D
|
||||
|
||||
@@ -1855,7 +2035,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
|
||||
5:00 - +05
|
||||
# Mangghystaū (KZ-MAN)
|
||||
# Aqtau was not founded until 1963, but it represents an inhabited region,
|
||||
# so include time stamps before 1963.
|
||||
# so include timestamps before 1963.
|
||||
Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
|
||||
4:00 - +04 1930 Jun 21
|
||||
5:00 - +05 1981 Oct 1
|
||||
@@ -1995,6 +2175,10 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
|
||||
# Assembly, as published in Rodong Sinmun.
|
||||
# From Tim Parenti (2018-04-29):
|
||||
# It appears to be the front page story at the top in the right-most column.
|
||||
#
|
||||
# From Paul Eggert (2018-05-04):
|
||||
# The BBC reported that the transition was from 23:30 to 24:00 today.
|
||||
# https://www.bbc.com/news/world-asia-44010705
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
|
||||
@@ -2007,7 +2191,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
|
||||
8:30 - KST 1912 Jan 1
|
||||
9:00 - JST 1945 Aug 24
|
||||
9:00 - KST 2015 Aug 15 00:00
|
||||
8:30 - KST 2018 May 5
|
||||
8:30 - KST 2018 May 4 23:30
|
||||
9:00 - KST
|
||||
|
||||
###############################################################################
|
||||
@@ -2757,19 +2941,35 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
|
||||
# Philippine Star 2014-08-05
|
||||
# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time
|
||||
|
||||
# From Paul Goyette (2018-06-15):
|
||||
# In the Philippines, there is a national law, Republic Act No. 10535
|
||||
# which declares the official time here as "Philippine Standard Time".
|
||||
# The act [1] even specifies use of PST as the abbreviation, although
|
||||
# the FAQ provided by PAGASA [2] uses the "acronym PhST to distinguish
|
||||
# it from the Pacific Standard Time (PST)."
|
||||
# [1] http://www.officialgazette.gov.ph/2013/05/15/republic-act-no-10535/
|
||||
# [2] https://www1.pagasa.dost.gov.ph/index.php/astronomy/philippine-standard-time#republic-act-10535
|
||||
#
|
||||
# From Paul Eggert (2018-06-19):
|
||||
# I surveyed recent news reports, and my impression is that "PST" is
|
||||
# more popular among reliable English-language news sources. This is
|
||||
# not just a measure of Google hit counts: it's also the sizes and
|
||||
# influence of the sources. There is no current abbreviation for DST,
|
||||
# so use "PDT", the usual American style.
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Phil 1936 only - Nov 1 0:00 1:00 -
|
||||
Rule Phil 1937 only - Feb 1 0:00 0 -
|
||||
Rule Phil 1954 only - Apr 12 0:00 1:00 -
|
||||
Rule Phil 1954 only - Jul 1 0:00 0 -
|
||||
Rule Phil 1978 only - Mar 22 0:00 1:00 -
|
||||
Rule Phil 1978 only - Sep 21 0:00 0 -
|
||||
Rule Phil 1936 only - Nov 1 0:00 1:00 D
|
||||
Rule Phil 1937 only - Feb 1 0:00 0 S
|
||||
Rule Phil 1954 only - Apr 12 0:00 1:00 D
|
||||
Rule Phil 1954 only - Jul 1 0:00 0 S
|
||||
Rule Phil 1978 only - Mar 22 0:00 1:00 D
|
||||
Rule Phil 1978 only - Sep 21 0:00 0 S
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
|
||||
8:04:00 - LMT 1899 May 11
|
||||
8:00 Phil +08/+09 1942 May
|
||||
9:00 - +09 1944 Nov
|
||||
8:00 Phil +08/+09
|
||||
8:00 Phil P%sT 1942 May
|
||||
9:00 - JST 1944 Nov
|
||||
8:00 Phil P%sT
|
||||
|
||||
# Qatar
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
@@ -2780,15 +2980,34 @@ Link Asia/Qatar Asia/Bahrain
|
||||
|
||||
# Saudi Arabia
|
||||
#
|
||||
# From Paul Eggert (2014-07-15):
|
||||
# From Paul Eggert (2018-08-29):
|
||||
# Time in Saudi Arabia and other countries in the Arabian peninsula was not
|
||||
# standardized until relatively recently; we don't know when, and possibly it
|
||||
# standardized until 1968 or so; we don't know exactly when, and possibly it
|
||||
# has never been made official. Richard P Hunt, in "Islam city yielding to
|
||||
# modern times", New York Times (1961-04-09), p 20, wrote that only airlines
|
||||
# observed standard time, and that people in Jeddah mostly observed quasi-solar
|
||||
# time, doing so by setting their watches at sunrise to 6 o'clock (or to 12
|
||||
# o'clock for "Arab" time).
|
||||
#
|
||||
# Timekeeping differed depending on who you were and which part of Saudi
|
||||
# Arabia you were in. In 1969, Elias Antar wrote that although a common
|
||||
# practice had been to set one's watch to 12:00 (i.e., midnight) at sunset -
|
||||
# which meant that the time on one side of a mountain could differ greatly from
|
||||
# the time on the other side - many foreigners set their watches to 6pm
|
||||
# instead, while airlines instead used UTC +03 (except in Dhahran, where they
|
||||
# used UTC +04), Aramco used UTC +03 with DST, and the Trans-Arabian Pipe Line
|
||||
# Company used Aramco time in eastern Saudi Arabia and airline time in western.
|
||||
# (The American Military Aid Advisory Group used plain UTC.) Antar writes,
|
||||
# "A man named Higgins, so the story goes, used to run a local power
|
||||
# station. One day, the whole thing became too much for Higgins and he
|
||||
# assembled his staff and laid down the law. 'I've had enough of this,' he
|
||||
# shrieked. 'It is now 12 o'clock Higgins Time, and from now on this station is
|
||||
# going to run on Higgins Time.' And so, until last year, it did." See:
|
||||
# Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3.
|
||||
# http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm
|
||||
# newspapers.com says a similar story about Higgins was published in the Port
|
||||
# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text.
|
||||
#
|
||||
# The TZ database cannot represent quasi-solar time; airline time is the best
|
||||
# we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics
|
||||
# Board (OCLC 42299995) reported that the "... Arabian Government, inaugurated
|
||||
@@ -2798,7 +3017,8 @@ Link Asia/Qatar Asia/Bahrain
|
||||
#
|
||||
# Shanks & Pottenger also state that until 1968-05-01 Saudi Arabia had two
|
||||
# time zones; the other zone, at UT +04, was in the far eastern part of
|
||||
# the country. Ignore this, as it's before our 1970 cutoff.
|
||||
# the country. Presumably this is documenting airline time. Ignore this,
|
||||
# as it's before our 1970 cutoff.
|
||||
#
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for Australasia and environs, and for much of the Pacific
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -361,8 +363,15 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
|
||||
# Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing
|
||||
# Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27),
|
||||
# [Legal Notice No. 41] of an order of the previous day by J Usamate.
|
||||
|
||||
# From Raymond Kumar (2018-07-13):
|
||||
# http://www.fijitimes.com/government-approves-2018-daylight-saving/
|
||||
# ... The daylight saving period will end at 3am on Sunday January 13, 2019.
|
||||
#
|
||||
# From Paul Eggert (2018-07-15):
|
||||
# For now, guess DST from 02:00 the first Sunday in November to 03:00
|
||||
# the first Sunday on or after January 14. Although ad hoc, it matches
|
||||
# the first Sunday on or after January 13. January transitions reportedly
|
||||
# depend on when school terms start. Although the guess is ad hoc, it matches
|
||||
# transitions since late 2014 and seems more likely to match future
|
||||
# practice than guessing no DST.
|
||||
|
||||
@@ -376,7 +385,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
|
||||
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
|
||||
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
|
||||
Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 -
|
||||
Rule Fiji 2015 max - Jan Sun>=14 3:00 0 -
|
||||
Rule Fiji 2015 max - Jan Sun>=13 3:00 0 -
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
|
||||
12:00 Fiji +12/+13
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# tzdb links for backward compatibility
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# This file provides links between current names for time zones
|
||||
# This file provides links between current names for timezones
|
||||
# and their old names. Many names changed in late 1993.
|
||||
|
||||
# Link TARGET LINK-NAME
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
# the file 'backward'.
|
||||
|
||||
# Although zones in this file may be of some use for analyzing
|
||||
# pre-1970 time stamps, they are less reliable, cover only a tiny
|
||||
# pre-1970 timestamps, they are less reliable, cover only a tiny
|
||||
# sliver of the pre-1970 era, and cannot feasibly be improved to cover
|
||||
# most of the era. Because the zones are out of normal scope for the
|
||||
# database, less effort is put into maintaining this file. Many of
|
||||
# the zones were formerly in other source files, but were removed or
|
||||
# replaced by links as their data entries were questionable and/or they
|
||||
# differed from other zones only in pre-1970 time stamps.
|
||||
# differed from other zones only in pre-1970 timestamps.
|
||||
|
||||
# Unless otherwise specified, the source for data through 1990 is:
|
||||
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# tzdb data for ships at sea and other miscellany
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# These entries are mostly present for historical reasons, so that
|
||||
# people in areas not otherwise covered by the tz files could "zic -l"
|
||||
# to a time zone that was right for their area. These days, the
|
||||
# to a timezone that was right for their area. These days, the
|
||||
# tz files cover almost all the inhabited world, and the only practical
|
||||
# need now for the entries that are not on UTC are for ships at sea
|
||||
# that cannot use POSIX TZ settings.
|
||||
|
||||
+67
-10
@@ -1,3 +1,5 @@
|
||||
# tzdb data for Europe and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -517,7 +519,7 @@ Link Europe/London Europe/Isle_of_Man
|
||||
#
|
||||
# To work around this problem, the build procedure can translate the
|
||||
# following data into two forms, one with negative SAVE values and the
|
||||
# other form with a traditional approximation for Irish time stamps
|
||||
# other form with a traditional approximation for Irish timestamps
|
||||
# after 1971-10-31 02:00 UTC; although this approximation has tm_isdst
|
||||
# flags that are reversed, its UTC offsets are correct and this often
|
||||
# suffices. This source file currently uses only nonnegative SAVE
|
||||
@@ -2427,6 +2429,33 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
|
||||
# administratively part of Sakhalin oblast', they appear to have
|
||||
# remained on UTC+11 along with Magadan.
|
||||
|
||||
# From Marat Nigametzianov (2018-07-16):
|
||||
# this is link to order from 1956 about timezone in USSR
|
||||
# http://astro.uni-altai.ru/~orion/blog/2011/11/novyie-granitsyi-chasovyih-poyasov-v-sssr/
|
||||
#
|
||||
# From Paul Eggert (2018-07-16):
|
||||
# Perhaps someone could translate the above-mentioned link and use it
|
||||
# to correct our data for the ex-Soviet Union. It cites the following:
|
||||
# «Поясное время и новые границы часовых поясов» / сост. П.Н. Долгов,
|
||||
# отв. ред. Г.Д. Бурдун - М: Комитет стандартов, мер и измерительных
|
||||
# приборов при Совете Министров СССР, Междуведомственная комиссия
|
||||
# единой службы времени, 1956 г.
|
||||
# This book looks like it would be a helpful resource for the Soviet
|
||||
# Union through 1956. Although a copy was in the Scientific Library
|
||||
# of Tomsk State University, I have not been able to track down a copy nearby.
|
||||
#
|
||||
# From Stepan Golosunov (2018-07-21):
|
||||
# http://astro.uni-altai.ru/~orion/blog/2015/05/center-reforma-ischisleniya-vremeni-br-na-territorii-sssr-v-1957-godu-center/
|
||||
# says that the 1956 decision to change time belts' borders was not
|
||||
# implemented as planned in 1956 and the change happened in 1957.
|
||||
# There is also the problem that actual time zones were different from
|
||||
# the official time belts (and from many time belts' maps) as there were
|
||||
# numerous exceptions to application of time belt rules. For example,
|
||||
# https://ru.wikipedia.org/wiki/Московское_время#Перемещение_границы_применения_московского_времени_на_восток
|
||||
# says that by 1962 there were many regions in the 3rd time belt that
|
||||
# were on Moscow time, referring to a 1962 map. By 1989 number of such
|
||||
# exceptions grew considerably.
|
||||
|
||||
# From Tim Parenti (2014-07-06):
|
||||
# The comments detailing the coverage of each Russian zone are meant to assist
|
||||
# with maintenance only and represent our best guesses as to which regions
|
||||
@@ -2437,9 +2466,6 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
|
||||
# future stability. ISO 3166-2:RU codes are also listed for first-level
|
||||
# divisions where available.
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
|
||||
|
||||
# From Tim Parenti (2014-07-03):
|
||||
# Europe/Kaliningrad covers...
|
||||
# 39 RU-KGD Kaliningrad Oblast
|
||||
@@ -2707,6 +2733,15 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May
|
||||
# 34 RU-VGG Volgograd Oblast
|
||||
# The 1988 transition is from USSR act No. 5 (1988-01-04).
|
||||
|
||||
# From Alexander Fetisov (2018-09-20):
|
||||
# Volgograd region in southern Russia (Europe/Volgograd) change
|
||||
# timezone from UTC+3 to UTC+4 from 28oct2018.
|
||||
# http://sozd.parliament.gov.ru/bill/452878-7
|
||||
#
|
||||
# From Stepan Golosunov (2018-10-11):
|
||||
# The law has been published today on
|
||||
# http://publication.pravo.gov.ru/Document/View/0001201810110037
|
||||
|
||||
Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
|
||||
3:00 - +03 1930 Jun 21
|
||||
4:00 - +04 1961 Nov 11
|
||||
@@ -2715,7 +2750,8 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
|
||||
4:00 - +04 1992 Mar 29 2:00s
|
||||
3:00 Russia +03/+04 2011 Mar 27 2:00s
|
||||
4:00 - +04 2014 Oct 26 2:00s
|
||||
3:00 - +03
|
||||
3:00 - +03 2018 Oct 28 2:00s
|
||||
4:00 - +04
|
||||
|
||||
# From Paul Eggert (2016-11-11):
|
||||
# Europe/Saratov covers:
|
||||
@@ -3404,7 +3440,8 @@ Rule Spain 1978 only - Oct 1 2:00s 0 -
|
||||
#Rule NatSpain 1937 only - May 22 23:00 1:00 S
|
||||
#Rule NatSpain 1937 1938 - Oct Sat>=1 24:00s 0 -
|
||||
#Rule NatSpain 1938 only - Mar 26 23:00 1:00 S
|
||||
# The following rules are copied from Morocco from 1967 through 1978.
|
||||
# The following rules are copied from Morocco from 1967 through 1978,
|
||||
# except with "S" letters.
|
||||
Rule SpainAfrica 1967 only - Jun 3 12:00 1:00 S
|
||||
Rule SpainAfrica 1967 only - Oct 1 0:00 0 -
|
||||
Rule SpainAfrica 1974 only - Jun 24 0:00 1:00 S
|
||||
@@ -3424,6 +3461,7 @@ Zone Africa/Ceuta -0:21:16 - LMT 1900 Dec 31 23:38:44
|
||||
0:00 1:00 WEST 1918 Oct 7 23:00
|
||||
0:00 - WET 1924
|
||||
0:00 Spain WE%sT 1929
|
||||
0:00 - WET 1967 # Help zishrink.awk.
|
||||
0:00 SpainAfrica WE%sT 1984 Mar 16
|
||||
1:00 - CET 1986
|
||||
1:00 EU CE%sT
|
||||
@@ -3609,7 +3647,7 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
|
||||
# http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001
|
||||
# http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006
|
||||
# From Paul Eggert (2016-09-25):
|
||||
# Prefer the above sources to Shanks & Pottenger for time stamps after 1985.
|
||||
# Prefer the above sources to Shanks & Pottenger for timestamps after 1985.
|
||||
|
||||
# From Steffen Thorsen (2007-03-09):
|
||||
# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
|
||||
@@ -3819,10 +3857,29 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
|
||||
# * Ukrainian Government's Resolution of 20.03.1992, No. 139.
|
||||
# http://www.uazakon.com/documents/date_8u/pg_grcasa.htm
|
||||
|
||||
# From Paul Eggert (2018-10-03):
|
||||
# As is usual in tzdb, Ukrainian zones use the most common English spellings.
|
||||
# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in
|
||||
# English for Ukraine's capital, even though it is certainly wrong as a
|
||||
# transliteration of the Ukrainian "Київ". This is similar to tzdb's use of
|
||||
# Europe/Prague, which is certainly wrong as a transliteration of the Czech
|
||||
# "Praha". ("Kiev" came from old Slavic via Russian to English, and "Prague"
|
||||
# came from old Slavic via French to English, so the two cases have something
|
||||
# in common.) Admittedly English-language spelling of Ukrainian names is
|
||||
# controversial, and some day "Kyiv" may become substantially more popular in
|
||||
# English; in the meantime, stick with the traditional English "Kiev" as that
|
||||
# means less disruption for our users.
|
||||
#
|
||||
# Anyway, none of the common English-language spellings (Kiev, Kyiv, Kieff,
|
||||
# Kijeff, Kijev, Kiyef, Kiyeff) do justice to the common pronunciation in
|
||||
# Ukrainian, namely [ˈkɪjiu̯] (IPA). This pronunciation has nothing like an
|
||||
# English "v" or "f", and instead trails off with what an English-speaker
|
||||
# would call a demure "oo" sound, and it would would be better anglicized as
|
||||
# "Kuiyu". Here's a sound file, if you would like to do as the Kuiyuvians do:
|
||||
# https://commons.wikimedia.org/wiki/File:Uk-Київ.ogg
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
# Most of Ukraine since 1970 has been like Kiev.
|
||||
# "Kyiv" is the transliteration of the Ukrainian name, but
|
||||
# "Kiev" is more common in English.
|
||||
# This represents most of Ukraine. See above for the spelling of "Kiev".
|
||||
Zone Europe/Kiev 2:02:04 - LMT 1880
|
||||
2:02:04 - KMT 1924 May 2 # Kiev Mean Time
|
||||
2:00 - EET 1930 Jun 21
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# tzdb data for noncommittal factory settings
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
# For distributors who don't want to put time zone specification in
|
||||
# their installation procedures. Users that run 'date' will get the
|
||||
# For distributors who don't want to specify a timezone in their
|
||||
# installation procedures. Users who run 'date' will get the
|
||||
# time zone abbreviation "-00", indicating that the actual time zone
|
||||
# is unknown.
|
||||
|
||||
|
||||
@@ -204,10 +204,10 @@
|
||||
# current -- the update time stamp, the data and the name of the file
|
||||
# will not change.
|
||||
#
|
||||
# Updated through IERS Bulletin C55
|
||||
# File expires on: 28 December 2018
|
||||
# Updated through IERS Bulletin C56
|
||||
# File expires on: 28 June 2019
|
||||
#
|
||||
#@ 3754944000
|
||||
#@ 3770668800
|
||||
#
|
||||
2272060800 10 # 1 Jan 1972
|
||||
2287785600 11 # 1 Jul 1972
|
||||
@@ -252,4 +252,4 @@
|
||||
# the hash line is also ignored in the
|
||||
# computation.
|
||||
#
|
||||
#h 44dcf58c e28d25aa b36612c8 f3d3e8b5 a8fdf478
|
||||
#h 62ca19f6 96a4ae0a 3708451c 9f8693f4 016604eb
|
||||
+18
-13
@@ -3,21 +3,25 @@
|
||||
# This file is in the public domain.
|
||||
|
||||
# This file is generated automatically from the data in the public-domain
|
||||
# leap-seconds.list file, which is copied from:
|
||||
# ftp://ftp.nist.gov/pub/time/leap-seconds.list
|
||||
# leap-seconds.list file, which can be copied from
|
||||
# <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
|
||||
# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>
|
||||
# or <ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list>.
|
||||
# For more about leap-seconds.list, please see
|
||||
# The NTP Timescale and Leap Seconds
|
||||
# https://www.eecis.udel.edu/~mills/leap.html
|
||||
# <https://www.eecis.udel.edu/~mills/leap.html>.
|
||||
|
||||
# The International Earth Rotation and Reference Systems Service
|
||||
# periodically uses leap seconds to keep UTC to within 0.9 s of UT1
|
||||
# (which measures the true angular orientation of the earth in space); see
|
||||
# Levine J. Coordinated Universal Time and the leap second.
|
||||
# (which measures the true angular orientation of the earth in space)
|
||||
# and publishes leap second data in a copyrighted file
|
||||
# <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>.
|
||||
# See: Levine J. Coordinated Universal Time and the leap second.
|
||||
# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
|
||||
# http://ieeexplore.ieee.org/document/7909995/
|
||||
# <https://ieeexplore.ieee.org/document/7909995>.
|
||||
# There were no leap seconds before 1972, because the official mechanism
|
||||
# accounting for the discrepancy between atomic time and the earth's rotation
|
||||
# did not exist until the early 1970s.
|
||||
# did not exist.
|
||||
|
||||
# The correction (+ or -) is made at the given time, so lines
|
||||
# will typically look like:
|
||||
@@ -25,10 +29,7 @@
|
||||
# or
|
||||
# Leap YEAR MON DAY 23:59:59 - R/S
|
||||
|
||||
# If the leapsecond is Rolling (R) the given time is local time.
|
||||
# If the leapsecond is Stationary (S) the given time is UTC.
|
||||
|
||||
# Leap YEAR MONTH DAY HH:MM:SS CORR R/S
|
||||
# If the leap second is Rolling (R) the given time is local time (unused here).
|
||||
Leap 1972 Jun 30 23:59:60 + S
|
||||
Leap 1972 Dec 31 23:59:60 + S
|
||||
Leap 1973 Dec 31 23:59:60 + S
|
||||
@@ -57,5 +58,9 @@ Leap 2012 Jun 30 23:59:60 + S
|
||||
Leap 2015 Jun 30 23:59:60 + S
|
||||
Leap 2016 Dec 31 23:59:60 + S
|
||||
|
||||
# Updated through IERS Bulletin C55
|
||||
# File expires on: 28 December 2018
|
||||
# POSIX timestamps for the data in this file:
|
||||
#updated 1467936000
|
||||
#expires 1561680000
|
||||
|
||||
# Updated through IERS Bulletin C56
|
||||
# File expires on: 28 June 2019
|
||||
@@ -8,21 +8,25 @@ BEGIN {
|
||||
print "# This file is in the public domain."
|
||||
print ""
|
||||
print "# This file is generated automatically from the data in the public-domain"
|
||||
print "# leap-seconds.list file, which is copied from:"
|
||||
print "# ftp://ftp.nist.gov/pub/time/leap-seconds.list"
|
||||
print "# leap-seconds.list file, which can be copied from"
|
||||
print "# <ftp://ftp.nist.gov/pub/time/leap-seconds.list>"
|
||||
print "# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>"
|
||||
print "# or <ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list>."
|
||||
print "# For more about leap-seconds.list, please see"
|
||||
print "# The NTP Timescale and Leap Seconds"
|
||||
print "# https://www.eecis.udel.edu/~mills/leap.html"
|
||||
print "# <https://www.eecis.udel.edu/~mills/leap.html>."
|
||||
print ""
|
||||
print "# The International Earth Rotation and Reference Systems Service"
|
||||
print "# periodically uses leap seconds to keep UTC to within 0.9 s of UT1"
|
||||
print "# (which measures the true angular orientation of the earth in space); see"
|
||||
print "# Levine J. Coordinated Universal Time and the leap second."
|
||||
print "# (which measures the true angular orientation of the earth in space)"
|
||||
print "# and publishes leap second data in a copyrighted file"
|
||||
print "# <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>."
|
||||
print "# See: Levine J. Coordinated Universal Time and the leap second."
|
||||
print "# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995"
|
||||
print "# http://ieeexplore.ieee.org/document/7909995/"
|
||||
print "# <https://ieeexplore.ieee.org/document/7909995>."
|
||||
print "# There were no leap seconds before 1972, because the official mechanism"
|
||||
print "# accounting for the discrepancy between atomic time and the earth's rotation"
|
||||
print "# did not exist until the early 1970s."
|
||||
print "# did not exist."
|
||||
print ""
|
||||
print "# The correction (+ or -) is made at the given time, so lines"
|
||||
print "# will typically look like:"
|
||||
@@ -30,18 +34,35 @@ BEGIN {
|
||||
print "# or"
|
||||
print "# Leap YEAR MON DAY 23:59:59 - R/S"
|
||||
print ""
|
||||
print "# If the leapsecond is Rolling (R) the given time is local time."
|
||||
print "# If the leapsecond is Stationary (S) the given time is UTC."
|
||||
print ""
|
||||
print "# Leap YEAR MONTH DAY HH:MM:SS CORR R/S"
|
||||
}
|
||||
print "# If the leap second is Rolling (R) the given time is local time (unused here)."
|
||||
|
||||
/^ *$/ { next }
|
||||
monthabbr[ 1] = "Jan"
|
||||
monthabbr[ 2] = "Feb"
|
||||
monthabbr[ 3] = "Mar"
|
||||
monthabbr[ 4] = "Apr"
|
||||
monthabbr[ 5] = "May"
|
||||
monthabbr[ 6] = "Jun"
|
||||
monthabbr[ 7] = "Jul"
|
||||
monthabbr[ 8] = "Aug"
|
||||
monthabbr[ 9] = "Sep"
|
||||
monthabbr[10] = "Oct"
|
||||
monthabbr[11] = "Nov"
|
||||
monthabbr[12] = "Dec"
|
||||
for (i in monthabbr) {
|
||||
monthnum[monthabbr[i]] = i
|
||||
monthlen[i] = 31
|
||||
}
|
||||
monthlen[2] = 28
|
||||
monthlen[4] = monthlen[6] = monthlen[9] = monthlen[11] = 30
|
||||
}
|
||||
|
||||
/^#\tUpdated through/ || /^#\tFile expires on:/ {
|
||||
last_lines = last_lines $0 "\n"
|
||||
}
|
||||
|
||||
/^#[$][ \t]/ { updated = $2 }
|
||||
/^#[@][ \t]/ { expires = $2 }
|
||||
|
||||
/^#/ { next }
|
||||
|
||||
{
|
||||
@@ -57,19 +78,28 @@ BEGIN {
|
||||
} else {
|
||||
sign = "23:59:59\t-"
|
||||
}
|
||||
if (month == "Jan") {
|
||||
m = monthnum[month] - 1
|
||||
if (m == 0) {
|
||||
year--;
|
||||
month = "Dec";
|
||||
day = 31
|
||||
} else if (month == "Jul") {
|
||||
month = "Jun";
|
||||
day = 30
|
||||
m = 12
|
||||
}
|
||||
month = monthabbr[m]
|
||||
day = monthlen[m]
|
||||
day += m == 2 && year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
|
||||
printf "Leap\t%s\t%s\t%s\t%s\tS\n", year, month, day, sign
|
||||
}
|
||||
old_TAI_minus_UTC = TAI_minus_UTC
|
||||
}
|
||||
|
||||
END {
|
||||
# The difference between the NTP and POSIX epochs is 70 years
|
||||
# (including 17 leap days), each 24 hours of 60 minutes of 60
|
||||
# seconds each.
|
||||
epoch_minus_NTP = ((1970 - 1900) * 365 + 17) * 24 * 60 * 60
|
||||
|
||||
print ""
|
||||
print "# POSIX timestamps for the data in this file:"
|
||||
printf "#updated %s\n", updated - epoch_minus_NTP
|
||||
printf "#expires %s\n", expires - epoch_minus_NTP
|
||||
printf "\n%s", last_lines
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for North and Central America and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -48,7 +50,7 @@
|
||||
#
|
||||
# Most of the US soon followed suit. See:
|
||||
# Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56.
|
||||
# http://dx.doi.org/10.2307/3105430
|
||||
# https://dx.doi.org/10.2307/3105430
|
||||
|
||||
# From Paul Eggert (2005-04-16):
|
||||
# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
|
||||
@@ -437,6 +439,19 @@ Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
|
||||
# western South Dakota, far western Texas (El Paso County, Hudspeth County,
|
||||
# and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming
|
||||
#
|
||||
# From Paul Eggert (2018-10-25):
|
||||
# On 1921-03-04 federal law placed all of Texas into the central time zone.
|
||||
# However, El Paso ignored the law for decades and continued to observe
|
||||
# mountain time, on the grounds that that's what they had always done
|
||||
# and they weren't about to let the federal government tell them what to do.
|
||||
# Eventually the federal government gave in and changed the law on
|
||||
# 1970-04-10 to match what El Paso was actually doing. Although
|
||||
# that's slightly after our 1970 cutoff, there is no need to create a
|
||||
# separate zone for El Paso since they were ignoring the law anyway. See:
|
||||
# Long T. El Pasoans were time rebels, fought to stay in Mountain zone.
|
||||
# El Paso Times. 2018-10-24 06:40 -06.
|
||||
# https://www.elpasotimes.com/story/news/local/el-paso/2018/10/24/el-pasoans-were-time-rebels-fought-stay-mountain-zone/1744509002/
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
|
||||
Rule Denver 1920 1921 - Mar lastSun 2:00 1:00 D
|
||||
Rule Denver 1920 only - Oct lastSun 2:00 0 S
|
||||
@@ -706,9 +721,7 @@ Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35
|
||||
Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
|
||||
-10:30 - HST 1933 Apr 30 2:00
|
||||
-10:30 1:00 HDT 1933 May 21 12:00
|
||||
-10:30 - HST 1942 Feb 9 2:00
|
||||
-10:30 1:00 HDT 1945 Sep 30 2:00
|
||||
-10:30 - HST 1947 Jun 8 2:00
|
||||
-10:30 US H%sT 1947 Jun 8 2:00
|
||||
-10:00 - HST
|
||||
|
||||
# Now we turn to US areas that have diverged from the consensus since 1970.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for proposed US election time (this file is obsolete)
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for South America and environs
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
@@ -392,7 +394,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 -
|
||||
# standard time, so let's do that here too. This does not change UTC
|
||||
# offsets, only tm_isdst and the time zone abbreviations. One minor
|
||||
# plus is that this silences a zic complaint that there's no POSIX TZ
|
||||
# setting for time stamps past 2038.
|
||||
# setting for timestamps past 2038.
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
#
|
||||
@@ -925,6 +927,14 @@ Rule Brazil 2016 2022 - Feb Sun>=15 0:00 0 -
|
||||
# ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html
|
||||
# From Steffen Thorsen (2017-12-20):
|
||||
# http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm
|
||||
#
|
||||
# From Fábio Gomes (2018-10-04):
|
||||
# The Brazilian president just announced a new change on this year DST.
|
||||
# It was scheduled to start on November 4th and it was changed to November 18th.
|
||||
# From Rodrigo Brüning Wessler (2018-10-15):
|
||||
# The Brazilian government just announced that the change in DST was
|
||||
# canceled.... Maybe the president Michel Temer also woke up one hour
|
||||
# earlier today. :)
|
||||
Rule Brazil 2018 max - Nov Sun>=1 0:00 1:00 -
|
||||
Rule Brazil 2023 only - Feb Sun>=22 0:00 0 -
|
||||
Rule Brazil 2024 2025 - Feb Sun>=15 0:00 0 -
|
||||
@@ -1231,6 +1241,24 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
|
||||
# they will switch from -03 to -04 one hour after Santiago does that day.
|
||||
# For now, assume that they will not revert.
|
||||
|
||||
# From Juan Correa (2018-08-13):
|
||||
# As of moments ago, the Ministry of Energy in Chile has announced the new
|
||||
# schema for DST. ... Announcement in video (in Spanish):
|
||||
# https://twitter.com/MinEnergia/status/1029000399129374720
|
||||
# From Yonathan Dossow (2018-08-13):
|
||||
# The video says "first Saturday of September", we all know it means Sunday at
|
||||
# midnight.
|
||||
# From Tim Parenti (2018-08-13):
|
||||
# Translating the captions on the video at 0:44-0:55, "We want to announce as
|
||||
# Government that from 2019, Winter Time will be increased to 5 months, between
|
||||
# the first Saturday of April and the first Saturday of September."
|
||||
# At 2:08-2:20, "The Magallanes region will maintain its current time, as
|
||||
# decided by the citizens during 2017, but our Government will promote a
|
||||
# regional dialogue table to gather their opinion on this matter."
|
||||
# https://twitter.com/MinEnergia/status/1029009354001973248
|
||||
# "We will keep the new time policy unchanged for at least the next 4 years."
|
||||
# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely.
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Chile 1927 1931 - Sep 1 0:00 1:00 -
|
||||
Rule Chile 1928 1932 - Apr 1 0:00 0 -
|
||||
@@ -1264,8 +1292,10 @@ Rule Chile 2011 only - May Sun>=2 3:00u 0 -
|
||||
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 -
|
||||
Rule Chile 2012 2014 - Apr Sun>=23 3:00u 0 -
|
||||
Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 -
|
||||
Rule Chile 2016 max - May Sun>=9 3:00u 0 -
|
||||
Rule Chile 2016 max - Aug Sun>=9 4:00u 1:00 -
|
||||
Rule Chile 2016 2018 - May Sun>=9 3:00u 0 -
|
||||
Rule Chile 2016 2018 - Aug Sun>=9 4:00u 1:00 -
|
||||
Rule Chile 2019 max - Apr Sun>=2 3:00u 0 -
|
||||
Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
|
||||
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
|
||||
# (1996-09) says 1998-03-08. Ignore these.
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# tzdb data for System V rules (this file is obsolete)
|
||||
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
|
||||
|
||||
+127
-78
@@ -1,7 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Theory and pragmatics of the tz code and data</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
pre {margin-left: 2em; white-space: pre-wrap;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -11,7 +15,7 @@
|
||||
<ul>
|
||||
<li><a href="#scope">Scope of the <code><abbr>tz</abbr></code>
|
||||
database</a></li>
|
||||
<li><a href="#naming">Names of time zone rulesets</a></li>
|
||||
<li><a href="#naming">Names of timezones</a></li>
|
||||
<li><a href="#abbreviations">Time zone abbreviations</a></li>
|
||||
<li><a href="#accuracy">Accuracy of the <code><abbr>tz</abbr></code>
|
||||
database</a></li>
|
||||
@@ -31,13 +35,13 @@ database</a> attempts to record the history and predicted future of
|
||||
all computer-based clocks that track civil time.
|
||||
It organizes <a href="tz-link.html">time zone and daylight saving time
|
||||
data</a> by partitioning the world into <a
|
||||
href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">regions</a>
|
||||
href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"><dfn>timezones</dfn></a>
|
||||
whose clocks all agree about timestamps that occur after the <a
|
||||
href="https://en.wikipedia.org/wiki/Unix_time">POSIX Epoch</a>
|
||||
(1970-01-01 00:00:00 <a
|
||||
href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time"><abbr
|
||||
title="Coordinated Universal Time">UTC</abbr></a>).
|
||||
The database labels each such region with a notable location and
|
||||
The database labels each timezone with a notable location and
|
||||
records all known clock transitions for that location.
|
||||
Although 1970 is a somewhat-arbitrary cutoff, there are significant
|
||||
challenges to moving the cutoff earlier even by a decade or two, due
|
||||
@@ -46,7 +50,24 @@ became prevalent.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Clock transitions before 1970 are recorded for each such location,
|
||||
Each timezone typically corresponds to a geographical region that is
|
||||
smaller than a traditional time zone, because clocks in a timezone
|
||||
all agree after 1970 whereas a traditional time zone merely
|
||||
specifies current standard time. For example, applications that deal
|
||||
with current and future timestamps in the traditional North
|
||||
American mountain time zone can choose from the timezones
|
||||
<code>America/Denver</code> which observes US-style daylight saving
|
||||
time, <code>America/Mazatlan</code> which observes Mexican-style DST,
|
||||
and <code>America/Phoenix</code> which does not observe DST.
|
||||
Applications that also deal with past timestamps in the mountain time
|
||||
zone can choose from over a dozen timezones, such as
|
||||
<code>America/Boise</code>, <code>America/Edmonton</code>, and
|
||||
<code>America/Hermosillo</code>, each of which currently uses mountain
|
||||
time but differs from other timezones for some timestamps after 1970.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Clock transitions before 1970 are recorded for each timezone,
|
||||
because most systems support timestamps before 1970 and could
|
||||
misbehave if data entries were omitted for pre-1970 transitions.
|
||||
However, the database is not designed for and does not suffice for
|
||||
@@ -73,30 +94,36 @@ Edition.
|
||||
Because the database's scope encompasses real-world changes to civil
|
||||
timekeeping, its model for describing time is more complex than the
|
||||
standard and daylight saving times supported by POSIX.
|
||||
A <code><abbr>tz</abbr></code> region corresponds to a ruleset that can
|
||||
A <code><abbr>tz</abbr></code> timezone corresponds to a ruleset that can
|
||||
have more than two changes per year, these changes need not merely
|
||||
flip back and forth between two alternatives, and the rules themselves
|
||||
can change at times.
|
||||
Whether and when a <code><abbr>tz</abbr></code> region changes its
|
||||
clock, and even the region's notional base offset from UTC, are variable.
|
||||
It does not always make sense to talk about a region's
|
||||
"base offset", since it is not necessarily a single number.
|
||||
Whether and when a timezone changes its
|
||||
clock, and even the timezone's notional base offset from UTC, are variable.
|
||||
It does not always make sense to talk about a timezone's
|
||||
"base offset", which is not necessarily a single number.
|
||||
</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 id="naming">Names of time zone rulesets</h2>
|
||||
<h2 id="naming">Names of timezones</h2>
|
||||
<p>
|
||||
Each <code><abbr>tz</abbr></code> region has a unique name that
|
||||
corresponds to a set of time zone rules.
|
||||
Each timezone has a unique name.
|
||||
Inexperienced users are not expected to select these names unaided.
|
||||
Distributors should provide documentation and/or a simple selection
|
||||
interface that explains the names; for one example, see the
|
||||
interface that explains each name via a map or via descriptive text like
|
||||
"Ruthenia" instead of the timezone name "<code>Europe/Uzhgorod</code>".
|
||||
If geolocation information is available, a selection interface can
|
||||
locate the user on a timezone map or prioritize names that are
|
||||
geographically close. For an example selection interface, see the
|
||||
<code>tzselect</code> program in the <code><abbr>tz</abbr></code> code.
|
||||
The <a href="http://cldr.unicode.org/">Unicode Common Locale Data
|
||||
Repository</a> contains data that may be useful for other selection
|
||||
interfaces.
|
||||
interfaces; it maps timezone names like <code>Europe/Uzhgorod</code>
|
||||
to CLDR names like <code>uauzh</code> which are in turn mapped to
|
||||
locale-dependent strings like "Uzhhorod", "Ungvár", "Ужгород", and
|
||||
"乌日哥罗德".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -106,12 +133,12 @@ among the following goals:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Uniquely identify every region where clocks have agreed since 1970.
|
||||
Uniquely identify every timezone where clocks have agreed since 1970.
|
||||
This is essential for the intended use: static clocks keeping local
|
||||
civil time.
|
||||
</li>
|
||||
<li>
|
||||
Indicate to experts where that region is.
|
||||
Indicate to experts where the timezone's clocks typically are.
|
||||
</li>
|
||||
<li>
|
||||
Be robust in the presence of political changes.
|
||||
@@ -131,9 +158,8 @@ among the following goals:
|
||||
<p>
|
||||
Names normally have the form
|
||||
<var>AREA</var><code>/</code><var>LOCATION</var>, where
|
||||
<var>AREA</var> is the name of a continent or ocean, and
|
||||
<var>LOCATION</var> is the name of a specific location within that
|
||||
region.
|
||||
<var>AREA</var> is a continent or ocean, and
|
||||
<var>LOCATION</var> is a specific location within the area.
|
||||
North and South America share the same area, '<code>America</code>'.
|
||||
Typical names are '<code>Africa/Cairo</code>',
|
||||
'<code>America/New_York</code>', and '<code>Pacific/Honolulu</code>'.
|
||||
@@ -144,7 +170,7 @@ Indiana from other Petersburgs in America.
|
||||
|
||||
<p>
|
||||
Here are the general guidelines used for
|
||||
choosing <code><abbr>tz</abbr></code> region names,
|
||||
choosing timezone names,
|
||||
in decreasing order of importance:
|
||||
</p>
|
||||
|
||||
@@ -196,9 +222,9 @@ in decreasing order of importance:
|
||||
country or territory.
|
||||
</li>
|
||||
<li>
|
||||
If all the clocks in a region have agreed since 1970,
|
||||
do not bother to include more than one location
|
||||
even if subregions' clocks disagreed before 1970.
|
||||
If all the clocks in a timezone have agreed since 1970,
|
||||
do not bother to include more than one timezone
|
||||
even if some of the clocks disagreed before 1970.
|
||||
Otherwise these tables would become annoyingly large.
|
||||
</li>
|
||||
<li>
|
||||
@@ -212,7 +238,7 @@ in decreasing order of importance:
|
||||
Keep locations compact.
|
||||
Use cities or small islands, not countries or regions, so that any
|
||||
future changes do not split individual locations into different
|
||||
<code><abbr>tz</abbr></code> regions.
|
||||
timezones.
|
||||
E.g., prefer <code>Europe/Paris</code> to <code>Europe/France</code>,
|
||||
since
|
||||
<a href="https://en.wikipedia.org/wiki/Time_in_France#History">France
|
||||
@@ -220,10 +246,10 @@ in decreasing order of importance:
|
||||
</li>
|
||||
<li>
|
||||
Use mainstream English spelling, e.g., prefer
|
||||
<code>Europe/Rome</code> to <code>Europe/Roma</code>, and
|
||||
<code>Europe/Rome</code> to <code>Europa/Roma</code>, and
|
||||
prefer <code>Europe/Athens</code> to the Greek
|
||||
<code>Europe/Αθήνα</code> or the Romanized
|
||||
<code>Europe/Athína</code>.
|
||||
<code>Ευρώπη/Αθήνα</code> or the Romanized
|
||||
<code>Evrópi/Athína</code>.
|
||||
The POSIX file name restrictions encourage this guideline.
|
||||
</li>
|
||||
<li>
|
||||
@@ -274,9 +300,9 @@ in decreasing order of importance:
|
||||
|
||||
<p>
|
||||
The file '<code>zone1970.tab</code>' lists geographical locations used
|
||||
to name <code><abbr>tz</abbr></code> regions.
|
||||
to name timezones.
|
||||
It is intended to be an exhaustive list of names for geographic
|
||||
regions as described above; this is a subset of the names in the data.
|
||||
regions as described above; this is a subset of the timezones in the data.
|
||||
Although a '<code>zone1970.tab</code>' location's
|
||||
<a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
|
||||
corresponds to
|
||||
@@ -381,7 +407,7 @@ in decreasing order of importance:
|
||||
EST/EDT/EWT/EPT/EDDT Eastern [North America],
|
||||
EET/EEST Eastern European,
|
||||
GST Guam,
|
||||
HST/HDT Hawaii,
|
||||
HST/HDT/HWT/HPT Hawaii,
|
||||
HKT/HKST Hong Kong,
|
||||
IST India,
|
||||
IST/GMT Irish,
|
||||
@@ -398,6 +424,7 @@ in decreasing order of importance:
|
||||
NZST/NZDT New Zealand 1946–present,
|
||||
PKT/PKST Pakistan,
|
||||
PST/PDT/PWT/PPT/PDDT Pacific,
|
||||
PST/PDT Philippine,
|
||||
SAST South Africa,
|
||||
SST Samoa,
|
||||
WAT/WAST West Africa,
|
||||
@@ -453,7 +480,7 @@ in decreasing order of importance:
|
||||
|
||||
<p>
|
||||
<small>A few abbreviations also follow the pattern that
|
||||
<abbr>GMT<abbr>/<abbr>BST</abbr> established for time in the UK.
|
||||
<abbr>GMT</abbr>/<abbr>BST</abbr> established for time in the UK.
|
||||
They are:
|
||||
CMT/BST for Calamarca Mean Time and Bolivian Summer Time
|
||||
1890–1932,
|
||||
@@ -473,7 +500,7 @@ in decreasing order of importance:
|
||||
</li>
|
||||
<li>
|
||||
If there is no common English abbreviation, use numeric offsets like
|
||||
<code>-</code>05 and <code>+</code>0830 that are generated
|
||||
<code>-</code>05 and <code>+</code>0530 that are generated
|
||||
by <code>zic</code>'s <code>%z</code> notation.
|
||||
</li>
|
||||
<li>
|
||||
@@ -488,8 +515,8 @@ in decreasing order of importance:
|
||||
usage.
|
||||
</li>
|
||||
<li>
|
||||
Use a consistent style in a <code><abbr>tz</abbr></code> region's history.
|
||||
For example, if history tends to use numeric
|
||||
Use a consistent style in a timezone's history.
|
||||
For example, if a history tends to use numeric
|
||||
abbreviations and a particular entry could go either way, use a
|
||||
numeric abbreviation.
|
||||
</li>
|
||||
@@ -501,7 +528,7 @@ in decreasing order of importance:
|
||||
The leading '<code>-</code>' is a flag that the <abbr>UT</abbr> offset is in
|
||||
some sense undefined; this notation is derived
|
||||
from <a href="https://tools.ietf.org/html/rfc3339">Internet
|
||||
<abbr title="Request For Comments">RFC 3339</a>.
|
||||
<abbr title="Request For Comments">RFC</abbr> 3339</a>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -543,7 +570,7 @@ Errors in the <code><abbr>tz</abbr></code> database arise from many sources:
|
||||
The pre-1970 entries in this database cover only a tiny sliver of how
|
||||
clocks actually behaved; the vast majority of the necessary
|
||||
information was lost or never recorded.
|
||||
Thousands more <code><abbr>tz</abbr></code> regions would be needed if
|
||||
Thousands more timezones would be needed if
|
||||
the <code><abbr>tz</abbr></code> database's scope were extended to
|
||||
cover even just the known or guessed history of standard time; for
|
||||
example, the current single entry for France would need to split
|
||||
@@ -608,19 +635,19 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
|
||||
</li>
|
||||
<li>
|
||||
The <code><abbr>tz</abbr></code> database does not record the
|
||||
earliest time for which a <code><abbr>tz</abbr></code> region's
|
||||
earliest time for which a timezone's
|
||||
data entries are thereafter valid for every location in the region.
|
||||
For example, <code>Europe/London</code> is valid for all locations
|
||||
in its region after <abbr>GMT</abbr> was made the standard time,
|
||||
but the date of standardization (1880-08-02) is not in the
|
||||
<code><abbr>tz</abbr></code> database, other than in commentary.
|
||||
For many <code><abbr>tz</abbr></code> regions the earliest time of
|
||||
For many timezones the earliest time of
|
||||
validity is unknown.
|
||||
</li>
|
||||
<li>
|
||||
The <code><abbr>tz</abbr></code> database does not record a
|
||||
region's boundaries, and in many cases the boundaries are not known.
|
||||
For example, the <code><abbr>tz</abbr></code> region
|
||||
For example, the timezone
|
||||
<code>America/Kentucky/Louisville</code> represents a region
|
||||
around the city of Louisville, the boundaries of which are
|
||||
unclear.
|
||||
@@ -664,19 +691,39 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
|
||||
way to specify Easter, these exceptional years are entered as
|
||||
separate <code><abbr>tz</abbr> Rule</code> lines, even though the
|
||||
legal rules did not change.
|
||||
When transitions are known but the historical rules behind them are not,
|
||||
the database contains <code>Zone</code> and <code>Rule</code>
|
||||
entries that are intended to represent only the generated
|
||||
transitions, not any underlying historical rules; however, this
|
||||
intent is recorded at best only in commentary.
|
||||
</li>
|
||||
<li>
|
||||
The <code><abbr>tz</abbr></code> database models pre-standard time
|
||||
The <code><abbr>tz</abbr></code> database models time
|
||||
using the <a
|
||||
href="https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar">proleptic
|
||||
Gregorian calendar</a> and local mean time, but many people used
|
||||
other calendars and other timescales.
|
||||
Gregorian calendar</a> with days containing 24 equal-length hours
|
||||
numbered 00 through 23, except when clock transitions occur.
|
||||
Pre-standard time is modeled as local mean time.
|
||||
However, historically many people used other calendars and other timescales.
|
||||
For example, the Roman Empire used
|
||||
the <a href="https://en.wikipedia.org/wiki/Julian_calendar">Julian
|
||||
calendar</a>,
|
||||
and <a href="https://en.wikipedia.org/wiki/Roman_timekeeping">Roman
|
||||
timekeeping</a> had twelve varying-length daytime hours with a
|
||||
non-hour-based system at night.
|
||||
And even today, some local practices diverge from the Gregorian
|
||||
calendar with 24-hour days. These divergences range from
|
||||
relatively minor, such as Japanese bars giving times like "24:30" for the
|
||||
wee hours of the morning, to more-significant differences such as <a
|
||||
href="https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time">the
|
||||
east African practice of starting the day at dawn</a>, renumbering
|
||||
the Western 06:00 to be 12:00. These practices are largely outside
|
||||
the scope of the <code><abbr>tz</abbr></code> code and data, which
|
||||
provide only limited support for date and time localization
|
||||
such as that required by POSIX. If DST is not used a different time zone
|
||||
can often do the trick; for example, in Kenya a <code>TZ</code> setting
|
||||
like <code><-03>3</code> or <code>America/Cayenne</code> starts
|
||||
the day six hours later than <code>Africa/Nairobi</code> does.
|
||||
</li>
|
||||
<li>
|
||||
Early clocks were less reliable, and data entries do not represent
|
||||
@@ -710,7 +757,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
|
||||
historical <a href="https://en.wikipedia.org/wiki/Solar_time">solar time</a>
|
||||
to more than about one-hour accuracy.
|
||||
See: Stephenson FR, Morrison LV, Hohenkerk CY.
|
||||
<a href="http://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
|
||||
<a href="https://dx.doi.org/10.1098/rspa.2016.0404">Measurement of
|
||||
the Earth's rotation: 720 BC to AD 2015</a>.
|
||||
<cite>Proc Royal Soc A</cite>. 2016 Dec 7;472:20160404.
|
||||
Also see: Espenak F. <a
|
||||
@@ -746,7 +793,7 @@ Any attempt to pass the
|
||||
should be unacceptable to anybody who cares about the facts.
|
||||
In particular, the <code><abbr>tz</abbr></code> database's
|
||||
<abbr>LMT</abbr> offsets should not be considered meaningful, and
|
||||
should not prompt creation of <code><abbr>tz</abbr></code> regions
|
||||
should not prompt creation of timezones
|
||||
merely because two locations
|
||||
differ in <abbr>LMT</abbr> or transitioned to standard time at
|
||||
different dates.
|
||||
@@ -798,7 +845,7 @@ an older <code>zic</code>.
|
||||
<dl>
|
||||
<dt><var>std</var> and <var>dst</var></dt><dd>
|
||||
are 3 or more characters specifying the standard
|
||||
and daylight saving time (<abbr>DST</abbr>) zone names.
|
||||
and daylight saving time (<abbr>DST</abbr>) zone abbreviations.
|
||||
Starting with POSIX.1-2001, <var>std</var> and <var>dst</var>
|
||||
may also be in a quoted form like '<code><+09></code>';
|
||||
this allows "<code>+</code>" and "<code>-</code>" in the names.
|
||||
@@ -870,38 +917,38 @@ an older <code>zic</code>.
|
||||
<pre><code>TZ='Pacific/Auckland'</code></pre>
|
||||
</li>
|
||||
<li>
|
||||
POSIX does not define the exact meaning of <code>TZ</code> values like
|
||||
POSIX does not define the <abbr>DST</abbr> transitions
|
||||
for <code>TZ</code> values like
|
||||
"<code>EST5EDT</code>".
|
||||
Typically the current <abbr>US</abbr> <abbr>DST</abbr> rules
|
||||
are used to interpret such values, but this means that the
|
||||
<abbr>US</abbr> <abbr>DST</abbr> rules are compiled into each
|
||||
program that does time conversion.
|
||||
This means that when
|
||||
<abbr>US</abbr> time conversion rules change (as in the United
|
||||
States in 1987), all programs that do time conversion must be
|
||||
Traditionally the current <abbr>US</abbr> <abbr>DST</abbr> rules
|
||||
were used to interpret such values, but this meant that the
|
||||
<abbr>US</abbr> <abbr>DST</abbr> rules were compiled into each
|
||||
program that did time conversion. This meant that when
|
||||
<abbr>US</abbr> time conversion rules changed (as in the United
|
||||
States in 1987), all programs that did time conversion had to be
|
||||
recompiled to ensure proper results.
|
||||
</li>
|
||||
<li>
|
||||
The <code>TZ</code> environment variable is process-global, which
|
||||
makes it hard to write efficient, thread-safe applications that
|
||||
need access to multiple time zone rulesets.
|
||||
need access to multiple timezones.
|
||||
</li>
|
||||
<li>
|
||||
In POSIX, there is no tamper-proof way for a process to learn the
|
||||
system's best idea of local wall clock.
|
||||
(This is important for applications that an administrator wants
|
||||
This is important for applications that an administrator wants
|
||||
used only at certain times – without regard to whether the
|
||||
user has fiddled the
|
||||
<code>TZ</code> environment variable.
|
||||
While an administrator can "do everything in <abbr>UT</abbr>" to
|
||||
get around the problem, doing so is inconvenient and precludes
|
||||
handling daylight saving time shifts - as might be required to
|
||||
limit phone calls to off-peak hours.)
|
||||
handling daylight saving time shifts – as might be required to
|
||||
limit phone calls to off-peak hours.
|
||||
</li>
|
||||
<li>
|
||||
POSIX provides no convenient and efficient way to determine
|
||||
the <abbr>UT</abbr> offset and time zone abbreviation of arbitrary
|
||||
timestamps, particularly for <code><abbr>tz</abbr></code> regions
|
||||
timestamps, particularly for timezones
|
||||
that do not fit into the POSIX model.
|
||||
</li>
|
||||
<li>
|
||||
@@ -919,7 +966,7 @@ an older <code>zic</code>.
|
||||
Unsigned 32-bit integers are used on one or two platforms, and 36-bit
|
||||
and 40-bit integers are also used occasionally.
|
||||
Although earlier POSIX versions allowed <code>time_t</code> to be a
|
||||
floating-point type, this was not supported by any practical systems,
|
||||
floating-point type, this was not supported by any practical system,
|
||||
and POSIX.1-2013 and the <code><abbr>tz</abbr></code> code both
|
||||
require <code>time_t</code> to be an integer type.
|
||||
</li>
|
||||
@@ -931,15 +978,16 @@ an older <code>zic</code>.
|
||||
<li>
|
||||
<p>
|
||||
The <code>TZ</code> environment variable is used in generating
|
||||
the name of a binary file from which time-related information is read
|
||||
the name of a file from which time-related information is read
|
||||
(or is interpreted à la POSIX); <code>TZ</code> is no longer
|
||||
constrained to be a three-letter time zone
|
||||
abbreviation followed by a number of hours and an optional three-letter
|
||||
daylight time zone abbreviation.
|
||||
constrained to be a string containing abbreviations
|
||||
and numeric data as described <a href="#POSIX">above</a>.
|
||||
The file's format is <dfn><abbr>TZif</abbr></dfn>,
|
||||
a timezone information format that contains binary data.
|
||||
The daylight saving time rules to be used for a
|
||||
particular <code><abbr>tz</abbr></code> region are encoded in the
|
||||
binary file; the format of the file
|
||||
allows U.S., Australian, and other rules to be encoded, and
|
||||
particular timezone are encoded in the
|
||||
<abbr>TZif</abbr> file; the format of the file allows <abbr>US</abbr>,
|
||||
Australian, and other rules to be encoded, and
|
||||
allows for situations where more than two time zone
|
||||
abbreviations are used.
|
||||
</p>
|
||||
@@ -949,15 +997,15 @@ an older <code>zic</code>.
|
||||
might cause "old" programs (that expect <code>TZ</code> to have a
|
||||
certain form) to operate incorrectly; consideration was given to using
|
||||
some other environment variable (for example, <code>TIMEZONE</code>)
|
||||
to hold the string used to generate the binary file's name.
|
||||
to hold the string used to generate the <abbr>TZif</abbr> file's name.
|
||||
In the end, however, it was decided to continue using
|
||||
<code>TZ</code>: it is widely used for time zone purposes;
|
||||
separately maintaining both <code>TZ</code>
|
||||
and <code>TIMEZONE</code> seemed a nuisance; and systems where
|
||||
"new" forms of <code>TZ</code> might cause problems can simply
|
||||
use <code>TZ</code> values such as "<code>EST5EDT</code>" which
|
||||
can be used both by "new" programs (à la POSIX) and "old"
|
||||
programs (as zone names and offsets).
|
||||
use legacy <code>TZ</code> values such as "<code>EST5EDT</code>" which
|
||||
can be used by "new" programs as well as by "old" programs that
|
||||
assume pre-POSIX <code>TZ</code> values.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
@@ -972,7 +1020,7 @@ an older <code>zic</code>.
|
||||
Functions <code>tzalloc</code>, <code>tzfree</code>,
|
||||
<code>localtime_rz</code>, and <code>mktime_z</code> for
|
||||
more-efficient thread-safe applications that need to use multiple
|
||||
time zone rulesets.
|
||||
timezones.
|
||||
The <code>tzalloc</code> and <code>tzfree</code> functions
|
||||
allocate and free objects of type <code>timezone_t</code>,
|
||||
and <code>localtime_rz</code> and <code>mktime_z</code> are
|
||||
@@ -1093,8 +1141,9 @@ The vestigial <abbr>API</abbr>s are:
|
||||
standardization proposals.
|
||||
</li>
|
||||
<li>
|
||||
Other time conversion proposals, in particular the one developed
|
||||
by folks at Hewlett Packard, offer a wider selection of functions
|
||||
Other time conversion proposals, in particular those supported by the
|
||||
<a href="https://howardhinnant.github.io/date/tz.html">Time Zone
|
||||
Database Parser</a>, offer a wider selection of functions
|
||||
that provide capabilities beyond those provided here.
|
||||
The absence of such functions from this package is not meant to
|
||||
discourage the development, standardization, or use of such
|
||||
@@ -1116,8 +1165,8 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
A set of <code><abbr>tz</abbr></code> region names as per
|
||||
"<a href="#naming">Names of time zone rulesets</a>" above.
|
||||
A set of timezone names as per
|
||||
"<a href="#naming">Names of timezones</a>" above.
|
||||
</li>
|
||||
<li>
|
||||
Library functions described in "<a href="#functions">Time and date
|
||||
@@ -1186,7 +1235,7 @@ They sometimes disagree.
|
||||
<h2 id="planets">Time and time zones on other planets</h2>
|
||||
<p>
|
||||
Some people's work schedules
|
||||
use <a href="https://en.wikipedia.org/wiki/Timekeeping on Mars">Mars time</a>.
|
||||
use <a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.
|
||||
Jet Propulsion Laboratory (JPL) coordinators kept Mars time on
|
||||
and off during the
|
||||
<a href="https://en.wikipedia.org/wiki/Mars_Pathfinder#End_of_mission">Mars
|
||||
@@ -1218,7 +1267,7 @@ Coordinated Time (<abbr>MTC</abbr>)</a>.
|
||||
|
||||
<p>
|
||||
Each landed mission on Mars has adopted a different reference for
|
||||
solar time keeping, so there is no real standard for Mars time zones.
|
||||
solar timekeeping, so there is no real standard for Mars time zones.
|
||||
For example, the
|
||||
<a href="https://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars
|
||||
Exploration Rover</a> project (2004) defined two time zones "Local
|
||||
@@ -1290,7 +1339,7 @@ Sources for time on other planets:
|
||||
Matt Williams,
|
||||
"<a href="https://www.universetoday.com/37481/days-of-the-planets/">How
|
||||
long is a day on the other planets of the solar system?</a>"
|
||||
(2017-04-27).
|
||||
(2016-01-20).
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2018e
|
||||
2018g
|
||||
@@ -1,4 +1,5 @@
|
||||
#! /bin/sh
|
||||
: 'Determine whether year is of appropriate type (this file is obsolete).'
|
||||
|
||||
: 'This file is in the public domain, so clarified as of'
|
||||
: '2006-07-17 by Arthur David Olson.'
|
||||
|
||||
@@ -80,6 +80,13 @@ DATAFORM != "main" {
|
||||
if (comment_out) {
|
||||
sub(/^/, "#")
|
||||
}
|
||||
|
||||
# In rearguard format, change the Japan rule line with "Sat>=8 25:00"
|
||||
# to "Sun>=9 1:00", to cater to zic before 2007 and to older Java.
|
||||
if (!vanguard && $1 == "Rule" && $7 == "Sat>=8" && $8 == "25:00") {
|
||||
sub(/Sat>=8/, "Sun>=9")
|
||||
sub(/25:00/, " 1:00")
|
||||
}
|
||||
}
|
||||
|
||||
# If a Link line is followed by a Zone line for the same data, comment
|
||||
|
||||
+182
-19
@@ -6,28 +6,146 @@
|
||||
# 'zic' should treat this script's output as if it were identical to
|
||||
# this script's input.
|
||||
|
||||
# Record a hash N for the new name NAME, checking for collisions.
|
||||
|
||||
# Return a new rule name.
|
||||
# N_RULE_NAMES keeps track of how many rule names have been generated.
|
||||
|
||||
function gen_rule_name(alphabet, base, rule_name, n, digit)
|
||||
function record_hash(n, name)
|
||||
{
|
||||
alphabet = ""
|
||||
alphabet = alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
alphabet = alphabet "abcdefghijklmnopqrstuvwxyz"
|
||||
alphabet = alphabet "!$%&'()*+,./:;<=>?@[\\]^_`{|}~"
|
||||
base = length(alphabet)
|
||||
rule_name = ""
|
||||
n = n_rule_names++
|
||||
if (used_hashes[n]) {
|
||||
printf "# ! collision: %s %s\n", used_hashes[n], name
|
||||
exit 1
|
||||
}
|
||||
used_hashes[n] = name
|
||||
}
|
||||
|
||||
do {
|
||||
n -= rule_name && n <= base
|
||||
digit = n % base
|
||||
rule_name = substr(alphabet, digit + 1, 1) rule_name
|
||||
n = (n - digit) / base
|
||||
} while (n);
|
||||
# Return a shortened rule name representing NAME,
|
||||
# and record this relationship to the hash table.
|
||||
|
||||
return rule_name
|
||||
function gen_rule_name(name, n)
|
||||
{
|
||||
# Use a simple memonic: the first two letters.
|
||||
n = substr(name, 1, 2)
|
||||
record_hash(n, name)
|
||||
# printf "# %s = %s\n", n, name
|
||||
return n
|
||||
}
|
||||
|
||||
function prehash_rule_names(name)
|
||||
{
|
||||
# Rule names are not part of the tzdb API, so substitute shorter
|
||||
# ones. Shortening them consistently from one release to the next
|
||||
# simplifies comparison of the output. That being said, the
|
||||
# 1-letter names below are not standardized in any way, and can
|
||||
# change arbitrarily from one release to the next, as the main goal
|
||||
# here is compression not comparison.
|
||||
|
||||
# Abbreviating these rules names to one letter saved the most space
|
||||
# circa 2018e.
|
||||
rule["Arg"] = "A"
|
||||
rule["Brazil"] = "B"
|
||||
rule["Canada"] = "C"
|
||||
rule["Denmark"] = "D"
|
||||
rule["EU"] = "E"
|
||||
rule["France"] = "F"
|
||||
rule["GB-Eire"] = "G"
|
||||
rule["Halifax"] = "H"
|
||||
rule["Italy"] = "I"
|
||||
rule["Jordan"] = "J"
|
||||
rule["Egypt"] = "K" # "Kemet" in ancient Egyptian
|
||||
rule["Libya"] = "L"
|
||||
rule["Morocco"] = "M"
|
||||
rule["Neth"] = "N"
|
||||
rule["Poland"] = "O" # arbitrary
|
||||
rule["Palestine"] = "P"
|
||||
rule["Cuba"] = "Q" # Its start sounds like "Q".
|
||||
rule["Russia"] = "R"
|
||||
rule["Syria"] = "S"
|
||||
rule["Turkey"] = "T"
|
||||
rule["Uruguay"] = "U"
|
||||
rule["Vincennes"] = "V"
|
||||
rule["Winn"] = "W"
|
||||
rule["Mongol"] = "X" # arbitrary
|
||||
rule["NT_YK"] = "Y"
|
||||
rule["Zion"] = "Z"
|
||||
rule["Austria"] = "a"
|
||||
rule["Belgium"] = "b"
|
||||
rule["C-Eur"] = "c"
|
||||
rule["Algeria"] = "d" # country code DZ
|
||||
rule["E-Eur"] = "e"
|
||||
rule["Taiwan"] = "f" # Formosa
|
||||
rule["Greece"] = "g"
|
||||
rule["Hungary"] = "h"
|
||||
rule["Iran"] = "i"
|
||||
rule["StJohns"] = "j"
|
||||
rule["Chatham"] = "k" # arbitrary
|
||||
rule["Lebanon"] = "l"
|
||||
rule["Mexico"] = "m"
|
||||
rule["Tunisia"] = "n" # country code TN
|
||||
rule["Moncton"] = "o" # arbitrary
|
||||
rule["Port"] = "p"
|
||||
rule["Albania"] = "q" # arbitrary
|
||||
rule["Regina"] = "r"
|
||||
rule["Spain"] = "s"
|
||||
rule["Toronto"] = "t"
|
||||
rule["US"] = "u"
|
||||
rule["Louisville"] = "v" # ville
|
||||
rule["Iceland"] = "w" # arbitrary
|
||||
rule["Chile"] = "x" # arbitrary
|
||||
rule["Para"] = "y" # country code PY
|
||||
rule["Romania"] = "z" # arbitrary
|
||||
rule["Macau"] = "_" # arbitrary
|
||||
|
||||
# Use ISO 3166 alpha-2 country codes for remaining names that are countries.
|
||||
# This is more systematic, and avoids collisions (e.g., Malta and Moldova).
|
||||
rule["Armenia"] = "AM"
|
||||
rule["Aus"] = "AU"
|
||||
rule["Azer"] = "AZ"
|
||||
rule["Barb"] = "BB"
|
||||
rule["Dhaka"] = "BD"
|
||||
rule["Bulg"] = "BG"
|
||||
rule["Bahamas"] = "BS"
|
||||
rule["Belize"] = "BZ"
|
||||
rule["Swiss"] = "CH"
|
||||
rule["Cook"] = "CK"
|
||||
rule["PRC"] = "CN"
|
||||
rule["Cyprus"] = "CY"
|
||||
rule["Czech"] = "CZ"
|
||||
rule["Germany"] = "DE"
|
||||
rule["DR"] = "DO"
|
||||
rule["Ecuador"] = "EC"
|
||||
rule["Finland"] = "FI"
|
||||
rule["Fiji"] = "FJ"
|
||||
rule["Falk"] = "FK"
|
||||
rule["Ghana"] = "GH"
|
||||
rule["Guat"] = "GT"
|
||||
rule["Hond"] = "HN"
|
||||
rule["Haiti"] = "HT"
|
||||
rule["Eire"] = "IE"
|
||||
rule["Iraq"] = "IQ"
|
||||
rule["Japan"] = "JP"
|
||||
rule["Kyrgyz"] = "KG"
|
||||
rule["ROK"] = "KR"
|
||||
rule["Latvia"] = "LV"
|
||||
rule["Lux"] = "LX"
|
||||
rule["Moldova"] = "MD"
|
||||
rule["Malta"] = "MT"
|
||||
rule["Mauritius"] = "MU"
|
||||
rule["Namibia"] = "NA"
|
||||
rule["Nic"] = "NI"
|
||||
rule["Norway"] = "NO"
|
||||
rule["Peru"] = "PE"
|
||||
rule["Phil"] = "PH"
|
||||
rule["Pakistan"] = "PK"
|
||||
rule["Sudan"] = "SD"
|
||||
rule["Salv"] = "SV"
|
||||
rule["Tonga"] = "TO"
|
||||
rule["Vanuatu"] = "VU"
|
||||
|
||||
# Avoid collisions.
|
||||
rule["Detroit"] = "Dt" # De = Denver
|
||||
|
||||
for (name in rule) {
|
||||
record_hash(rule[name], name)
|
||||
}
|
||||
}
|
||||
|
||||
# Process an input line and save it for later output.
|
||||
@@ -106,7 +224,7 @@ function process_input_line(line, field, end, i, n, startdef)
|
||||
i = field[1] == "Z" ? 4 : field[1] == "Li" ? 0 : 2
|
||||
if (i && field[i] ~ /^[^-+0-9]/) {
|
||||
if (!rule[field[i]])
|
||||
rule[field[i]] = gen_rule_name()
|
||||
rule[field[i]] = gen_rule_name(field[i])
|
||||
field[i] = rule[field[i]]
|
||||
}
|
||||
|
||||
@@ -144,8 +262,53 @@ function output_saved_lines(i)
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
# Files that the output normally depends on.
|
||||
default_dep["africa"] = 1
|
||||
default_dep["antarctica"] = 1
|
||||
default_dep["asia"] = 1
|
||||
default_dep["australasia"] = 1
|
||||
default_dep["backward"] = 1
|
||||
default_dep["etcetera"] = 1
|
||||
default_dep["europe"] = 1
|
||||
default_dep["factory"] = 1
|
||||
default_dep["northamerica"] = 1
|
||||
default_dep["southamerica"] = 1
|
||||
default_dep["systemv"] = 1
|
||||
default_dep["ziguard.awk"] = 1
|
||||
default_dep["zishrink.awk"] = 1
|
||||
|
||||
# Output a version string from 'version' and related configuration variables
|
||||
# supported by tzdb's Makefile. If you change the makefile or any other files
|
||||
# that affect the output of this script, you should append '-SOMETHING'
|
||||
# to the contents of 'version', where SOMETHING identifies what was changed.
|
||||
|
||||
ndeps = split(deps, dep)
|
||||
ddeps = ""
|
||||
for (i = 1; i <= ndeps; i++) {
|
||||
if (default_dep[dep[i]]) {
|
||||
default_dep[dep[i]]++
|
||||
} else {
|
||||
ddeps = ddeps " " dep[i]
|
||||
}
|
||||
}
|
||||
for (d in default_dep) {
|
||||
if (default_dep[d] == 1) {
|
||||
ddeps = ddeps " !" d
|
||||
}
|
||||
}
|
||||
print "# version", version
|
||||
if (dataform != "main") {
|
||||
print "# dataform", dataform
|
||||
}
|
||||
if (redo != "posix_right") {
|
||||
print "# redo " redo
|
||||
}
|
||||
if (ddeps) {
|
||||
print "# ddeps" ddeps
|
||||
}
|
||||
print "# This zic input file is in the public domain."
|
||||
|
||||
prehash_rule_names()
|
||||
}
|
||||
|
||||
/^[\t ]*[^#\t ]/ {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# tz zone descriptions (deprecated version)
|
||||
# tzdb timezone descriptions (deprecated version)
|
||||
#
|
||||
# This file is in the public domain, so clarified as of
|
||||
# 2009-05-17 by Arthur David Olson.
|
||||
#
|
||||
# From Paul Eggert (2014-07-31):
|
||||
# From Paul Eggert (2018-06-27):
|
||||
# This file is intended as a backward-compatibility aid for older programs.
|
||||
# New programs should use zone1970.tab. This file is like zone1970.tab (see
|
||||
# zone1970.tab's comments), but with the following additional restrictions:
|
||||
@@ -12,13 +12,13 @@
|
||||
# 2. The first data column contains exactly one country code.
|
||||
#
|
||||
# Because of (2), each row stands for an area that is the intersection
|
||||
# of a region identified by a country code and of a zone where civil
|
||||
# of a region identified by a country code and of a timezone where civil
|
||||
# clocks have agreed since 1970; this is a narrower definition than
|
||||
# that of zone1970.tab.
|
||||
#
|
||||
# This table is intended as an aid for users, to help them select time
|
||||
# zone data entries appropriate for their practical needs. It is not
|
||||
# intended to take or endorse any position on legal or territorial claims.
|
||||
# This table is intended as an aid for users, to help them select timezones
|
||||
# appropriate for their practical needs. It is not intended to take or
|
||||
# endorse any position on legal or territorial claims.
|
||||
#
|
||||
#country-
|
||||
#code coordinates TZ comments
|
||||
@@ -268,7 +268,7 @@ MM +1647+09610 Asia/Yangon
|
||||
MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas)
|
||||
MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
|
||||
MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar
|
||||
MO +2214+11335 Asia/Macau
|
||||
MO +221150+1133230 Asia/Macau
|
||||
MP +1512+14545 Pacific/Saipan
|
||||
MQ +1436-06105 America/Martinique
|
||||
MR +1806-01557 Africa/Nouakchott
|
||||
|
||||
+16
-16
@@ -1,36 +1,36 @@
|
||||
# tz zone descriptions
|
||||
# tzdb timezone descriptions
|
||||
#
|
||||
# This file is in the public domain.
|
||||
#
|
||||
# From Paul Eggert (2017-10-01):
|
||||
# This file contains a table where each row stands for a zone where
|
||||
# civil time stamps have agreed since 1970. Columns are separated by
|
||||
# From Paul Eggert (2018-06-27):
|
||||
# This file contains a table where each row stands for a timezone where
|
||||
# civil timestamps have agreed since 1970. Columns are separated by
|
||||
# a single tab. Lines beginning with '#' are comments. All text uses
|
||||
# UTF-8 encoding. The columns of the table are as follows:
|
||||
#
|
||||
# 1. The countries that overlap the zone, as a comma-separated list
|
||||
# 1. The countries that overlap the timezone, as a comma-separated list
|
||||
# of ISO 3166 2-character country codes.
|
||||
# See the file '/usr/share/misc/iso3166'.
|
||||
# 2. Latitude and longitude of the zone's principal location
|
||||
# 2. Latitude and longitude of the timezone's principal location
|
||||
# in ISO 6709 sign-degrees-minutes-seconds format,
|
||||
# either ±DDMM±DDDMM or ±DDMMSS±DDDMMSS,
|
||||
# first latitude (+ is north), then longitude (+ is east).
|
||||
# 3. Zone name used in value of TZ environment variable.
|
||||
# Please see the theory.html file for how zone names are chosen.
|
||||
# If multiple zones overlap a country, each has a row in the
|
||||
# 3. Timezone name used in value of TZ environment variable.
|
||||
# Please see the theory.html file for how these names are chosen.
|
||||
# If multiple timezones overlap a country, each has a row in the
|
||||
# table, with each column 1 containing the country code.
|
||||
# 4. Comments; present if and only if a country has multiple zones.
|
||||
# 4. Comments; present if and only if a country has multiple timezones.
|
||||
#
|
||||
# If a zone covers multiple countries, the most-populous city is used,
|
||||
# If a timezone covers multiple countries, the most-populous city is used,
|
||||
# and that country is listed first in column 1; any other countries
|
||||
# are listed alphabetically by country code. The table is sorted
|
||||
# first by country code, then (if possible) by an order within the
|
||||
# country that (1) makes some geographical sense, and (2) puts the
|
||||
# most populous zones first, where that does not contradict (1).
|
||||
# most populous timezones first, where that does not contradict (1).
|
||||
#
|
||||
# This table is intended as an aid for users, to help them select time
|
||||
# zone data entries appropriate for their practical needs. It is not
|
||||
# intended to take or endorse any position on legal or territorial claims.
|
||||
# This table is intended as an aid for users, to help them select timezones
|
||||
# appropriate for their practical needs. It is not intended to take or
|
||||
# endorse any position on legal or territorial claims.
|
||||
#
|
||||
#country-
|
||||
#codes coordinates TZ comments
|
||||
@@ -232,7 +232,7 @@ MM +1647+09610 Asia/Yangon
|
||||
MN +4755+10653 Asia/Ulaanbaatar Mongolia (most areas)
|
||||
MN +4801+09139 Asia/Hovd Bayan-Ölgii, Govi-Altai, Hovd, Uvs, Zavkhan
|
||||
MN +4804+11430 Asia/Choibalsan Dornod, Sükhbaatar
|
||||
MO +2214+11335 Asia/Macau
|
||||
MO +221150+1133230 Asia/Macau
|
||||
MQ +1436-06105 America/Martinique
|
||||
MT +3554+01431 Europe/Malta
|
||||
MU -2010+05730 Indian/Mauritius
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#! /usr/bin/perl -w
|
||||
# Summarize .zi input in a .zi-like format.
|
||||
|
||||
# Courtesy Ken Pizzini.
|
||||
|
||||
|
||||
@@ -664,6 +664,9 @@
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* if REUSEPORT is enabled by default */
|
||||
#define REUSEPORT_DEFAULT 0
|
||||
|
||||
/* default rootkey location */
|
||||
#define ROOT_ANCHOR_FILE "/var/unbound/root.key"
|
||||
|
||||
|
||||
@@ -663,6 +663,9 @@
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* if REUSEPORT is enabled by default */
|
||||
#undef REUSEPORT_DEFAULT
|
||||
|
||||
/* default rootkey location */
|
||||
#undef ROOT_ANCHOR_FILE
|
||||
|
||||
|
||||
Vendored
+11
@@ -15966,6 +15966,17 @@ fi
|
||||
done
|
||||
|
||||
|
||||
# check if we can use SO_REUSEPORT
|
||||
if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
|
||||
|
||||
$as_echo "#define REUSEPORT_DEFAULT 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
$as_echo "#define REUSEPORT_DEFAULT 0" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# set memory allocation checking if requested
|
||||
# Check whether --enable-alloc-checks was given.
|
||||
if test "${enable_alloc_checks+set}" = set; then :
|
||||
|
||||
@@ -461,6 +461,13 @@ ACX_CHECK_NONBLOCKING_BROKEN
|
||||
ACX_MKDIR_ONE_ARG
|
||||
AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])])
|
||||
|
||||
# check if we can use SO_REUSEPORT
|
||||
if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
|
||||
AC_DEFINE(REUSEPORT_DEFAULT, 1, [if REUSEPORT is enabled by default])
|
||||
else
|
||||
AC_DEFINE(REUSEPORT_DEFAULT, 0, [if REUSEPORT is enabled by default])
|
||||
fi
|
||||
|
||||
# set memory allocation checking if requested
|
||||
AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks],
|
||||
[ enable to memory allocation statistics, for debug purposes ]),
|
||||
|
||||
@@ -177,7 +177,7 @@ config_create(void)
|
||||
cfg->if_automatic = 0;
|
||||
cfg->so_rcvbuf = 0;
|
||||
cfg->so_sndbuf = 0;
|
||||
cfg->so_reuseport = 1;
|
||||
cfg->so_reuseport = REUSEPORT_DEFAULT;
|
||||
cfg->ip_transparent = 0;
|
||||
cfg->ip_freebind = 0;
|
||||
cfg->num_ifs = 0;
|
||||
|
||||
+36
-1
@@ -7,6 +7,42 @@
|
||||
https://github.com/openssl/openssl/commits/ and pick the appropriate
|
||||
release branch.
|
||||
|
||||
Changes between 1.1.1 and 1.1.1a [20 Nov 2018]
|
||||
|
||||
*) Timing vulnerability in DSA signature generation
|
||||
|
||||
The OpenSSL DSA signature algorithm has been shown to be vulnerable to a
|
||||
timing side channel attack. An attacker could use variations in the signing
|
||||
algorithm to recover the private key.
|
||||
|
||||
This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser.
|
||||
(CVE-2018-0734)
|
||||
[Paul Dale]
|
||||
|
||||
*) Timing vulnerability in ECDSA signature generation
|
||||
|
||||
The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a
|
||||
timing side channel attack. An attacker could use variations in the signing
|
||||
algorithm to recover the private key.
|
||||
|
||||
This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser.
|
||||
(CVE-2018-0735)
|
||||
[Paul Dale]
|
||||
|
||||
*) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for
|
||||
the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names
|
||||
are retained for backwards compatibility.
|
||||
[Antoine Salon]
|
||||
|
||||
*) Fixed the issue that RAND_add()/RAND_seed() silently discards random input
|
||||
if its length exceeds 4096 bytes. The limit has been raised to a buffer size
|
||||
of two gigabytes and the error handling improved.
|
||||
|
||||
This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been
|
||||
categorized as a normal bug, not a security issue, because the DRBG reseeds
|
||||
automatically and is fully functional even without additional randomness
|
||||
provided by the application.
|
||||
|
||||
Changes between 1.1.0i and 1.1.1 [11 Sep 2018]
|
||||
|
||||
*) Add a new ClientHello callback. Provides a callback interface that gives
|
||||
@@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
||||
*) A minor bug in ssl/s3_clnt.c where there would always be 4 0
|
||||
bytes sent in the client random.
|
||||
[Edward Bishop <[email protected]>]
|
||||
|
||||
+68
-11
@@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) {
|
||||
if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) {
|
||||
die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1;
|
||||
warn <<_____ if scalar(@seed_sources) == 1;
|
||||
You have selected the --with-rand-seed=none option, which effectively disables
|
||||
automatic reseeding of the OpenSSL random generator. All operations depending
|
||||
on the random generator such as creating keys will not work unless the random
|
||||
generator is seeded manually by the application.
|
||||
|
||||
Please read the 'Note on random number generation' section in the INSTALL
|
||||
instructions and the RAND_DRBG(7) manual page for more details.
|
||||
============================== WARNING ===============================
|
||||
You have selected the --with-rand-seed=none option, which effectively
|
||||
disables automatic reseeding of the OpenSSL random generator.
|
||||
All operations depending on the random generator such as creating keys
|
||||
will not work unless the random generator is seeded manually by the
|
||||
application.
|
||||
|
||||
Please read the 'Note on random number generation' section in the
|
||||
INSTALL instructions and the RAND_DRBG(7) manual page for more details.
|
||||
============================== WARNING ===============================
|
||||
|
||||
_____
|
||||
}
|
||||
push @{$config{openssl_other_defines}},
|
||||
@@ -2174,6 +2179,16 @@ EOF
|
||||
|
||||
# Massage the result
|
||||
|
||||
# If the user configured no-shared, we allow no shared sources
|
||||
if ($disabled{shared}) {
|
||||
foreach (keys %{$unified_info{shared_sources}}) {
|
||||
foreach (keys %{$unified_info{shared_sources}->{$_}}) {
|
||||
delete $unified_info{sources}->{$_};
|
||||
}
|
||||
}
|
||||
$unified_info{shared_sources} = {};
|
||||
}
|
||||
|
||||
# If we depend on a header file or a perl module, add an inclusion of
|
||||
# its directory to allow smoothe inclusion
|
||||
foreach my $dest (keys %{$unified_info{depends}}) {
|
||||
@@ -2198,8 +2213,8 @@ EOF
|
||||
next unless defined($unified_info{includes}->{$dest}->{$k});
|
||||
my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}};
|
||||
foreach my $obj (grep /\.o$/,
|
||||
(keys %{$unified_info{sources}->{$dest}},
|
||||
keys %{$unified_info{shared_sources}->{$dest}})) {
|
||||
(keys %{$unified_info{sources}->{$dest} // {}},
|
||||
keys %{$unified_info{shared_sources}->{$dest} // {}})) {
|
||||
foreach my $inc (@incs) {
|
||||
unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc
|
||||
unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}};
|
||||
@@ -2238,6 +2253,42 @@ EOF
|
||||
[ @{$unified_info{includes}->{$dest}->{source}} ];
|
||||
}
|
||||
}
|
||||
|
||||
# For convenience collect information regarding directories where
|
||||
# files are generated, those generated files and the end product
|
||||
# they end up in where applicable. Then, add build rules for those
|
||||
# directories
|
||||
my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ],
|
||||
"dso" => [ @{$unified_info{engines}} ],
|
||||
"bin" => [ @{$unified_info{programs}} ],
|
||||
"script" => [ @{$unified_info{scripts}} ] );
|
||||
foreach my $type (keys %loopinfo) {
|
||||
foreach my $product (@{$loopinfo{$type}}) {
|
||||
my %dirs = ();
|
||||
my $pd = dirname($product);
|
||||
|
||||
foreach (@{$unified_info{sources}->{$product} // []},
|
||||
@{$unified_info{shared_sources}->{$product} // []}) {
|
||||
my $d = dirname($_);
|
||||
|
||||
# We don't want to create targets for source directories
|
||||
# when building out of source
|
||||
next if ($config{sourcedir} ne $config{builddir}
|
||||
&& $d =~ m|^\Q$config{sourcedir}\E|);
|
||||
# We already have a "test" target, and the current directory
|
||||
# is just silly to make a target for
|
||||
next if $d eq "test" || $d eq ".";
|
||||
|
||||
$dirs{$d} = 1;
|
||||
push @{$unified_info{dirinfo}->{$d}->{deps}}, $_
|
||||
if $d ne $pd;
|
||||
}
|
||||
foreach (keys %dirs) {
|
||||
push @{$unified_info{dirinfo}->{$_}->{products}->{$type}},
|
||||
$product;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# For the schemes that need it, we provide the old *_obj configs
|
||||
@@ -2712,10 +2763,16 @@ print <<"EOF";
|
||||
|
||||
**********************************************************************
|
||||
*** ***
|
||||
*** If you want to report a building issue, please include the ***
|
||||
*** output from this command: ***
|
||||
*** OpenSSL has been successfully configured ***
|
||||
*** ***
|
||||
*** perl configdata.pm --dump ***
|
||||
*** If you encounter a problem while building, please open an ***
|
||||
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
|
||||
*** and include the output from the following command: ***
|
||||
*** ***
|
||||
*** perl configdata.pm --dump ***
|
||||
*** ***
|
||||
*** (If you are new to OpenSSL, you might want to consult the ***
|
||||
*** 'Troubleshooting' section in the INSTALL file first) ***
|
||||
*** ***
|
||||
**********************************************************************
|
||||
EOF
|
||||
|
||||
@@ -614,8 +614,8 @@
|
||||
Windows, and as a comma separated list of
|
||||
libraries on VMS.
|
||||
RANLIB The library archive indexer.
|
||||
RC The Windows resources manipulator.
|
||||
RCFLAGS Flags for the Windows reources manipulator.
|
||||
RC The Windows resource compiler.
|
||||
RCFLAGS Flags for the Windows resource compiler.
|
||||
RM The command to remove files and directories.
|
||||
|
||||
These cannot be mixed with compiling / linking flags given
|
||||
@@ -969,7 +969,7 @@
|
||||
|
||||
BUILDFILE
|
||||
Use a different build file name than the platform default
|
||||
("Makefile" on Unixly platforms, "makefile" on native Windows,
|
||||
("Makefile" on Unix-like platforms, "makefile" on native Windows,
|
||||
"descrip.mms" on OpenVMS). This requires that there is a
|
||||
corresponding build file template. See Configurations/README
|
||||
for further information.
|
||||
@@ -1171,7 +1171,7 @@
|
||||
part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of
|
||||
the name.
|
||||
|
||||
On most POSIXly platforms, shared libraries are named libcrypto.so.1.1
|
||||
On most POSIX platforms, shared libraries are named libcrypto.so.1.1
|
||||
and libssl.so.1.1.
|
||||
|
||||
on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll
|
||||
@@ -1202,7 +1202,7 @@
|
||||
The seeding method can be configured using the --with-rand-seed option,
|
||||
which can be used to specify a comma separated list of seed methods.
|
||||
However in most cases OpenSSL will choose a suitable default method,
|
||||
so it is not necessary to explicitely provide this option. Note also
|
||||
so it is not necessary to explicitly provide this option. Note also
|
||||
that not all methods are available on all platforms.
|
||||
|
||||
I) On operating systems which provide a suitable randomness source (in
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018]
|
||||
|
||||
o Timing vulnerability in DSA signature generation (CVE-2018-0734)
|
||||
o Timing vulnerability in ECDSA signature generation (CVE-2018-0735)
|
||||
|
||||
Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018]
|
||||
|
||||
o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 1.1.1 11 Sep 2018
|
||||
OpenSSL 1.1.1a 20 Nov 2018
|
||||
|
||||
Copyright (c) 1998-2018 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section)
|
||||
if (RAND_load_file(randfile, -1) < 0) {
|
||||
BIO_printf(bio_err, "Can't load %s into RNG\n", randfile);
|
||||
ERR_print_errors(bio_err);
|
||||
return;
|
||||
}
|
||||
if (save_rand_file == NULL)
|
||||
save_rand_file = OPENSSL_strdup(randfile);
|
||||
|
||||
@@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti)
|
||||
opt_getprog(), typestr);
|
||||
continue;
|
||||
}
|
||||
if (*valstr == '\0') {
|
||||
BIO_printf(bio_err,
|
||||
"%s: No value provided for Subject Attribute %s, skipped\n",
|
||||
opt_getprog(), typestr);
|
||||
continue;
|
||||
}
|
||||
if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
|
||||
valstr, strlen((char *)valstr),
|
||||
-1, ismulti ? -1 : 0))
|
||||
|
||||
@@ -369,7 +369,7 @@ typedef struct string_int_pair_st {
|
||||
# define OPT_FMT_SMIME (1L << 3)
|
||||
# define OPT_FMT_ENGINE (1L << 4)
|
||||
# define OPT_FMT_MSBLOB (1L << 5)
|
||||
# define OPT_FMT_NETSCAPE (1L << 6)
|
||||
/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */
|
||||
# define OPT_FMT_NSS (1L << 7)
|
||||
# define OPT_FMT_TEXT (1L << 8)
|
||||
# define OPT_FMT_HTTP (1L << 9)
|
||||
@@ -378,8 +378,8 @@ typedef struct string_int_pair_st {
|
||||
# define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME)
|
||||
# define OPT_FMT_ANY ( \
|
||||
OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \
|
||||
OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \
|
||||
OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
|
||||
OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \
|
||||
OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
|
||||
|
||||
char *opt_progname(const char *argv0);
|
||||
char *opt_getprog(void);
|
||||
|
||||
+11
-10
@@ -605,7 +605,7 @@ end_of_options:
|
||||
/*
|
||||
* outdir is a directory spec, but access() for VMS demands a
|
||||
* filename. We could use the DEC C routine to convert the
|
||||
* directory syntax to Unixly, and give that to app_isdir,
|
||||
* directory syntax to Unix, and give that to app_isdir,
|
||||
* but for now the fopen will catch the error if it's not a
|
||||
* directory
|
||||
*/
|
||||
@@ -976,7 +976,7 @@ end_of_options:
|
||||
BIO_printf(bio_err, "Write out database with %d new entries\n",
|
||||
sk_X509_num(cert_sk));
|
||||
|
||||
if (!rand_ser
|
||||
if (serialfile != NULL
|
||||
&& !save_serial(serialfile, "new", serial, NULL))
|
||||
goto end;
|
||||
|
||||
@@ -1044,7 +1044,8 @@ end_of_options:
|
||||
|
||||
if (sk_X509_num(cert_sk)) {
|
||||
/* Rename the database and the serial file */
|
||||
if (!rotate_serial(serialfile, "new", "old"))
|
||||
if (serialfile != NULL
|
||||
&& !rotate_serial(serialfile, "new", "old"))
|
||||
goto end;
|
||||
|
||||
if (!rotate_index(dbfile, "new", "old"))
|
||||
@@ -1177,10 +1178,9 @@ end_of_options:
|
||||
}
|
||||
|
||||
/* we have a CRL number that need updating */
|
||||
if (crlnumberfile != NULL)
|
||||
if (!rand_ser
|
||||
&& !save_serial(crlnumberfile, "new", crlnumber, NULL))
|
||||
goto end;
|
||||
if (crlnumberfile != NULL
|
||||
&& !save_serial(crlnumberfile, "new", crlnumber, NULL))
|
||||
goto end;
|
||||
|
||||
BN_free(crlnumber);
|
||||
crlnumber = NULL;
|
||||
@@ -1195,9 +1195,10 @@ end_of_options:
|
||||
|
||||
PEM_write_bio_X509_CRL(Sout, crl);
|
||||
|
||||
if (crlnumberfile != NULL) /* Rename the crlnumber file */
|
||||
if (!rotate_serial(crlnumberfile, "new", "old"))
|
||||
goto end;
|
||||
/* Rename the crlnumber file */
|
||||
if (crlnumberfile != NULL
|
||||
&& !rotate_serial(crlnumberfile, "new", "old"))
|
||||
goto end;
|
||||
|
||||
}
|
||||
/*****************************************************************/
|
||||
|
||||
@@ -950,6 +950,7 @@ static void spawn_loop(void)
|
||||
sleep(30);
|
||||
break;
|
||||
case 0: /* child */
|
||||
OPENSSL_free(kidpids);
|
||||
signal(SIGINT, SIG_DFL);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
if (termsig)
|
||||
@@ -976,6 +977,7 @@ static void spawn_loop(void)
|
||||
}
|
||||
|
||||
/* The loop above can only break on termsig */
|
||||
OPENSSL_free(kidpids);
|
||||
syslog(LOG_INFO, "terminating on signal: %d", termsig);
|
||||
killall(0, kidpids);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
# This definition stops the following lines choking if HOME isn't
|
||||
# defined.
|
||||
HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
|
||||
# Extra OBJECT IDENTIFIER info:
|
||||
#oid_file = $ENV::HOME/.oid
|
||||
@@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number
|
||||
# must be commented out to leave a V1 CRL
|
||||
crl = $dir/crl.pem # The current CRL
|
||||
private_key = $dir/private/cakey.pem# The private key
|
||||
RANDFILE = $dir/private/.rand # private random number file
|
||||
|
||||
x509_extensions = usr_cert # The extensions to add to the cert
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@ static OPT_PAIR formats[] = {
|
||||
{"smime", OPT_FMT_SMIME},
|
||||
{"engine", OPT_FMT_ENGINE},
|
||||
{"msblob", OPT_FMT_MSBLOB},
|
||||
{"netscape", OPT_FMT_NETSCAPE},
|
||||
{"nss", OPT_FMT_NSS},
|
||||
{"text", OPT_FMT_TEXT},
|
||||
{"http", OPT_FMT_HTTP},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
|
||||
* Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -38,8 +38,8 @@ typedef enum OPTION_choice {
|
||||
|
||||
const OPTIONS rsa_options[] = {
|
||||
{"help", OPT_HELP, '-', "Display this summary"},
|
||||
{"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"},
|
||||
{"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"},
|
||||
{"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"},
|
||||
{"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"},
|
||||
{"in", OPT_IN, 's', "Input file"},
|
||||
{"out", OPT_OUT, '>', "Output file"},
|
||||
{"pubin", OPT_PUBIN, '-', "Expect a public key in input file"},
|
||||
@@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv)
|
||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||
EVP_PKEY *pk;
|
||||
pk = EVP_PKEY_new();
|
||||
if (pk == NULL)
|
||||
goto end;
|
||||
|
||||
EVP_PKEY_set1_RSA(pk, rsa);
|
||||
if (outformat == FORMAT_PVK) {
|
||||
if (pubin) {
|
||||
|
||||
@@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared)
|
||||
int ssl_print_tmp_key(BIO *out, SSL *s)
|
||||
{
|
||||
EVP_PKEY *key;
|
||||
if (!SSL_get_server_tmp_key(s, &key))
|
||||
|
||||
if (!SSL_get_peer_tmp_key(s, &key))
|
||||
return 1;
|
||||
BIO_puts(out, "Server Temp Key: ");
|
||||
switch (EVP_PKEY_id(key)) {
|
||||
|
||||
@@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigned char *identity,
|
||||
|
||||
if (strlen(psk_identity) != identity_len
|
||||
|| memcmp(psk_identity, identity, identity_len) != 0) {
|
||||
BIO_printf(bio_s_out,
|
||||
"PSK warning: client identity not what we expected"
|
||||
" (got '%s' expected '%s')\n", identity, psk_identity);
|
||||
*sess = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (psksess != NULL) {
|
||||
@@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[])
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
if (early_data && (www > 0 || rev)) {
|
||||
BIO_printf(bio_err,
|
||||
"Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
if (protocol == IPPROTO_SCTP) {
|
||||
|
||||
@@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv)
|
||||
|
||||
if (rsa_count <= 1) {
|
||||
/* if longer than 10s, don't do any more */
|
||||
for (testnum++; testnum < EC_NUM; testnum++)
|
||||
for (testnum++; testnum < ECDSA_NUM; testnum++)
|
||||
ecdsa_doit[testnum] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ typedef enum OPTION_choice {
|
||||
const OPTIONS x509_options[] = {
|
||||
{"help", OPT_HELP, '-', "Display this summary"},
|
||||
{"inform", OPT_INFORM, 'f',
|
||||
"Input format - default PEM (one of DER, NET or PEM)"},
|
||||
"Input format - default PEM (one of DER or PEM)"},
|
||||
{"in", OPT_IN, '<', "Input file - default stdin"},
|
||||
{"outform", OPT_OUTFORM, 'f',
|
||||
"Output format - default PEM (one of DER, NET or PEM)"},
|
||||
"Output format - default PEM (one of DER or PEM)"},
|
||||
{"out", OPT_OUT, '>', "Output file - default stdout"},
|
||||
{"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"},
|
||||
{"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"},
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The POSIXly macro for the maximum number of characters in a file path is
|
||||
* The POSIX macro for the maximum number of characters in a file path is
|
||||
* NAME_MAX. However, some operating systems use PATH_MAX instead.
|
||||
* Therefore, it seems natural to first check for PATH_MAX and use that, and
|
||||
* if it doesn't exist, use NAME_MAX.
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
|
||||
# include <unistd.h>
|
||||
|
||||
# if _POSIX_VERSION >= 200112L
|
||||
# if _POSIX_VERSION >= 200112L \
|
||||
&& (_POSIX_VERSION < 200809L || defined(__GLIBC__))
|
||||
|
||||
# include <pthread.h>
|
||||
|
||||
|
||||
@@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int options)
|
||||
*/
|
||||
int BIO_bind(int sock, const BIO_ADDR *addr, int options)
|
||||
{
|
||||
# ifndef OPENSSL_SYS_WINDOWS
|
||||
int on = 1;
|
||||
# endif
|
||||
|
||||
if (sock == -1) {
|
||||
BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET);
|
||||
|
||||
@@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const char *argp, size_t len,
|
||||
argi = (int)len;
|
||||
}
|
||||
|
||||
if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) {
|
||||
if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) {
|
||||
if (*processed > INT_MAX)
|
||||
return -1;
|
||||
inret = *processed;
|
||||
@@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const char *argp, size_t len,
|
||||
|
||||
ret = b->callback(b, oper, argp, argi, argl, inret);
|
||||
|
||||
if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) {
|
||||
if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) {
|
||||
*processed = (size_t)ret;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@@ -408,4 +408,9 @@ static void xcloselog(BIO *bp)
|
||||
|
||||
# endif /* Unix */
|
||||
|
||||
#else /* NO_SYSLOG */
|
||||
const BIO_METHOD *BIO_s_log(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif /* NO_SYSLOG */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -64,12 +64,6 @@
|
||||
* machine.
|
||||
*/
|
||||
|
||||
# if defined(_WIN64) || !defined(__LP64__)
|
||||
# define BN_ULONG unsigned long long
|
||||
# else
|
||||
# define BN_ULONG unsigned long
|
||||
# endif
|
||||
|
||||
# undef mul
|
||||
# undef mul_add
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
* is not only slower but also makes each bit vulnerable to
|
||||
* EM (and likely other) side-channel attacks like One&Done
|
||||
* (for details see "One&Done: A Single-Decryption EM-Based
|
||||
* Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam,
|
||||
* Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam,
|
||||
* H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and
|
||||
* M. Prvulovic, in USENIX Security'18)
|
||||
*/
|
||||
|
||||
@@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
|
||||
b->neg ^= t;
|
||||
|
||||
/*-
|
||||
* Idea behind BN_FLG_STATIC_DATA is actually to
|
||||
* indicate that data may not be written to.
|
||||
* Intention is actually to treat it as it's
|
||||
* read-only data, and some (if not most) of it does
|
||||
* reside in read-only segment. In other words
|
||||
* observation of BN_FLG_STATIC_DATA in
|
||||
* BN_consttime_swap should be treated as fatal
|
||||
* condition. It would either cause SEGV or
|
||||
* effectively cause data corruption.
|
||||
* BN_FLG_MALLOCED refers to BN structure itself,
|
||||
* and hence must be preserved. Remaining flags are
|
||||
* BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be
|
||||
* preserved, because it determines how x->d was
|
||||
* allocated and hence how to free it. This leaves
|
||||
* BN_FLG_CONSTTIME that one can do something about.
|
||||
* To summarize it's sufficient to mask and swap
|
||||
* BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should
|
||||
* be treated as fatal.
|
||||
* BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention
|
||||
* is actually to treat it as it's read-only data, and some (if not most)
|
||||
* of it does reside in read-only segment. In other words observation of
|
||||
* BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal
|
||||
* condition. It would either cause SEGV or effectively cause data
|
||||
* corruption.
|
||||
*
|
||||
* BN_FLG_MALLOCED: refers to BN structure itself, and hence must be
|
||||
* preserved.
|
||||
*
|
||||
* BN_FLG_SECURE: must be preserved, because it determines how x->d was
|
||||
* allocated and hence how to free it.
|
||||
*
|
||||
* BN_FLG_CONSTTIME: sufficient to mask and swap
|
||||
*
|
||||
* BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on
|
||||
* the data, so the d array may be padded with additional 0 values (i.e.
|
||||
* top could be greater than the minimal value that it could be). We should
|
||||
* be swapping it
|
||||
*/
|
||||
t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition;
|
||||
|
||||
#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
|
||||
|
||||
t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition;
|
||||
a->flags ^= t;
|
||||
b->flags ^= t;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ LIBS=../libcrypto
|
||||
SOURCE[../libcrypto]=\
|
||||
cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
|
||||
ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \
|
||||
threads_pthread.c threads_win.c threads_none.c \
|
||||
threads_pthread.c threads_win.c threads_none.c getenv.c \
|
||||
o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \
|
||||
{- $target{uplink_aux_src} -}
|
||||
EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
/* Part of the code in here was originally in conf.c, which is now removed */
|
||||
|
||||
#include "e_os.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <openssl/conf.h>
|
||||
@@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *section,
|
||||
if (v != NULL)
|
||||
return v->value;
|
||||
if (strcmp(section, "ENV") == 0) {
|
||||
p = getenv(name);
|
||||
p = ossl_safe_getenv(name);
|
||||
if (p != NULL)
|
||||
return p;
|
||||
}
|
||||
@@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *section,
|
||||
else
|
||||
return NULL;
|
||||
} else
|
||||
return getenv(name);
|
||||
return ossl_safe_getenv(name);
|
||||
}
|
||||
|
||||
static unsigned long conf_value_hash(const CONF_VALUE *v)
|
||||
|
||||
@@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void)
|
||||
char *file, *sep = "";
|
||||
int len;
|
||||
|
||||
if (!OPENSSL_issetugid()) {
|
||||
file = getenv("OPENSSL_CONF");
|
||||
if (file)
|
||||
return OPENSSL_strdup(file);
|
||||
}
|
||||
if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
|
||||
return OPENSSL_strdup(file);
|
||||
|
||||
len = strlen(X509_get_default_cert_area());
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
|
||||
@@ -204,7 +204,7 @@ int OPENSSL_isservice(void)
|
||||
|
||||
if (_OPENSSL_isservice.p == NULL) {
|
||||
HANDLE mod = GetModuleHandle(NULL);
|
||||
FARPROC f;
|
||||
FARPROC f = NULL;
|
||||
|
||||
if (mod != NULL)
|
||||
f = GetProcAddress(mod, "_OPENSSL_isservice");
|
||||
|
||||
@@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const CONF *conf, const char *sec
|
||||
|
||||
int CTLOG_STORE_load_default_file(CTLOG_STORE *store)
|
||||
{
|
||||
const char *fpath = getenv(CTLOG_FILE_EVP);
|
||||
const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP);
|
||||
|
||||
if (fpath == NULL)
|
||||
fpath = CTLOG_FILE;
|
||||
|
||||
@@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
|
||||
if (mctx == NULL)
|
||||
goto err;
|
||||
|
||||
/* make sure L > N, otherwise we'll get trapped in an infinite loop */
|
||||
if (L <= N) {
|
||||
DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (evpmd == NULL) {
|
||||
if (N == 160)
|
||||
evpmd = EVP_sha1();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include "internal/bn_int.h"
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/sha.h>
|
||||
#include "dsa_locl.h"
|
||||
@@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len,
|
||||
DSA_SIG *sig, DSA *dsa);
|
||||
static int dsa_init(DSA *dsa);
|
||||
static int dsa_finish(DSA *dsa);
|
||||
static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q,
|
||||
BN_CTX *ctx);
|
||||
|
||||
static DSA_METHOD openssl_dsa_meth = {
|
||||
"OpenSSL DSA method",
|
||||
@@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
{
|
||||
BN_CTX *ctx = NULL;
|
||||
BIGNUM *k, *kinv = NULL, *r = *rp;
|
||||
BIGNUM *l, *m;
|
||||
BIGNUM *l;
|
||||
int ret = 0;
|
||||
int q_bits;
|
||||
int q_bits, q_words;
|
||||
|
||||
if (!dsa->p || !dsa->q || !dsa->g) {
|
||||
DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS);
|
||||
@@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
|
||||
k = BN_new();
|
||||
l = BN_new();
|
||||
m = BN_new();
|
||||
if (k == NULL || l == NULL || m == NULL)
|
||||
if (k == NULL || l == NULL)
|
||||
goto err;
|
||||
|
||||
if (ctx_in == NULL) {
|
||||
@@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
|
||||
/* Preallocate space */
|
||||
q_bits = BN_num_bits(dsa->q);
|
||||
if (!BN_set_bit(k, q_bits)
|
||||
|| !BN_set_bit(l, q_bits)
|
||||
|| !BN_set_bit(m, q_bits))
|
||||
q_words = bn_get_top(dsa->q);
|
||||
if (!bn_wexpand(k, q_words + 2)
|
||||
|| !bn_wexpand(l, q_words + 2))
|
||||
goto err;
|
||||
|
||||
/* Get random k */
|
||||
@@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
} while (BN_is_zero(k));
|
||||
|
||||
BN_set_flags(k, BN_FLG_CONSTTIME);
|
||||
BN_set_flags(l, BN_FLG_CONSTTIME);
|
||||
|
||||
if (dsa->flags & DSA_FLAG_CACHE_MONT_P) {
|
||||
if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
|
||||
@@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
* small timing information leakage. We then choose the sum that is
|
||||
* one bit longer than the modulus.
|
||||
*
|
||||
* TODO: revisit the BN_copy aiming for a memory access agnostic
|
||||
* conditional copy.
|
||||
* There are some concerns about the efficacy of doing this. More
|
||||
* specificly refer to the discussion starting with:
|
||||
* https://github.com/openssl/openssl/pull/7486#discussion_r228323705
|
||||
* The fix is to rework BN so these gymnastics aren't required.
|
||||
*/
|
||||
if (!BN_add(l, k, dsa->q)
|
||||
|| !BN_add(m, l, dsa->q)
|
||||
|| !BN_copy(k, BN_num_bits(l) > q_bits ? l : m))
|
||||
|| !BN_add(k, l, dsa->q))
|
||||
goto err;
|
||||
|
||||
BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2);
|
||||
|
||||
if ((dsa)->meth->bn_mod_exp != NULL) {
|
||||
if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx,
|
||||
dsa->method_mont_p))
|
||||
@@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
if (!BN_mod(r, r, dsa->q, ctx))
|
||||
goto err;
|
||||
|
||||
/* Compute part of 's = inv(k) (m + xr) mod q' */
|
||||
if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL)
|
||||
/* Compute part of 's = inv(k) (m + xr) mod q' */
|
||||
if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL)
|
||||
goto err;
|
||||
|
||||
BN_clear_free(*kinvp);
|
||||
@@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
BN_CTX_free(ctx);
|
||||
BN_clear_free(k);
|
||||
BN_clear_free(l);
|
||||
BN_clear_free(m);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -393,3 +398,31 @@ static int dsa_finish(DSA *dsa)
|
||||
BN_MONT_CTX_free(dsa->method_mont_p);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the inverse of k modulo q.
|
||||
* Since q is prime, Fermat's Little Theorem applies, which reduces this to
|
||||
* mod-exp operation. Both the exponent and modulus are public information
|
||||
* so a mod-exp that doesn't leak the base is sufficient. A newly allocated
|
||||
* BIGNUM is returned which the caller must free.
|
||||
*/
|
||||
static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q,
|
||||
BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *res = NULL;
|
||||
BIGNUM *r, *e;
|
||||
|
||||
if ((r = BN_new()) == NULL)
|
||||
return NULL;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
if ((e = BN_CTX_get(ctx)) != NULL
|
||||
&& BN_set_word(r, 2)
|
||||
&& BN_sub(e, q, r)
|
||||
&& BN_mod_exp_mont(r, k, e, q, ctx, NULL))
|
||||
res = r;
|
||||
else
|
||||
BN_free(r);
|
||||
BN_CTX_end(ctx);
|
||||
return res;
|
||||
}
|
||||
@@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, int eckdf_nid)
|
||||
if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0)
|
||||
return 0;
|
||||
|
||||
if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0)
|
||||
if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0)
|
||||
return 0;
|
||||
|
||||
kdf_md = EVP_get_digestbynid(kdfmd_nid);
|
||||
@@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri)
|
||||
ecdh_nid = NID_dh_cofactor_kdf;
|
||||
|
||||
if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) {
|
||||
kdf_type = EVP_PKEY_ECDH_KDF_X9_62;
|
||||
kdf_type = EVP_PKEY_ECDH_KDF_X9_63;
|
||||
if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0)
|
||||
goto err;
|
||||
} else
|
||||
|
||||
@@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
|
||||
*/
|
||||
cardinality_bits = BN_num_bits(cardinality);
|
||||
group_top = bn_get_top(cardinality);
|
||||
if ((bn_wexpand(k, group_top + 1) == NULL)
|
||||
|| (bn_wexpand(lambda, group_top + 1) == NULL)) {
|
||||
if ((bn_wexpand(k, group_top + 2) == NULL)
|
||||
|| (bn_wexpand(lambda, group_top + 2) == NULL)) {
|
||||
ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
|
||||
* k := scalar + 2*cardinality
|
||||
*/
|
||||
kbit = BN_is_bit_set(lambda, cardinality_bits);
|
||||
BN_consttime_swap(kbit, k, lambda, group_top + 1);
|
||||
BN_consttime_swap(kbit, k, lambda, group_top + 2);
|
||||
|
||||
group_top = bn_get_top(group->field);
|
||||
if ((bn_wexpand(s->X, group_top) == NULL)
|
||||
|
||||
@@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx,
|
||||
if (!pkey_ec_derive(ctx, ktmp, &ktmplen))
|
||||
goto err;
|
||||
/* Do KDF stuff */
|
||||
if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen,
|
||||
if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen,
|
||||
dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md))
|
||||
goto err;
|
||||
rv = 1;
|
||||
@@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
|
||||
case EVP_PKEY_CTRL_EC_KDF_TYPE:
|
||||
if (p1 == -2)
|
||||
return dctx->kdf_type;
|
||||
if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62)
|
||||
if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63)
|
||||
return -2;
|
||||
dctx->kdf_type = p1;
|
||||
return 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -10,12 +10,13 @@
|
||||
#include <string.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/evp.h>
|
||||
#include "ec_lcl.h"
|
||||
|
||||
/* Key derivation function from X9.62/SECG */
|
||||
/* Key derivation function from X9.63/SECG */
|
||||
/* Way more than we will ever need */
|
||||
#define ECDH_KDF_MAX (1 << 30)
|
||||
|
||||
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
||||
int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
const unsigned char *sinfo, size_t sinfolen,
|
||||
const EVP_MD *md)
|
||||
@@ -66,3 +67,15 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
||||
EVP_MD_CTX_free(mctx);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*-
|
||||
* The old name for ecdh_KDF_X9_63
|
||||
* Retained for ABI compatibility
|
||||
*/
|
||||
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
const unsigned char *sinfo, size_t sinfolen,
|
||||
const EVP_MD *md)
|
||||
{
|
||||
return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md);
|
||||
}
|
||||
@@ -28,6 +28,13 @@
|
||||
# define CHECK_BSD_STYLE_MACROS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ONE global file descriptor for all sessions. This allows operations
|
||||
* such as digest session data copying (see digest_copy()), but is also
|
||||
* saner... why re-open /dev/crypto for every session?
|
||||
*/
|
||||
static int cfd;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Ciphers
|
||||
@@ -39,7 +46,6 @@
|
||||
*****/
|
||||
|
||||
struct cipher_ctx {
|
||||
int cfd;
|
||||
struct session_op sess;
|
||||
|
||||
/* to pass from init to do_cipher */
|
||||
@@ -69,7 +75,7 @@ static const struct cipher_data_st {
|
||||
{ NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
|
||||
{ NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
{ NID_rc4, 1, 16, 0, CRYPTO_ARC4 },
|
||||
{ NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 },
|
||||
#endif
|
||||
#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_CTR)
|
||||
{ NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
|
||||
@@ -135,19 +141,13 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const struct cipher_data_st *cipher_d =
|
||||
get_cipher_data(EVP_CIPHER_CTX_nid(ctx));
|
||||
|
||||
if ((cipher_ctx->cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
|
||||
SYSerr(SYS_F_OPEN, errno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&cipher_ctx->sess, 0, sizeof(cipher_ctx->sess));
|
||||
cipher_ctx->sess.cipher = cipher_d->devcryptoid;
|
||||
cipher_ctx->sess.keylen = cipher_d->keylen;
|
||||
cipher_ctx->sess.key = (void *)key;
|
||||
cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
|
||||
if (ioctl(cipher_ctx->cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
|
||||
if (ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
close(cipher_ctx->cfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
cryp.flags = COP_FLAG_WRITE_IV;
|
||||
#endif
|
||||
|
||||
if (ioctl(cipher_ctx->cfd, CIOCCRYPT, &cryp) < 0) {
|
||||
if (ioctl(cfd, CIOCCRYPT, &cryp) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
@@ -212,14 +212,10 @@ static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
|
||||
struct cipher_ctx *cipher_ctx =
|
||||
(struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
|
||||
|
||||
if (ioctl(cipher_ctx->cfd, CIOCFSESSION, &cipher_ctx->sess) < 0) {
|
||||
if (ioctl(cfd, CIOCFSESSION, &cipher_ctx->sess.ses) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
if (close(cipher_ctx->cfd) < 0) {
|
||||
SYSerr(SYS_F_CLOSE, errno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -233,14 +229,10 @@ static int known_cipher_nids[OSSL_NELEM(cipher_data)];
|
||||
static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
|
||||
static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
|
||||
|
||||
static void prepare_cipher_methods()
|
||||
static void prepare_cipher_methods(void)
|
||||
{
|
||||
size_t i;
|
||||
struct session_op sess;
|
||||
int cfd;
|
||||
|
||||
if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0)
|
||||
return;
|
||||
|
||||
memset(&sess, 0, sizeof(sess));
|
||||
sess.key = (void *)"01234567890123456789012345678901234567890123456789";
|
||||
@@ -255,7 +247,7 @@ static void prepare_cipher_methods()
|
||||
sess.cipher = cipher_data[i].devcryptoid;
|
||||
sess.keylen = cipher_data[i].keylen;
|
||||
if (ioctl(cfd, CIOCGSESSION, &sess) < 0
|
||||
|| ioctl(cfd, CIOCFSESSION, &sess) < 0)
|
||||
|| ioctl(cfd, CIOCFSESSION, &sess.ses) < 0)
|
||||
continue;
|
||||
|
||||
if ((known_cipher_methods[i] =
|
||||
@@ -281,8 +273,6 @@ static void prepare_cipher_methods()
|
||||
cipher_data[i].nid;
|
||||
}
|
||||
}
|
||||
|
||||
close(cfd);
|
||||
}
|
||||
|
||||
static const EVP_CIPHER *get_cipher_method(int nid)
|
||||
@@ -308,7 +298,7 @@ static void destroy_cipher_method(int nid)
|
||||
known_cipher_methods[i] = NULL;
|
||||
}
|
||||
|
||||
static void destroy_all_cipher_methods()
|
||||
static void destroy_all_cipher_methods(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -329,11 +319,12 @@ static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
|
||||
|
||||
/*
|
||||
* We only support digests if the cryptodev implementation supports multiple
|
||||
* data updates. Otherwise, we would be forced to maintain a cache, which is
|
||||
* perilous if there's a lot of data coming in (if someone wants to checksum
|
||||
* an OpenSSL tarball, for example).
|
||||
* data updates and session copying. Otherwise, we would be forced to maintain
|
||||
* a cache, which is perilous if there's a lot of data coming in (if someone
|
||||
* wants to checksum an OpenSSL tarball, for example).
|
||||
*/
|
||||
#if defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
|
||||
#if defined(CIOCCPHASH) && defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
|
||||
#define IMPLEMENT_DIGEST
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@@ -346,7 +337,6 @@ static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
|
||||
*****/
|
||||
|
||||
struct digest_ctx {
|
||||
int cfd;
|
||||
struct session_op sess;
|
||||
int init;
|
||||
};
|
||||
@@ -413,19 +403,12 @@ static int digest_init(EVP_MD_CTX *ctx)
|
||||
const struct digest_data_st *digest_d =
|
||||
get_digest_data(EVP_MD_CTX_type(ctx));
|
||||
|
||||
if (digest_ctx->init == 0
|
||||
&& (digest_ctx->cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
|
||||
SYSerr(SYS_F_OPEN, errno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
digest_ctx->init = 1;
|
||||
|
||||
memset(&digest_ctx->sess, 0, sizeof(digest_ctx->sess));
|
||||
digest_ctx->sess.mac = digest_d->devcryptoid;
|
||||
if (ioctl(digest_ctx->cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
|
||||
if (ioctl(cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
close(digest_ctx->cfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -444,7 +427,7 @@ static int digest_op(struct digest_ctx *ctx, const void *src, size_t srclen,
|
||||
cryp.dst = NULL;
|
||||
cryp.mac = res;
|
||||
cryp.flags = flags;
|
||||
return ioctl(ctx->cfd, CIOCCRYPT, &cryp);
|
||||
return ioctl(cfd, CIOCCRYPT, &cryp);
|
||||
}
|
||||
|
||||
static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
|
||||
@@ -472,7 +455,7 @@ static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
if (ioctl(digest_ctx->cfd, CIOCFSESSION, &digest_ctx->sess) < 0) {
|
||||
if (ioctl(cfd, CIOCFSESSION, &digest_ctx->sess.ses) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
@@ -480,16 +463,38 @@ static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int digest_cleanup(EVP_MD_CTX *ctx)
|
||||
static int digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
|
||||
{
|
||||
struct digest_ctx *digest_ctx =
|
||||
(struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
|
||||
struct digest_ctx *digest_from =
|
||||
(struct digest_ctx *)EVP_MD_CTX_md_data(from);
|
||||
struct digest_ctx *digest_to =
|
||||
(struct digest_ctx *)EVP_MD_CTX_md_data(to);
|
||||
struct cphash_op cphash;
|
||||
|
||||
if (close(digest_ctx->cfd) < 0) {
|
||||
SYSerr(SYS_F_CLOSE, errno);
|
||||
if (digest_from == NULL)
|
||||
return 1;
|
||||
|
||||
if (digest_from->init != 1) {
|
||||
SYSerr(SYS_F_IOCTL, EINVAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!digest_init(to)) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cphash.src_ses = digest_from->sess.ses;
|
||||
cphash.dst_ses = digest_to->sess.ses;
|
||||
if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
|
||||
SYSerr(SYS_F_IOCTL, errno);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int digest_cleanup(EVP_MD_CTX *ctx)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -502,14 +507,10 @@ static int known_digest_nids[OSSL_NELEM(digest_data)];
|
||||
static int known_digest_nids_amount = -1; /* -1 indicates not yet initialised */
|
||||
static EVP_MD *known_digest_methods[OSSL_NELEM(digest_data)] = { NULL, };
|
||||
|
||||
static void prepare_digest_methods()
|
||||
static void prepare_digest_methods(void)
|
||||
{
|
||||
size_t i;
|
||||
struct session_op sess;
|
||||
int cfd;
|
||||
|
||||
if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0)
|
||||
return;
|
||||
|
||||
memset(&sess, 0, sizeof(sess));
|
||||
|
||||
@@ -522,7 +523,7 @@ static void prepare_digest_methods()
|
||||
*/
|
||||
sess.mac = digest_data[i].devcryptoid;
|
||||
if (ioctl(cfd, CIOCGSESSION, &sess) < 0
|
||||
|| ioctl(cfd, CIOCFSESSION, &sess) < 0)
|
||||
|| ioctl(cfd, CIOCFSESSION, &sess.ses) < 0)
|
||||
continue;
|
||||
|
||||
if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
|
||||
@@ -532,6 +533,7 @@ static void prepare_digest_methods()
|
||||
|| !EVP_MD_meth_set_init(known_digest_methods[i], digest_init)
|
||||
|| !EVP_MD_meth_set_update(known_digest_methods[i], digest_update)
|
||||
|| !EVP_MD_meth_set_final(known_digest_methods[i], digest_final)
|
||||
|| !EVP_MD_meth_set_copy(known_digest_methods[i], digest_copy)
|
||||
|| !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
|
||||
|| !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
|
||||
sizeof(struct digest_ctx))) {
|
||||
@@ -541,8 +543,6 @@ static void prepare_digest_methods()
|
||||
known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
|
||||
}
|
||||
}
|
||||
|
||||
close(cfd);
|
||||
}
|
||||
|
||||
static const EVP_MD *get_digest_method(int nid)
|
||||
@@ -568,7 +568,7 @@ static void destroy_digest_method(int nid)
|
||||
known_digest_methods[i] = NULL;
|
||||
}
|
||||
|
||||
static void destroy_all_digest_methods()
|
||||
static void destroy_all_digest_methods(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -598,9 +598,12 @@ static int devcrypto_digests(ENGINE *e, const EVP_MD **digest,
|
||||
static int devcrypto_unload(ENGINE *e)
|
||||
{
|
||||
destroy_all_cipher_methods();
|
||||
#if defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
|
||||
#ifdef IMPLEMENT_DIGEST
|
||||
destroy_all_digest_methods();
|
||||
#endif
|
||||
|
||||
close(cfd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
@@ -611,23 +614,30 @@ void engine_load_devcrypto_int()
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
|
||||
if (access("/dev/crypto", R_OK | W_OK) < 0) {
|
||||
fprintf(stderr,
|
||||
"/dev/crypto not present, not enabling devcrypto engine\n");
|
||||
if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
|
||||
fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
prepare_cipher_methods();
|
||||
#if defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
|
||||
#ifdef IMPLEMENT_DIGEST
|
||||
prepare_digest_methods();
|
||||
#endif
|
||||
|
||||
if ((e = ENGINE_new()) == NULL)
|
||||
if ((e = ENGINE_new()) == NULL
|
||||
|| !ENGINE_set_destroy_function(e, devcrypto_unload)) {
|
||||
ENGINE_free(e);
|
||||
/*
|
||||
* We know that devcrypto_unload() won't be called when one of the
|
||||
* above two calls have failed, so we close cfd explicitly here to
|
||||
* avoid leaking resources.
|
||||
*/
|
||||
close(cfd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ENGINE_set_id(e, "devcrypto")
|
||||
|| !ENGINE_set_name(e, "/dev/crypto engine")
|
||||
|| !ENGINE_set_destroy_function(e, devcrypto_unload)
|
||||
|
||||
/*
|
||||
* Asymmetric ciphers aren't well supported with /dev/crypto. Among the BSD
|
||||
@@ -664,7 +674,7 @@ void engine_load_devcrypto_int()
|
||||
# endif
|
||||
#endif
|
||||
|| !ENGINE_set_ciphers(e, devcrypto_ciphers)
|
||||
#if defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
|
||||
#ifdef IMPLEMENT_DIGEST
|
||||
|| !ENGINE_set_digests(e, devcrypto_digests)
|
||||
#endif
|
||||
) {
|
||||
|
||||
@@ -317,8 +317,7 @@ ENGINE *ENGINE_by_id(const char *id)
|
||||
* Prevent infinite recursion if we're looking for the dynamic engine.
|
||||
*/
|
||||
if (strcmp(id, "dynamic")) {
|
||||
if (OPENSSL_issetugid()
|
||||
|| (load_dir = getenv("OPENSSL_ENGINES")) == NULL)
|
||||
if ((load_dir = ossl_safe_getenv("OPENSSL_ENGINES")) == NULL)
|
||||
load_dir = ENGINESDIR;
|
||||
iterator = ENGINE_by_id("dynamic");
|
||||
if (!iterator || !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) ||
|
||||
|
||||
@@ -1014,6 +1014,7 @@ RAND_F_RAND_POOL_ACQUIRE_ENTROPY:122:rand_pool_acquire_entropy
|
||||
RAND_F_RAND_POOL_ADD:103:rand_pool_add
|
||||
RAND_F_RAND_POOL_ADD_BEGIN:113:rand_pool_add_begin
|
||||
RAND_F_RAND_POOL_ADD_END:114:rand_pool_add_end
|
||||
RAND_F_RAND_POOL_ATTACH:124:rand_pool_attach
|
||||
RAND_F_RAND_POOL_BYTES_NEEDED:115:rand_pool_bytes_needed
|
||||
RAND_F_RAND_POOL_NEW:116:rand_pool_new
|
||||
RAND_F_RAND_WRITE_FILE:112:RAND_write_file
|
||||
|
||||
@@ -2241,7 +2241,7 @@ static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
|
||||
if (!cctx->aes.ccm.len_set) {
|
||||
/*-
|
||||
* In case message length was not previously set explicitely via
|
||||
* In case message length was not previously set explicitly via
|
||||
* Update(), set it now.
|
||||
*/
|
||||
ivec = EVP_CIPHER_CTX_iv_noconst(ctx);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -92,7 +92,8 @@ static int rc2_meth_to_magic(EVP_CIPHER_CTX *e)
|
||||
{
|
||||
int i;
|
||||
|
||||
EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i);
|
||||
if (EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i) <= 0)
|
||||
return 0;
|
||||
if (i == 128)
|
||||
return RC2_128_MAGIC;
|
||||
else if (i == 64)
|
||||
@@ -136,8 +137,9 @@ static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
|
||||
return -1;
|
||||
if (i > 0 && !EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1))
|
||||
return -1;
|
||||
EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL);
|
||||
if (EVP_CIPHER_CTX_set_key_length(c, key_bits / 8) <= 0)
|
||||
if (EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits,
|
||||
NULL) <= 0
|
||||
|| EVP_CIPHER_CTX_set_key_length(c, key_bits / 8) <= 0)
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
|
||||
@@ -837,21 +837,21 @@ void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth,
|
||||
void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
|
||||
int (**pcheck) (EVP_PKEY *pkey))
|
||||
{
|
||||
if (*pcheck)
|
||||
if (pcheck != NULL)
|
||||
*pcheck = pmeth->check;
|
||||
}
|
||||
|
||||
void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
|
||||
int (**pcheck) (EVP_PKEY *pkey))
|
||||
{
|
||||
if (*pcheck)
|
||||
if (pcheck != NULL)
|
||||
*pcheck = pmeth->public_check;
|
||||
}
|
||||
|
||||
void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth,
|
||||
int (**pcheck) (EVP_PKEY *pkey))
|
||||
{
|
||||
if (*pcheck)
|
||||
if (pcheck != NULL)
|
||||
*pcheck = pmeth->param_check;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
char *ossl_safe_getenv(const char *name)
|
||||
{
|
||||
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||
# if __GLIBC_PREREQ(2, 17)
|
||||
# define SECURE_GETENV
|
||||
return secure_getenv(name);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SECURE_GETENV
|
||||
if (OPENSSL_issetugid())
|
||||
return NULL;
|
||||
return getenv(name);
|
||||
#endif
|
||||
}
|
||||
@@ -41,5 +41,13 @@
|
||||
__owur int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
|
||||
const BIGNUM *x, BN_CTX *ctx);
|
||||
|
||||
/*-
|
||||
* ECDH Key Derivation Function as defined in ANSI X9.63
|
||||
*/
|
||||
int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
const unsigned char *sinfo, size_t sinfolen,
|
||||
const EVP_MD *md);
|
||||
|
||||
# endif /* OPENSSL_NO_EC */
|
||||
#endif
|
||||
@@ -45,18 +45,21 @@ size_t rand_drbg_get_nonce(RAND_DRBG *drbg,
|
||||
void rand_drbg_cleanup_nonce(RAND_DRBG *drbg,
|
||||
unsigned char *out, size_t outlen);
|
||||
|
||||
size_t rand_drbg_get_additional_data(unsigned char **pout, size_t max_len);
|
||||
size_t rand_drbg_get_additional_data(RAND_POOL *pool, unsigned char **pout);
|
||||
|
||||
void rand_drbg_cleanup_additional_data(unsigned char *out, size_t outlen);
|
||||
void rand_drbg_cleanup_additional_data(RAND_POOL *pool, unsigned char *out);
|
||||
|
||||
/*
|
||||
* RAND_POOL functions
|
||||
*/
|
||||
RAND_POOL *rand_pool_new(int entropy_requested, size_t min_len, size_t max_len);
|
||||
RAND_POOL *rand_pool_attach(const unsigned char *buffer, size_t len,
|
||||
size_t entropy);
|
||||
void rand_pool_free(RAND_POOL *pool);
|
||||
|
||||
const unsigned char *rand_pool_buffer(RAND_POOL *pool);
|
||||
unsigned char *rand_pool_detach(RAND_POOL *pool);
|
||||
void rand_pool_reattach(RAND_POOL *pool, unsigned char *buffer);
|
||||
|
||||
size_t rand_pool_entropy(RAND_POOL *pool);
|
||||
size_t rand_pool_length(RAND_POOL *pool);
|
||||
|
||||
@@ -175,6 +175,18 @@ static int pkey_hkdf_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
|
||||
return -2;
|
||||
}
|
||||
|
||||
static int pkey_hkdf_derive_init(EVP_PKEY_CTX *ctx)
|
||||
{
|
||||
HKDF_PKEY_CTX *kctx = ctx->data;
|
||||
|
||||
OPENSSL_clear_free(kctx->key, kctx->key_len);
|
||||
OPENSSL_clear_free(kctx->salt, kctx->salt_len);
|
||||
OPENSSL_cleanse(kctx->info, kctx->info_len);
|
||||
memset(kctx, 0, sizeof(*kctx));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int pkey_hkdf_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
|
||||
size_t *keylen)
|
||||
{
|
||||
@@ -236,7 +248,7 @@ const EVP_PKEY_METHOD hkdf_pkey_meth = {
|
||||
|
||||
0, 0,
|
||||
|
||||
0,
|
||||
pkey_hkdf_derive_init,
|
||||
pkey_hkdf_derive,
|
||||
pkey_hkdf_ctrl,
|
||||
pkey_hkdf_ctrl_str
|
||||
|
||||
@@ -20,12 +20,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* e_os.h includes unistd.h, which defines _POSIX_VERSION */
|
||||
#if !defined(OPENSSL_NO_SECURE_MEMORY) && defined(OPENSSL_SYS_UNIX) \
|
||||
&& ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
|
||||
|| defined(__sun) || defined(__hpux) || defined(__sgi) \
|
||||
|| defined(__osf__) )
|
||||
# define IMPLEMENTED
|
||||
/* e_os.h defines OPENSSL_SECURE_MEMORY if secure memory can be implemented */
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
# include <stdlib.h>
|
||||
# include <assert.h>
|
||||
# include <unistd.h>
|
||||
@@ -51,7 +47,7 @@
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
#endif
|
||||
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
static size_t secure_mem_used;
|
||||
|
||||
static int secure_mem_initialized;
|
||||
@@ -71,7 +67,7 @@ static int sh_allocated(const char *ptr);
|
||||
|
||||
int CRYPTO_secure_malloc_init(size_t size, int minsize)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
int ret = 0;
|
||||
|
||||
if (!secure_mem_initialized) {
|
||||
@@ -89,12 +85,12 @@ int CRYPTO_secure_malloc_init(size_t size, int minsize)
|
||||
return ret;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
int CRYPTO_secure_malloc_done(void)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
if (secure_mem_used == 0) {
|
||||
sh_done();
|
||||
secure_mem_initialized = 0;
|
||||
@@ -102,22 +98,22 @@ int CRYPTO_secure_malloc_done(void)
|
||||
sec_malloc_lock = NULL;
|
||||
return 1;
|
||||
}
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CRYPTO_secure_malloc_initialized(void)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
return secure_mem_initialized;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
void *CRYPTO_secure_malloc(size_t num, const char *file, int line)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
void *ret;
|
||||
size_t actual_size;
|
||||
|
||||
@@ -132,12 +128,12 @@ void *CRYPTO_secure_malloc(size_t num, const char *file, int line)
|
||||
return ret;
|
||||
#else
|
||||
return CRYPTO_malloc(num, file, line);
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
if (secure_mem_initialized)
|
||||
/* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
|
||||
return CRYPTO_secure_malloc(num, file, line);
|
||||
@@ -147,7 +143,7 @@ void *CRYPTO_secure_zalloc(size_t num, const char *file, int line)
|
||||
|
||||
void CRYPTO_secure_free(void *ptr, const char *file, int line)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
size_t actual_size;
|
||||
|
||||
if (ptr == NULL)
|
||||
@@ -164,13 +160,13 @@ void CRYPTO_secure_free(void *ptr, const char *file, int line)
|
||||
CRYPTO_THREAD_unlock(sec_malloc_lock);
|
||||
#else
|
||||
CRYPTO_free(ptr, file, line);
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
||||
const char *file, int line)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
size_t actual_size;
|
||||
|
||||
if (ptr == NULL)
|
||||
@@ -191,12 +187,12 @@ void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
||||
return;
|
||||
OPENSSL_cleanse(ptr, num);
|
||||
CRYPTO_free(ptr, file, line);
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
int CRYPTO_secure_allocated(const void *ptr)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
int ret;
|
||||
|
||||
if (!secure_mem_initialized)
|
||||
@@ -207,21 +203,21 @@ int CRYPTO_secure_allocated(const void *ptr)
|
||||
return ret;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
size_t CRYPTO_secure_used(void)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
return secure_mem_used;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
}
|
||||
|
||||
size_t CRYPTO_secure_actual_size(void *ptr)
|
||||
{
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
size_t actual_size;
|
||||
|
||||
CRYPTO_THREAD_write_lock(sec_malloc_lock);
|
||||
@@ -239,7 +235,7 @@ size_t CRYPTO_secure_actual_size(void *ptr)
|
||||
/*
|
||||
* SECURE HEAP IMPLEMENTATION
|
||||
*/
|
||||
#ifdef IMPLEMENTED
|
||||
#ifdef OPENSSL_SECURE_MEMORY
|
||||
|
||||
|
||||
/*
|
||||
@@ -647,4 +643,4 @@ static size_t sh_actual_size(char *ptr)
|
||||
OPENSSL_assert(sh_testbit(ptr, list, sh.bittable));
|
||||
return sh.arena_size / (ONE << list);
|
||||
}
|
||||
#endif /* IMPLEMENTED */
|
||||
#endif /* OPENSSL_SECURE_MEMORY */
|
||||
@@ -25,14 +25,12 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#include "e_os.h"
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
#if !defined(OPENSSL_NO_STDIO)
|
||||
|
||||
# include <stdio.h>
|
||||
# ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# endif
|
||||
# ifdef __DJGPP__
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include "internal/cryptlib.h"
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/hmac.h>
|
||||
# include <openssl/rand.h>
|
||||
# include <openssl/pkcs12.h>
|
||||
# include "p12_lcl.h"
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/hmac.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include "p12_lcl.h"
|
||||
|
||||
int PKCS12_mac_present(const PKCS12 *p12)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
|
||||
}
|
||||
}
|
||||
|
||||
# define TK26_MAC_KEY_LEN 32
|
||||
#define TK26_MAC_KEY_LEN 32
|
||||
|
||||
static int pkcs12_gen_gost_mac_key(const char *pass, int passlen,
|
||||
const unsigned char *salt, int saltlen,
|
||||
@@ -112,7 +112,7 @@ static int pkcs12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
||||
if ((md_type_nid == NID_id_GostR3411_94
|
||||
|| md_type_nid == NID_id_GostR3411_2012_256
|
||||
|| md_type_nid == NID_id_GostR3411_2012_512)
|
||||
&& !getenv("LEGACY_GOST_PKCS12")) {
|
||||
&& ossl_safe_getenv("LEGACY_GOST_PKCS12") == NULL) {
|
||||
md_size = TK26_MAC_KEY_LEN;
|
||||
if (!pkcs12_gen_gost_mac_key(pass, passlen, salt, saltlen, iter,
|
||||
md_size, key, md_type)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-20018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -402,10 +402,10 @@ int drbg_ctr_init(RAND_DRBG *drbg)
|
||||
if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) {
|
||||
/* df initialisation */
|
||||
static const unsigned char df_key[32] = {
|
||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
||||
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
|
||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
||||
0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
|
||||
};
|
||||
|
||||
if (ctr->ctx_df == NULL)
|
||||
@@ -417,9 +417,9 @@ int drbg_ctr_init(RAND_DRBG *drbg)
|
||||
return 0;
|
||||
|
||||
drbg->min_entropylen = ctr->keylen;
|
||||
drbg->max_entropylen = DRBG_MINMAX_FACTOR * drbg->min_entropylen;
|
||||
drbg->max_entropylen = DRBG_MAX_LENGTH;
|
||||
drbg->min_noncelen = drbg->min_entropylen / 2;
|
||||
drbg->max_noncelen = DRBG_MINMAX_FACTOR * drbg->min_noncelen;
|
||||
drbg->max_noncelen = DRBG_MAX_LENGTH;
|
||||
drbg->max_perslen = DRBG_MAX_LENGTH;
|
||||
drbg->max_adinlen = DRBG_MAX_LENGTH;
|
||||
} else {
|
||||
|
||||
@@ -82,6 +82,10 @@ static unsigned int slave_reseed_interval = SLAVE_RESEED_INTERVAL;
|
||||
static time_t master_reseed_time_interval = MASTER_RESEED_TIME_INTERVAL;
|
||||
static time_t slave_reseed_time_interval = SLAVE_RESEED_TIME_INTERVAL;
|
||||
|
||||
/* A logical OR of all used DRBG flag bits (currently there is only one) */
|
||||
static const unsigned int rand_drbg_used_flags =
|
||||
RAND_DRBG_FLAG_CTR_NO_DF;
|
||||
|
||||
static RAND_DRBG *drbg_setup(RAND_DRBG *parent);
|
||||
|
||||
static RAND_DRBG *rand_drbg_new(int secure,
|
||||
@@ -105,16 +109,27 @@ int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags)
|
||||
flags = rand_drbg_flags;
|
||||
}
|
||||
|
||||
/* If set is called multiple times - clear the old one */
|
||||
if (drbg->type != 0 && (type != drbg->type || flags != drbg->flags)) {
|
||||
drbg->meth->uninstantiate(drbg);
|
||||
rand_pool_free(drbg->adin_pool);
|
||||
drbg->adin_pool = NULL;
|
||||
}
|
||||
|
||||
drbg->state = DRBG_UNINITIALISED;
|
||||
drbg->flags = flags;
|
||||
drbg->type = type;
|
||||
|
||||
switch (type) {
|
||||
default:
|
||||
drbg->type = 0;
|
||||
drbg->flags = 0;
|
||||
drbg->meth = NULL;
|
||||
RANDerr(RAND_F_RAND_DRBG_SET, RAND_R_UNSUPPORTED_DRBG_TYPE);
|
||||
return 0;
|
||||
case 0:
|
||||
/* Uninitialized; that's okay. */
|
||||
drbg->meth = NULL;
|
||||
return 1;
|
||||
case NID_aes_128_ctr:
|
||||
case NID_aes_192_ctr:
|
||||
@@ -123,8 +138,10 @@ int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
drbg->state = DRBG_ERROR;
|
||||
RANDerr(RAND_F_RAND_DRBG_SET, RAND_R_ERROR_INITIALISING_DRBG);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -147,7 +164,7 @@ int RAND_DRBG_set_defaults(int type, unsigned int flags)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((flags & ~RAND_DRBG_USED_FLAGS) != 0) {
|
||||
if ((flags & ~rand_drbg_used_flags) != 0) {
|
||||
RANDerr(RAND_F_RAND_DRBG_SET_DEFAULTS, RAND_R_UNSUPPORTED_DRBG_FLAGS);
|
||||
return 0;
|
||||
}
|
||||
@@ -224,11 +241,8 @@ static RAND_DRBG *rand_drbg_new(int secure,
|
||||
|
||||
return drbg;
|
||||
|
||||
err:
|
||||
if (drbg->secure)
|
||||
OPENSSL_secure_free(drbg);
|
||||
else
|
||||
OPENSSL_free(drbg);
|
||||
err:
|
||||
RAND_DRBG_free(drbg);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -253,6 +267,7 @@ void RAND_DRBG_free(RAND_DRBG *drbg)
|
||||
|
||||
if (drbg->meth != NULL)
|
||||
drbg->meth->uninstantiate(drbg);
|
||||
rand_pool_free(drbg->adin_pool);
|
||||
CRYPTO_THREAD_lock_free(drbg->lock);
|
||||
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DRBG, drbg, &drbg->ex_data);
|
||||
|
||||
@@ -312,11 +327,18 @@ int RAND_DRBG_instantiate(RAND_DRBG *drbg,
|
||||
max_entropylen += drbg->max_noncelen;
|
||||
}
|
||||
|
||||
drbg->reseed_next_counter = tsan_load(&drbg->reseed_prop_counter);
|
||||
if (drbg->reseed_next_counter) {
|
||||
drbg->reseed_next_counter++;
|
||||
if(!drbg->reseed_next_counter)
|
||||
drbg->reseed_next_counter = 1;
|
||||
}
|
||||
|
||||
if (drbg->get_entropy != NULL)
|
||||
entropylen = drbg->get_entropy(drbg, &entropy, min_entropy,
|
||||
min_entropylen, max_entropylen, 0);
|
||||
if (entropylen < min_entropylen
|
||||
|| entropylen > max_entropylen) {
|
||||
|| entropylen > max_entropylen) {
|
||||
RANDerr(RAND_F_RAND_DRBG_INSTANTIATE, RAND_R_ERROR_RETRIEVING_ENTROPY);
|
||||
goto end;
|
||||
}
|
||||
@@ -337,29 +359,15 @@ int RAND_DRBG_instantiate(RAND_DRBG *drbg,
|
||||
}
|
||||
|
||||
drbg->state = DRBG_READY;
|
||||
drbg->generate_counter = 0;
|
||||
drbg->reseed_gen_counter = 1;
|
||||
drbg->reseed_time = time(NULL);
|
||||
if (drbg->reseed_counter > 0) {
|
||||
if (drbg->parent == NULL)
|
||||
drbg->reseed_counter++;
|
||||
else
|
||||
drbg->reseed_counter = drbg->parent->reseed_counter;
|
||||
}
|
||||
tsan_store(&drbg->reseed_prop_counter, drbg->reseed_next_counter);
|
||||
|
||||
end:
|
||||
end:
|
||||
if (entropy != NULL && drbg->cleanup_entropy != NULL)
|
||||
drbg->cleanup_entropy(drbg, entropy, entropylen);
|
||||
if (nonce != NULL && drbg->cleanup_nonce!= NULL )
|
||||
if (nonce != NULL && drbg->cleanup_nonce != NULL)
|
||||
drbg->cleanup_nonce(drbg, nonce, noncelen);
|
||||
if (drbg->pool != NULL) {
|
||||
if (drbg->state == DRBG_READY) {
|
||||
RANDerr(RAND_F_RAND_DRBG_INSTANTIATE,
|
||||
RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED);
|
||||
drbg->state = DRBG_ERROR;
|
||||
}
|
||||
rand_pool_free(drbg->pool);
|
||||
drbg->pool = NULL;
|
||||
}
|
||||
if (drbg->state == DRBG_READY)
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -375,6 +383,7 @@ end:
|
||||
int RAND_DRBG_uninstantiate(RAND_DRBG *drbg)
|
||||
{
|
||||
if (drbg->meth == NULL) {
|
||||
drbg->state = DRBG_ERROR;
|
||||
RANDerr(RAND_F_RAND_DRBG_UNINSTANTIATE,
|
||||
RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED);
|
||||
return 0;
|
||||
@@ -419,13 +428,21 @@ int RAND_DRBG_reseed(RAND_DRBG *drbg,
|
||||
}
|
||||
|
||||
drbg->state = DRBG_ERROR;
|
||||
|
||||
drbg->reseed_next_counter = tsan_load(&drbg->reseed_prop_counter);
|
||||
if (drbg->reseed_next_counter) {
|
||||
drbg->reseed_next_counter++;
|
||||
if(!drbg->reseed_next_counter)
|
||||
drbg->reseed_next_counter = 1;
|
||||
}
|
||||
|
||||
if (drbg->get_entropy != NULL)
|
||||
entropylen = drbg->get_entropy(drbg, &entropy, drbg->strength,
|
||||
drbg->min_entropylen,
|
||||
drbg->max_entropylen,
|
||||
prediction_resistance);
|
||||
if (entropylen < drbg->min_entropylen
|
||||
|| entropylen > drbg->max_entropylen) {
|
||||
|| entropylen > drbg->max_entropylen) {
|
||||
RANDerr(RAND_F_RAND_DRBG_RESEED, RAND_R_ERROR_RETRIEVING_ENTROPY);
|
||||
goto end;
|
||||
}
|
||||
@@ -434,16 +451,11 @@ int RAND_DRBG_reseed(RAND_DRBG *drbg,
|
||||
goto end;
|
||||
|
||||
drbg->state = DRBG_READY;
|
||||
drbg->generate_counter = 0;
|
||||
drbg->reseed_gen_counter = 1;
|
||||
drbg->reseed_time = time(NULL);
|
||||
if (drbg->reseed_counter > 0) {
|
||||
if (drbg->parent == NULL)
|
||||
drbg->reseed_counter++;
|
||||
else
|
||||
drbg->reseed_counter = drbg->parent->reseed_counter;
|
||||
}
|
||||
tsan_store(&drbg->reseed_prop_counter, drbg->reseed_next_counter);
|
||||
|
||||
end:
|
||||
end:
|
||||
if (entropy != NULL && drbg->cleanup_entropy != NULL)
|
||||
drbg->cleanup_entropy(drbg, entropy, entropylen);
|
||||
if (drbg->state == DRBG_READY)
|
||||
@@ -475,10 +487,12 @@ int rand_drbg_restart(RAND_DRBG *drbg,
|
||||
const unsigned char *adin = NULL;
|
||||
size_t adinlen = 0;
|
||||
|
||||
if (drbg->pool != NULL) {
|
||||
if (drbg->seed_pool != NULL) {
|
||||
RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR);
|
||||
rand_pool_free(drbg->pool);
|
||||
drbg->pool = NULL;
|
||||
drbg->state = DRBG_ERROR;
|
||||
rand_pool_free(drbg->seed_pool);
|
||||
drbg->seed_pool = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (buffer != NULL) {
|
||||
@@ -486,24 +500,25 @@ int rand_drbg_restart(RAND_DRBG *drbg,
|
||||
if (drbg->max_entropylen < len) {
|
||||
RANDerr(RAND_F_RAND_DRBG_RESTART,
|
||||
RAND_R_ENTROPY_INPUT_TOO_LONG);
|
||||
drbg->state = DRBG_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (entropy > 8 * len) {
|
||||
RANDerr(RAND_F_RAND_DRBG_RESTART, RAND_R_ENTROPY_OUT_OF_RANGE);
|
||||
drbg->state = DRBG_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* will be picked up by the rand_drbg_get_entropy() callback */
|
||||
drbg->pool = rand_pool_new(entropy, len, len);
|
||||
if (drbg->pool == NULL)
|
||||
drbg->seed_pool = rand_pool_attach(buffer, len, entropy);
|
||||
if (drbg->seed_pool == NULL)
|
||||
return 0;
|
||||
|
||||
rand_pool_add(drbg->pool, buffer, len, entropy);
|
||||
} else {
|
||||
if (drbg->max_adinlen < len) {
|
||||
RANDerr(RAND_F_RAND_DRBG_RESTART,
|
||||
RAND_R_ADDITIONAL_INPUT_TOO_LONG);
|
||||
drbg->state = DRBG_ERROR;
|
||||
return 0;
|
||||
}
|
||||
adin = buffer;
|
||||
@@ -543,14 +558,8 @@ int rand_drbg_restart(RAND_DRBG *drbg,
|
||||
}
|
||||
}
|
||||
|
||||
/* check whether a given entropy pool was cleared properly during reseed */
|
||||
if (drbg->pool != NULL) {
|
||||
drbg->state = DRBG_ERROR;
|
||||
RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR);
|
||||
rand_pool_free(drbg->pool);
|
||||
drbg->pool = NULL;
|
||||
return 0;
|
||||
}
|
||||
rand_pool_free(drbg->seed_pool);
|
||||
drbg->seed_pool = NULL;
|
||||
|
||||
return drbg->state == DRBG_READY;
|
||||
}
|
||||
@@ -600,7 +609,7 @@ int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen,
|
||||
}
|
||||
|
||||
if (drbg->reseed_interval > 0) {
|
||||
if (drbg->generate_counter >= drbg->reseed_interval)
|
||||
if (drbg->reseed_gen_counter >= drbg->reseed_interval)
|
||||
reseed_required = 1;
|
||||
}
|
||||
if (drbg->reseed_time_interval > 0) {
|
||||
@@ -609,8 +618,11 @@ int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen,
|
||||
|| now - drbg->reseed_time >= drbg->reseed_time_interval)
|
||||
reseed_required = 1;
|
||||
}
|
||||
if (drbg->reseed_counter > 0 && drbg->parent != NULL) {
|
||||
if (drbg->reseed_counter != drbg->parent->reseed_counter)
|
||||
if (drbg->parent != NULL) {
|
||||
unsigned int reseed_counter = tsan_load(&drbg->reseed_prop_counter);
|
||||
if (reseed_counter > 0
|
||||
&& tsan_load(&drbg->parent->reseed_prop_counter)
|
||||
!= reseed_counter)
|
||||
reseed_required = 1;
|
||||
}
|
||||
|
||||
@@ -629,7 +641,7 @@ int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen,
|
||||
return 0;
|
||||
}
|
||||
|
||||
drbg->generate_counter++;
|
||||
drbg->reseed_gen_counter++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -647,9 +659,18 @@ int RAND_DRBG_bytes(RAND_DRBG *drbg, unsigned char *out, size_t outlen)
|
||||
unsigned char *additional = NULL;
|
||||
size_t additional_len;
|
||||
size_t chunk;
|
||||
size_t ret;
|
||||
size_t ret = 0;
|
||||
|
||||
additional_len = rand_drbg_get_additional_data(&additional, drbg->max_adinlen);
|
||||
if (drbg->adin_pool == NULL) {
|
||||
if (drbg->type == 0)
|
||||
goto err;
|
||||
drbg->adin_pool = rand_pool_new(0, 0, drbg->max_adinlen);
|
||||
if (drbg->adin_pool == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
||||
additional_len = rand_drbg_get_additional_data(drbg->adin_pool,
|
||||
&additional);
|
||||
|
||||
for ( ; outlen > 0; outlen -= chunk, out += chunk) {
|
||||
chunk = outlen;
|
||||
@@ -661,9 +682,9 @@ int RAND_DRBG_bytes(RAND_DRBG *drbg, unsigned char *out, size_t outlen)
|
||||
}
|
||||
ret = 1;
|
||||
|
||||
err:
|
||||
if (additional_len != 0)
|
||||
OPENSSL_secure_clear_free(additional, additional_len);
|
||||
err:
|
||||
if (additional != NULL)
|
||||
rand_drbg_cleanup_additional_data(drbg->adin_pool, additional);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -682,7 +703,8 @@ int RAND_DRBG_set_callbacks(RAND_DRBG *drbg,
|
||||
RAND_DRBG_get_nonce_fn get_nonce,
|
||||
RAND_DRBG_cleanup_nonce_fn cleanup_nonce)
|
||||
{
|
||||
if (drbg->state != DRBG_UNINITIALISED)
|
||||
if (drbg->state != DRBG_UNINITIALISED
|
||||
|| drbg->parent != NULL)
|
||||
return 0;
|
||||
drbg->get_entropy = get_entropy;
|
||||
drbg->cleanup_entropy = cleanup_entropy;
|
||||
@@ -859,7 +881,7 @@ static RAND_DRBG *drbg_setup(RAND_DRBG *parent)
|
||||
goto err;
|
||||
|
||||
/* enable seed propagation */
|
||||
drbg->reseed_counter = 1;
|
||||
tsan_store(&drbg->reseed_prop_counter, 1);
|
||||
|
||||
/*
|
||||
* Ignore instantiation error to support just-in-time instantiation.
|
||||
@@ -948,11 +970,49 @@ static int drbg_bytes(unsigned char *out, int count)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculates the minimum length of a full entropy buffer
|
||||
* which is necessary to seed (i.e. instantiate) the DRBG
|
||||
* successfully.
|
||||
*/
|
||||
size_t rand_drbg_seedlen(RAND_DRBG *drbg)
|
||||
{
|
||||
/*
|
||||
* If no os entropy source is available then RAND_seed(buffer, bufsize)
|
||||
* is expected to succeed if and only if the buffer length satisfies
|
||||
* the following requirements, which follow from the calculations
|
||||
* in RAND_DRBG_instantiate().
|
||||
*/
|
||||
size_t min_entropy = drbg->strength;
|
||||
size_t min_entropylen = drbg->min_entropylen;
|
||||
|
||||
/*
|
||||
* Extra entropy for the random nonce in the absence of a
|
||||
* get_nonce callback, see comment in RAND_DRBG_instantiate().
|
||||
*/
|
||||
if (drbg->min_noncelen > 0 && drbg->get_nonce == NULL) {
|
||||
min_entropy += drbg->strength / 2;
|
||||
min_entropylen += drbg->min_noncelen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert entropy requirement from bits to bytes
|
||||
* (dividing by 8 without rounding upwards, because
|
||||
* all entropy requirements are divisible by 8).
|
||||
*/
|
||||
min_entropy >>= 3;
|
||||
|
||||
/* Return a value that satisfies both requirements */
|
||||
return min_entropy > min_entropylen ? min_entropy : min_entropylen;
|
||||
}
|
||||
|
||||
/* Implements the default OpenSSL RAND_add() method */
|
||||
static int drbg_add(const void *buf, int num, double randomness)
|
||||
{
|
||||
int ret = 0;
|
||||
RAND_DRBG *drbg = RAND_DRBG_get0_master();
|
||||
size_t buflen;
|
||||
size_t seedlen;
|
||||
|
||||
if (drbg == NULL)
|
||||
return 0;
|
||||
@@ -960,20 +1020,49 @@ static int drbg_add(const void *buf, int num, double randomness)
|
||||
if (num < 0 || randomness < 0.0)
|
||||
return 0;
|
||||
|
||||
if (randomness > (double)drbg->max_entropylen) {
|
||||
rand_drbg_lock(drbg);
|
||||
seedlen = rand_drbg_seedlen(drbg);
|
||||
|
||||
buflen = (size_t)num;
|
||||
|
||||
if (buflen < seedlen || randomness < (double) seedlen) {
|
||||
#if defined(OPENSSL_RAND_SEED_NONE)
|
||||
/*
|
||||
* If no os entropy source is available, a reseeding will fail
|
||||
* inevitably. So we use a trick to mix the buffer contents into
|
||||
* the DRBG state without forcing a reseeding: we generate a
|
||||
* dummy random byte, using the buffer content as additional data.
|
||||
* Note: This won't work with RAND_DRBG_FLAG_CTR_NO_DF.
|
||||
*/
|
||||
unsigned char dummy[1];
|
||||
|
||||
ret = RAND_DRBG_generate(drbg, dummy, sizeof(dummy), 0, buf, buflen);
|
||||
rand_drbg_unlock(drbg);
|
||||
return ret;
|
||||
#else
|
||||
/*
|
||||
* If an os entropy source is avaible then we declare the buffer content
|
||||
* as additional data by setting randomness to zero and trigger a regular
|
||||
* reseeding.
|
||||
*/
|
||||
randomness = 0.0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (randomness > (double)seedlen) {
|
||||
/*
|
||||
* The purpose of this check is to bound |randomness| by a
|
||||
* relatively small value in order to prevent an integer
|
||||
* overflow when multiplying by 8 in the rand_drbg_restart()
|
||||
* call below.
|
||||
* call below. Note that randomness is measured in bytes,
|
||||
* not bits, so this value corresponds to eight times the
|
||||
* security strength.
|
||||
*/
|
||||
return 0;
|
||||
randomness = (double)seedlen;
|
||||
}
|
||||
|
||||
rand_drbg_lock(drbg);
|
||||
ret = rand_drbg_restart(drbg, buf,
|
||||
(size_t)(unsigned int)num,
|
||||
(size_t)(8*randomness));
|
||||
ret = rand_drbg_restart(drbg, buf, buflen, (size_t)(8 * randomness));
|
||||
rand_drbg_unlock(drbg);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -44,6 +44,7 @@ static const ERR_STRING_DATA RAND_str_functs[] = {
|
||||
{ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ADD_BEGIN, 0),
|
||||
"rand_pool_add_begin"},
|
||||
{ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ADD_END, 0), "rand_pool_add_end"},
|
||||
{ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ATTACH, 0), "rand_pool_attach"},
|
||||
{ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_BYTES_NEEDED, 0),
|
||||
"rand_pool_bytes_needed"},
|
||||
{ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_NEW, 0), "rand_pool_new"},
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
# include <openssl/hmac.h>
|
||||
# include <openssl/ec.h>
|
||||
# include <openssl/rand_drbg.h>
|
||||
# include "internal/tsan_assist.h"
|
||||
|
||||
# include "internal/numbers.h"
|
||||
|
||||
/* How many times to read the TSC as a randomness source. */
|
||||
# define TSC_READ_COUNT 4
|
||||
@@ -32,18 +35,42 @@
|
||||
|
||||
|
||||
|
||||
/* Max size of additional input and personalization string. */
|
||||
# define DRBG_MAX_LENGTH 4096
|
||||
/*
|
||||
* Maximum input size for the DRBG (entropy, nonce, personalization string)
|
||||
*
|
||||
* NIST SP800 90Ar1 allows a maximum of (1 << 35) bits i.e., (1 << 32) bytes.
|
||||
*
|
||||
* We lower it to 'only' INT32_MAX bytes, which is equivalent to 2 gigabytes.
|
||||
*/
|
||||
# define DRBG_MAX_LENGTH INT32_MAX
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The quotient between max_{entropy,nonce}len and min_{entropy,nonce}len
|
||||
* Maximum allocation size for RANDOM_POOL buffers
|
||||
*
|
||||
* The current factor is large enough that the RAND_POOL can store a
|
||||
* random input which has a lousy entropy rate of 0.0625 bits per byte.
|
||||
* This input will be sent through the derivation function which 'compresses'
|
||||
* the low quality input into a high quality output.
|
||||
* The max_len value for the buffer provided to the rand_drbg_get_entropy()
|
||||
* callback is currently 2^31 bytes (2 gigabytes), if a derivation function
|
||||
* is used. Since this is much too large to be allocated, the rand_pool_new()
|
||||
* function chooses more modest values as default pool length, bounded
|
||||
* by RAND_POOL_MIN_LENGTH and RAND_POOL_MAX_LENGTH
|
||||
*
|
||||
* The choice of the RAND_POOL_FACTOR is large enough such that the
|
||||
* RAND_POOL can store a random input which has a lousy entropy rate of
|
||||
* 8/256 (= 0.03125) bits per byte. This input will be sent through the
|
||||
* derivation function which 'compresses' the low quality input into a
|
||||
* high quality output.
|
||||
*
|
||||
* The factor 1.5 below is the pessimistic estimate for the extra amount
|
||||
* of entropy required when no get_nonce() callback is defined.
|
||||
*/
|
||||
# define RAND_POOL_FACTOR 256
|
||||
# define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * \
|
||||
3 * (RAND_DRBG_STRENGTH / 16))
|
||||
/*
|
||||
* = (RAND_POOL_FACTOR * \
|
||||
* 1.5 * (RAND_DRBG_STRENGTH / 8))
|
||||
*/
|
||||
# define DRBG_MINMAX_FACTOR 128
|
||||
|
||||
|
||||
/* DRBG status values */
|
||||
@@ -54,7 +81,7 @@ typedef enum drbg_status_e {
|
||||
} DRBG_STATUS;
|
||||
|
||||
|
||||
/* intantiate */
|
||||
/* instantiate */
|
||||
typedef int (*RAND_DRBG_instantiate_fn)(RAND_DRBG *ctx,
|
||||
const unsigned char *ent,
|
||||
size_t entlen,
|
||||
@@ -68,7 +95,7 @@ typedef int (*RAND_DRBG_reseed_fn)(RAND_DRBG *ctx,
|
||||
size_t entlen,
|
||||
const unsigned char *adin,
|
||||
size_t adinlen);
|
||||
/* generat output */
|
||||
/* generate output */
|
||||
typedef int (*RAND_DRBG_generate_fn)(RAND_DRBG *ctx,
|
||||
unsigned char *out,
|
||||
size_t outlen,
|
||||
@@ -122,10 +149,12 @@ struct rand_pool_st {
|
||||
unsigned char *buffer; /* points to the beginning of the random pool */
|
||||
size_t len; /* current number of random bytes contained in the pool */
|
||||
|
||||
int attached; /* true pool was attached to existing buffer */
|
||||
|
||||
size_t min_len; /* minimum number of random bytes requested */
|
||||
size_t max_len; /* maximum number of random bytes (allocated buffer size) */
|
||||
size_t entropy; /* current entropy count in bits */
|
||||
size_t requested_entropy; /* requested entropy count in bits */
|
||||
size_t entropy_requested; /* requested entropy count in bits */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -139,7 +168,7 @@ struct rand_drbg_st {
|
||||
int type; /* the nid of the underlying algorithm */
|
||||
/*
|
||||
* Stores the value of the rand_fork_count global as of when we last
|
||||
* reseeded. The DRG reseeds automatically whenever drbg->fork_count !=
|
||||
* reseeded. The DRBG reseeds automatically whenever drbg->fork_count !=
|
||||
* rand_fork_count. Used to provide fork-safety and reseed this DRBG in
|
||||
* the child process.
|
||||
*/
|
||||
@@ -147,14 +176,19 @@ struct rand_drbg_st {
|
||||
unsigned short flags; /* various external flags */
|
||||
|
||||
/*
|
||||
* The random pool is used by RAND_add()/drbg_add() to attach random
|
||||
* The random_data is used by RAND_add()/drbg_add() to attach random
|
||||
* data to the global drbg, such that the rand_drbg_get_entropy() callback
|
||||
* can pull it during instantiation and reseeding. This is necessary to
|
||||
* reconcile the different philosophies of the RAND and the RAND_DRBG
|
||||
* with respect to how randomness is added to the RNG during reseeding
|
||||
* (see PR #4328).
|
||||
*/
|
||||
struct rand_pool_st *pool;
|
||||
struct rand_pool_st *seed_pool;
|
||||
|
||||
/*
|
||||
* Auxiliary pool for additional data.
|
||||
*/
|
||||
struct rand_pool_st *adin_pool;
|
||||
|
||||
/*
|
||||
* The following parameters are setup by the per-type "init" function.
|
||||
@@ -180,7 +214,7 @@ struct rand_drbg_st {
|
||||
size_t max_perslen, max_adinlen;
|
||||
|
||||
/* Counts the number of generate requests since the last reseed. */
|
||||
unsigned int generate_counter;
|
||||
unsigned int reseed_gen_counter;
|
||||
/*
|
||||
* Maximum number of generate requests until a reseed is required.
|
||||
* This value is ignored if it is zero.
|
||||
@@ -203,7 +237,8 @@ struct rand_drbg_st {
|
||||
* is added by RAND_add() or RAND_seed() will have an immediate effect on
|
||||
* the output of RAND_bytes() resp. RAND_priv_bytes().
|
||||
*/
|
||||
unsigned int reseed_counter;
|
||||
TSAN_QUALIFIER unsigned int reseed_prop_counter;
|
||||
unsigned int reseed_next_counter;
|
||||
|
||||
size_t seedlen;
|
||||
DRBG_STATUS state;
|
||||
@@ -245,7 +280,7 @@ extern int rand_fork_count;
|
||||
/* DRBG helpers */
|
||||
int rand_drbg_restart(RAND_DRBG *drbg,
|
||||
const unsigned char *buffer, size_t len, size_t entropy);
|
||||
|
||||
size_t rand_drbg_seedlen(RAND_DRBG *drbg);
|
||||
/* locking api */
|
||||
int rand_drbg_lock(RAND_DRBG *drbg);
|
||||
int rand_drbg_unlock(RAND_DRBG *drbg);
|
||||
|
||||
@@ -31,7 +31,7 @@ int rand_fork_count;
|
||||
static CRYPTO_RWLOCK *rand_nonce_lock;
|
||||
static int rand_nonce_count;
|
||||
|
||||
static int rand_cleaning_up = 0;
|
||||
static int rand_inited = 0;
|
||||
|
||||
#ifdef OPENSSL_RAND_SEED_RDTSC
|
||||
/*
|
||||
@@ -146,17 +146,13 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
pool = rand_pool_new(entropy, min_len, max_len);
|
||||
if (pool == NULL)
|
||||
return 0;
|
||||
|
||||
if (drbg->pool) {
|
||||
rand_pool_add(pool,
|
||||
rand_pool_buffer(drbg->pool),
|
||||
rand_pool_length(drbg->pool),
|
||||
rand_pool_entropy(drbg->pool));
|
||||
rand_pool_free(drbg->pool);
|
||||
drbg->pool = NULL;
|
||||
if (drbg->seed_pool != NULL) {
|
||||
pool = drbg->seed_pool;
|
||||
pool->entropy_requested = entropy;
|
||||
} else {
|
||||
pool = rand_pool_new(entropy, min_len, max_len);
|
||||
if (pool == NULL)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (drbg->parent) {
|
||||
@@ -178,6 +174,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
|
||||
prediction_resistance,
|
||||
NULL, 0) != 0)
|
||||
bytes = bytes_needed;
|
||||
drbg->reseed_next_counter
|
||||
= tsan_load(&drbg->parent->reseed_prop_counter);
|
||||
rand_drbg_unlock(drbg->parent);
|
||||
|
||||
rand_pool_add_end(pool, bytes, 8 * bytes);
|
||||
@@ -206,7 +204,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
|
||||
}
|
||||
|
||||
err:
|
||||
rand_pool_free(pool);
|
||||
if (drbg->seed_pool == NULL)
|
||||
rand_pool_free(pool);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -217,7 +216,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
|
||||
void rand_drbg_cleanup_entropy(RAND_DRBG *drbg,
|
||||
unsigned char *out, size_t outlen)
|
||||
{
|
||||
OPENSSL_secure_clear_free(out, outlen);
|
||||
if (drbg->seed_pool == NULL)
|
||||
OPENSSL_secure_clear_free(out, outlen);
|
||||
}
|
||||
|
||||
|
||||
@@ -279,14 +279,9 @@ void rand_drbg_cleanup_nonce(RAND_DRBG *drbg,
|
||||
* On success it allocates a buffer at |*pout| and returns the length of
|
||||
* the data. The buffer should get freed using OPENSSL_secure_clear_free().
|
||||
*/
|
||||
size_t rand_drbg_get_additional_data(unsigned char **pout, size_t max_len)
|
||||
size_t rand_drbg_get_additional_data(RAND_POOL *pool, unsigned char **pout)
|
||||
{
|
||||
size_t ret = 0;
|
||||
RAND_POOL *pool;
|
||||
|
||||
pool = rand_pool_new(0, 0, max_len);
|
||||
if (pool == NULL)
|
||||
return 0;
|
||||
|
||||
if (rand_pool_add_additional_data(pool) == 0)
|
||||
goto err;
|
||||
@@ -295,14 +290,12 @@ size_t rand_drbg_get_additional_data(unsigned char **pout, size_t max_len)
|
||||
*pout = rand_pool_detach(pool);
|
||||
|
||||
err:
|
||||
rand_pool_free(pool);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rand_drbg_cleanup_additional_data(unsigned char *out, size_t outlen)
|
||||
void rand_drbg_cleanup_additional_data(RAND_POOL *pool, unsigned char *out)
|
||||
{
|
||||
OPENSSL_secure_clear_free(out, outlen);
|
||||
rand_pool_reattach(pool, out);
|
||||
}
|
||||
|
||||
void rand_fork(void)
|
||||
@@ -326,13 +319,15 @@ DEFINE_RUN_ONCE_STATIC(do_rand_init)
|
||||
if (rand_nonce_lock == NULL)
|
||||
goto err2;
|
||||
|
||||
if (!rand_cleaning_up && !rand_pool_init())
|
||||
if (!rand_pool_init())
|
||||
goto err3;
|
||||
|
||||
rand_inited = 1;
|
||||
return 1;
|
||||
|
||||
err3:
|
||||
rand_pool_cleanup();
|
||||
CRYPTO_THREAD_lock_free(rand_nonce_lock);
|
||||
rand_nonce_lock = NULL;
|
||||
err2:
|
||||
CRYPTO_THREAD_lock_free(rand_meth_lock);
|
||||
rand_meth_lock = NULL;
|
||||
@@ -348,7 +343,8 @@ void rand_cleanup_int(void)
|
||||
{
|
||||
const RAND_METHOD *meth = default_RAND_meth;
|
||||
|
||||
rand_cleaning_up = 1;
|
||||
if (!rand_inited)
|
||||
return;
|
||||
|
||||
if (meth != NULL && meth->cleanup != NULL)
|
||||
meth->cleanup();
|
||||
@@ -362,6 +358,7 @@ void rand_cleanup_int(void)
|
||||
rand_meth_lock = NULL;
|
||||
CRYPTO_THREAD_lock_free(rand_nonce_lock);
|
||||
rand_nonce_lock = NULL;
|
||||
rand_inited = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -370,7 +367,8 @@ void rand_cleanup_int(void)
|
||||
*/
|
||||
void RAND_keep_random_devices_open(int keep)
|
||||
{
|
||||
rand_pool_keep_random_devices_open(keep);
|
||||
if (RUN_ONCE(&rand_init, do_rand_init))
|
||||
rand_pool_keep_random_devices_open(keep);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -405,7 +403,7 @@ int RAND_poll(void)
|
||||
/* fill random pool and seed the current legacy RNG */
|
||||
pool = rand_pool_new(RAND_DRBG_STRENGTH,
|
||||
RAND_DRBG_STRENGTH / 8,
|
||||
DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8));
|
||||
RAND_POOL_MAX_LENGTH);
|
||||
if (pool == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -430,17 +428,18 @@ err:
|
||||
* Allocate memory and initialize a new random pool
|
||||
*/
|
||||
|
||||
RAND_POOL *rand_pool_new(int entropy, size_t min_len, size_t max_len)
|
||||
RAND_POOL *rand_pool_new(int entropy_requested, size_t min_len, size_t max_len)
|
||||
{
|
||||
RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
|
||||
|
||||
if (pool == NULL) {
|
||||
RANDerr(RAND_F_RAND_POOL_NEW, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool->min_len = min_len;
|
||||
pool->max_len = max_len;
|
||||
pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ?
|
||||
RAND_POOL_MAX_LENGTH : max_len;
|
||||
|
||||
pool->buffer = OPENSSL_secure_zalloc(pool->max_len);
|
||||
if (pool->buffer == NULL) {
|
||||
@@ -448,7 +447,7 @@ RAND_POOL *rand_pool_new(int entropy, size_t min_len, size_t max_len)
|
||||
goto err;
|
||||
}
|
||||
|
||||
pool->requested_entropy = entropy;
|
||||
pool->entropy_requested = entropy_requested;
|
||||
|
||||
return pool;
|
||||
|
||||
@@ -457,6 +456,38 @@ err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach new random pool to the given buffer
|
||||
*
|
||||
* This function is intended to be used only for feeding random data
|
||||
* provided by RAND_add() and RAND_seed() into the <master> DRBG.
|
||||
*/
|
||||
RAND_POOL *rand_pool_attach(const unsigned char *buffer, size_t len,
|
||||
size_t entropy)
|
||||
{
|
||||
RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
|
||||
|
||||
if (pool == NULL) {
|
||||
RANDerr(RAND_F_RAND_POOL_ATTACH, ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The const needs to be cast away, but attached buffers will not be
|
||||
* modified (in contrary to allocated buffers which are zeroed and
|
||||
* freed in the end).
|
||||
*/
|
||||
pool->buffer = (unsigned char *) buffer;
|
||||
pool->len = len;
|
||||
|
||||
pool->attached = 1;
|
||||
|
||||
pool->min_len = pool->max_len = pool->len;
|
||||
pool->entropy = entropy;
|
||||
|
||||
return pool;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free |pool|, securely erasing its buffer.
|
||||
*/
|
||||
@@ -465,7 +496,14 @@ void rand_pool_free(RAND_POOL *pool)
|
||||
if (pool == NULL)
|
||||
return;
|
||||
|
||||
OPENSSL_secure_clear_free(pool->buffer, pool->max_len);
|
||||
/*
|
||||
* Although it would be advisable from a cryptographical viewpoint,
|
||||
* we are not allowed to clear attached buffers, since they are passed
|
||||
* to rand_pool_attach() as `const unsigned char*`.
|
||||
* (see corresponding comment in rand_pool_attach()).
|
||||
*/
|
||||
if (!pool->attached)
|
||||
OPENSSL_secure_clear_free(pool->buffer, pool->max_len);
|
||||
OPENSSL_free(pool);
|
||||
}
|
||||
|
||||
@@ -496,15 +534,27 @@ size_t rand_pool_length(RAND_POOL *pool)
|
||||
/*
|
||||
* Detach the |pool| buffer and return it to the caller.
|
||||
* It's the responsibility of the caller to free the buffer
|
||||
* using OPENSSL_secure_clear_free().
|
||||
* using OPENSSL_secure_clear_free() or to re-attach it
|
||||
* again to the pool using rand_pool_reattach().
|
||||
*/
|
||||
unsigned char *rand_pool_detach(RAND_POOL *pool)
|
||||
{
|
||||
unsigned char *ret = pool->buffer;
|
||||
pool->buffer = NULL;
|
||||
pool->entropy = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-attach the |pool| buffer. It is only allowed to pass
|
||||
* the |buffer| which was previously detached from the same pool.
|
||||
*/
|
||||
void rand_pool_reattach(RAND_POOL *pool, unsigned char *buffer)
|
||||
{
|
||||
pool->buffer = buffer;
|
||||
OPENSSL_cleanse(pool->buffer, pool->len);
|
||||
pool->len = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If |entropy_factor| bits contain 1 bit of entropy, how many bytes does one
|
||||
@@ -524,7 +574,7 @@ unsigned char *rand_pool_detach(RAND_POOL *pool)
|
||||
*/
|
||||
size_t rand_pool_entropy_available(RAND_POOL *pool)
|
||||
{
|
||||
if (pool->entropy < pool->requested_entropy)
|
||||
if (pool->entropy < pool->entropy_requested)
|
||||
return 0;
|
||||
|
||||
if (pool->len < pool->min_len)
|
||||
@@ -540,8 +590,8 @@ size_t rand_pool_entropy_available(RAND_POOL *pool)
|
||||
|
||||
size_t rand_pool_entropy_needed(RAND_POOL *pool)
|
||||
{
|
||||
if (pool->entropy < pool->requested_entropy)
|
||||
return pool->requested_entropy - pool->entropy;
|
||||
if (pool->entropy < pool->entropy_requested)
|
||||
return pool->entropy_requested - pool->entropy;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -601,6 +651,11 @@ int rand_pool_add(RAND_POOL *pool,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pool->buffer == NULL) {
|
||||
RANDerr(RAND_F_RAND_POOL_ADD, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (len > 0) {
|
||||
memcpy(pool->buffer + pool->len, buffer, len);
|
||||
pool->len += len;
|
||||
@@ -632,6 +687,11 @@ unsigned char *rand_pool_add_begin(RAND_POOL *pool, size_t len)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pool->buffer == NULL) {
|
||||
RANDerr(RAND_F_RAND_POOL_ADD_BEGIN, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return pool->buffer + pool->len;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,17 @@ static uint64_t get_timer_bits(void);
|
||||
# endif
|
||||
#endif /* defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__) */
|
||||
|
||||
#if defined(OPENSSL_RAND_SEED_NONE)
|
||||
/* none means none. this simplifies the following logic */
|
||||
# undef OPENSSL_RAND_SEED_OS
|
||||
# undef OPENSSL_RAND_SEED_GETRANDOM
|
||||
# undef OPENSSL_RAND_SEED_LIBRANDOM
|
||||
# undef OPENSSL_RAND_SEED_DEVRANDOM
|
||||
# undef OPENSSL_RAND_SEED_RDTSC
|
||||
# undef OPENSSL_RAND_SEED_RDCPU
|
||||
# undef OPENSSL_RAND_SEED_EGD
|
||||
#endif
|
||||
|
||||
#if (defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)) && \
|
||||
!defined(OPENSSL_RAND_SEED_NONE)
|
||||
# error "UEFI and VXWorks only support seeding NONE"
|
||||
@@ -86,8 +97,6 @@ static uint64_t get_timer_bits(void);
|
||||
|| defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_VXWORKS) \
|
||||
|| defined(OPENSSL_SYS_UEFI))
|
||||
|
||||
static ssize_t syscall_random(void *buf, size_t buflen);
|
||||
|
||||
# if defined(OPENSSL_SYS_VOS)
|
||||
|
||||
# ifndef OPENSSL_RAND_SEED_OS
|
||||
@@ -244,6 +253,7 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
|
||||
}
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_RAND_SEED_GETRANDOM)
|
||||
/*
|
||||
* syscall_random(): Try to get random data using a system call
|
||||
* returns the number of bytes returned in buf, or < 0 on error.
|
||||
@@ -254,7 +264,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
|
||||
* Note: 'buflen' equals the size of the buffer which is used by the
|
||||
* get_entropy() callback of the RAND_DRBG. It is roughly bounded by
|
||||
*
|
||||
* 2 * DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^13
|
||||
* 2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
|
||||
*
|
||||
* which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
|
||||
* between size_t and ssize_t is safe even without a range check.
|
||||
@@ -302,8 +312,9 @@ static ssize_t syscall_random(void *buf, size_t buflen)
|
||||
return -1;
|
||||
# endif
|
||||
}
|
||||
# endif /* defined(OPENSSL_RAND_SEED_GETRANDOM) */
|
||||
|
||||
#if !defined(OPENSSL_RAND_SEED_NONE) && defined(OPENSSL_RAND_SEED_DEVRANDOM)
|
||||
# if defined(OPENSSL_RAND_SEED_DEVRANDOM)
|
||||
static const char *random_device_paths[] = { DEVRANDOM };
|
||||
static struct random_device {
|
||||
int fd;
|
||||
@@ -375,21 +386,13 @@ static void close_random_device(size_t n)
|
||||
rd->fd = -1;
|
||||
}
|
||||
|
||||
static void open_random_devices(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < OSSL_NELEM(random_devices); i++)
|
||||
(void)get_random_device(i);
|
||||
}
|
||||
|
||||
int rand_pool_init(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < OSSL_NELEM(random_devices); i++)
|
||||
random_devices[i].fd = -1;
|
||||
open_random_devices();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -403,16 +406,13 @@ void rand_pool_cleanup(void)
|
||||
|
||||
void rand_pool_keep_random_devices_open(int keep)
|
||||
{
|
||||
if (keep)
|
||||
open_random_devices();
|
||||
else
|
||||
if (!keep)
|
||||
rand_pool_cleanup();
|
||||
|
||||
keep_random_devices_open = keep;
|
||||
}
|
||||
|
||||
# else /* defined(OPENSSL_RAND_SEED_NONE)
|
||||
* || !defined(OPENSSL_RAND_SEED_DEVRANDOM)
|
||||
*/
|
||||
# else /* !defined(OPENSSL_RAND_SEED_DEVRANDOM) */
|
||||
|
||||
int rand_pool_init(void)
|
||||
{
|
||||
@@ -427,9 +427,7 @@ void rand_pool_keep_random_devices_open(int keep)
|
||||
{
|
||||
}
|
||||
|
||||
# endif /* !defined(OPENSSL_RAND_SEED_NONE)
|
||||
* && defined(OPENSSL_RAND_SEED_DEVRANDOM)
|
||||
*/
|
||||
# endif /* defined(OPENSSL_RAND_SEED_DEVRANDOM) */
|
||||
|
||||
/*
|
||||
* Try the various seeding methods in turn, exit when successful.
|
||||
@@ -450,14 +448,14 @@ void rand_pool_keep_random_devices_open(int keep)
|
||||
*/
|
||||
size_t rand_pool_acquire_entropy(RAND_POOL *pool)
|
||||
{
|
||||
# ifdef OPENSSL_RAND_SEED_NONE
|
||||
# if defined(OPENSSL_RAND_SEED_NONE)
|
||||
return rand_pool_entropy_available(pool);
|
||||
# else
|
||||
size_t bytes_needed;
|
||||
size_t entropy_available = 0;
|
||||
unsigned char *buffer;
|
||||
|
||||
# ifdef OPENSSL_RAND_SEED_GETRANDOM
|
||||
# if defined(OPENSSL_RAND_SEED_GETRANDOM)
|
||||
{
|
||||
ssize_t bytes;
|
||||
/* Maximum allowed number of consecutive unsuccessful attempts */
|
||||
@@ -487,7 +485,7 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_RAND_SEED_DEVRANDOM
|
||||
# if defined(OPENSSL_RAND_SEED_DEVRANDOM)
|
||||
bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
|
||||
{
|
||||
size_t i;
|
||||
@@ -524,19 +522,19 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_RAND_SEED_RDTSC
|
||||
# if defined(OPENSSL_RAND_SEED_RDTSC)
|
||||
entropy_available = rand_acquire_entropy_from_tsc(pool);
|
||||
if (entropy_available > 0)
|
||||
return entropy_available;
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_RAND_SEED_RDCPU
|
||||
# if defined(OPENSSL_RAND_SEED_RDCPU)
|
||||
entropy_available = rand_acquire_entropy_from_cpu(pool);
|
||||
if (entropy_available > 0)
|
||||
return entropy_available;
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_RAND_SEED_EGD
|
||||
# if defined(OPENSSL_RAND_SEED_EGD)
|
||||
bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
|
||||
if (bytes_needed > 0) {
|
||||
static const char *paths[] = { DEVRANDOM_EGD, NULL };
|
||||
@@ -577,7 +575,7 @@ int rand_pool_add_nonce_data(RAND_POOL *pool)
|
||||
|
||||
/*
|
||||
* Add process id, thread id, and a high resolution timestamp to
|
||||
* ensure that the nonce is unique whith high probability for
|
||||
* ensure that the nonce is unique with high probability for
|
||||
* different process instances.
|
||||
*/
|
||||
data.pid = getpid();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/rand_drbg.h>
|
||||
#include <openssl/buffer.h>
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
@@ -48,7 +49,7 @@
|
||||
# define S_ISREG(m) ((m) & S_IFREG)
|
||||
# endif
|
||||
|
||||
#define RAND_FILE_SIZE 1024
|
||||
#define RAND_BUF_SIZE 1024
|
||||
#define RFILE ".rnd"
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
@@ -74,7 +75,16 @@ static __FILE_ptr32 (*const vms_fopen)(const char *, const char *, ...) =
|
||||
*/
|
||||
int RAND_load_file(const char *file, long bytes)
|
||||
{
|
||||
unsigned char buf[RAND_FILE_SIZE];
|
||||
/*
|
||||
* The load buffer size exceeds the chunk size by the comfortable amount
|
||||
* of 'RAND_DRBG_STRENGTH' bytes (not bits!). This is done on purpose
|
||||
* to avoid calling RAND_add() with a small final chunk. Instead, such
|
||||
* a small final chunk will be added together with the previous chunk
|
||||
* (unless it's the only one).
|
||||
*/
|
||||
#define RAND_LOAD_BUF_SIZE (RAND_BUF_SIZE + RAND_DRBG_STRENGTH)
|
||||
unsigned char buf[RAND_LOAD_BUF_SIZE];
|
||||
|
||||
#ifndef OPENSSL_NO_POSIX_IO
|
||||
struct stat sb;
|
||||
#endif
|
||||
@@ -98,8 +108,12 @@ int RAND_load_file(const char *file, long bytes)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!S_ISREG(sb.st_mode) && bytes < 0)
|
||||
bytes = 256;
|
||||
if (bytes < 0) {
|
||||
if (S_ISREG(sb.st_mode))
|
||||
bytes = sb.st_size;
|
||||
else
|
||||
bytes = RAND_DRBG_STRENGTH;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* On VMS, setbuf() will only take 32-bit pointers, and a compilation
|
||||
@@ -124,9 +138,9 @@ int RAND_load_file(const char *file, long bytes)
|
||||
|
||||
for ( ; ; ) {
|
||||
if (bytes > 0)
|
||||
n = (bytes < RAND_FILE_SIZE) ? (int)bytes : RAND_FILE_SIZE;
|
||||
n = (bytes <= RAND_LOAD_BUF_SIZE) ? (int)bytes : RAND_BUF_SIZE;
|
||||
else
|
||||
n = RAND_FILE_SIZE;
|
||||
n = RAND_LOAD_BUF_SIZE;
|
||||
i = fread(buf, 1, n, in);
|
||||
#ifdef EINTR
|
||||
if (ferror(in) && errno == EINTR){
|
||||
@@ -148,12 +162,18 @@ int RAND_load_file(const char *file, long bytes)
|
||||
|
||||
OPENSSL_cleanse(buf, sizeof(buf));
|
||||
fclose(in);
|
||||
if (!RAND_status()) {
|
||||
RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_RESEED_ERROR);
|
||||
ERR_add_error_data(2, "Filename=", file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int RAND_write_file(const char *file)
|
||||
{
|
||||
unsigned char buf[RAND_FILE_SIZE];
|
||||
unsigned char buf[RAND_BUF_SIZE];
|
||||
int ret = -1;
|
||||
FILE *out = NULL;
|
||||
#ifndef OPENSSL_NO_POSIX_IO
|
||||
@@ -222,9 +242,9 @@ int RAND_write_file(const char *file)
|
||||
chmod(file, 0600);
|
||||
#endif
|
||||
|
||||
ret = fwrite(buf, 1, RAND_FILE_SIZE, out);
|
||||
ret = fwrite(buf, 1, RAND_BUF_SIZE, out);
|
||||
fclose(out);
|
||||
OPENSSL_cleanse(buf, RAND_FILE_SIZE);
|
||||
OPENSSL_cleanse(buf, RAND_BUF_SIZE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -262,11 +282,9 @@ const char *RAND_file_name(char *buf, size_t size)
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (OPENSSL_issetugid() != 0) {
|
||||
if ((s = ossl_safe_getenv("RANDFILE")) == NULL || *s == '\0') {
|
||||
use_randfile = 0;
|
||||
} else if ((s = getenv("RANDFILE")) == NULL || *s == '\0') {
|
||||
use_randfile = 0;
|
||||
s = getenv("HOME");
|
||||
s = ossl_safe_getenv("HOME");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@ void RSA_free(RSA *r)
|
||||
|
||||
CRYPTO_THREAD_lock_free(r->lock);
|
||||
|
||||
BN_clear_free(r->n);
|
||||
BN_clear_free(r->e);
|
||||
BN_free(r->n);
|
||||
BN_free(r->e);
|
||||
BN_clear_free(r->d);
|
||||
BN_clear_free(r->p);
|
||||
BN_clear_free(r->q);
|
||||
@@ -196,7 +196,7 @@ int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
|
||||
r->e = e;
|
||||
}
|
||||
if (d != NULL) {
|
||||
BN_free(r->d);
|
||||
BN_clear_free(r->d);
|
||||
r->d = d;
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
|
||||
return 0;
|
||||
|
||||
if (p != NULL) {
|
||||
BN_free(r->p);
|
||||
BN_clear_free(r->p);
|
||||
r->p = p;
|
||||
}
|
||||
if (q != NULL) {
|
||||
BN_free(r->q);
|
||||
BN_clear_free(r->q);
|
||||
r->q = q;
|
||||
}
|
||||
|
||||
@@ -235,15 +235,15 @@ int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
|
||||
return 0;
|
||||
|
||||
if (dmp1 != NULL) {
|
||||
BN_free(r->dmp1);
|
||||
BN_clear_free(r->dmp1);
|
||||
r->dmp1 = dmp1;
|
||||
}
|
||||
if (dmq1 != NULL) {
|
||||
BN_free(r->dmq1);
|
||||
BN_clear_free(r->dmq1);
|
||||
r->dmq1 = dmq1;
|
||||
}
|
||||
if (iqmp != NULL) {
|
||||
BN_free(r->iqmp);
|
||||
BN_clear_free(r->iqmp);
|
||||
r->iqmp = iqmp;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 1067 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user