Compare commits

...
67 Commits
Author SHA1 Message Date
Dag-Erling Smørgrav d43c54ae9f [SA-14:31] Fix multiple vulnerabilities in NTP suite.
[EN-14:13] Fix directory deletion issue in freebsd-update.

Approved by:	so
2014-12-23 22:53:44 +00:00
Xin LI 88fb734f8b Fix multiple vulnerabilities in file(1) and libmagic(3).
Security:	FreeBSD-SA-14:28.file
Security:	CVE-2014-3710, CVE-2014-8116, CVE-2014-8117

Fix BIND remote denial of service vulnerability.

Security:	FreeBSD-SA-14:29.bind
Security:	CVE-2014-8500

Approved by:	so
2014-12-10 08:36:40 +00:00
Dag-Erling Smørgrav 2a56e89a9f [SA-14:24] Fix denial of service attack against sshd(8).
[SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2).
[SA-14:26] Fix remote command execution in ftp(1).
[EN-14:12] Fix NFSv4 and ZFS cache consistency issue.

Approved by:	so (des)
2014-11-04 23:33:17 +00:00
Xin LI bc81f300cf Time zone data file update. [EN-14:10]
Approved by:	so
2014-10-21 23:52:25 +00:00
Xin LI 43acc7feb9 Fix rtsold(8) remote buffer overflow vulnerability. [SA-14:20]
Fix routed(8) remote denial of service vulnerability. [SA-14:21]

Fix memory leak in sandboxed namei lookup. [SA-14:22]

Fix OpenSSL multiple vulnerabilities. [SA-14:23]

Approved by:	so
2014-10-21 20:21:10 +00:00
Xin LI 9222825f71 Fix Denial of Service in TCP packet processing.
Security:	FreeBSD-SA-14:19.tcp
Approved by:	so
2014-09-16 09:50:19 +00:00
Xin LI f9a8794cd7 Fix multiple OpenSSL vulnerabilities:
The receipt of a specifically crafted DTLS handshake message may cause OpenSSL
to consume large amounts of memory. [CVE-2014-3506]

The receipt of a specifically crafted DTLS packet could cause OpenSSL to leak
memory. [CVE-2014-3507]

A flaw in OBJ_obj2txt may cause pretty printing functions such as
X509_name_oneline, X509_name_print_ex et al. to leak some information from
the stack. [CVE-2014-3508]

OpenSSL DTLS clients enabling anonymous (EC)DH ciphersuites are subject to
a denial of service attack. [CVE-2014-3510]

Security:	CVE-2014-3506, CVE-2014-3507, CVE-2014-3508, CVE-2014-3510
Security:	FreeBSD-SA-14:18.openssl
Approved by:	so
2014-09-09 10:13:46 +00:00
Xin LI 62207e13d2 Fix kernel memory disclosure in control message and SCTP notifications.
Security:	FreeBSD-SA-14:17.kmem
Security:	CVE-2014-3952, CVE-2014-3953
Approved by:	so
2014-07-08 21:55:27 +00:00
Xin LI 6c6b6a81fa Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:16]

Fix gss_pseudo_random interoperability issue. [EN-14:08]

Security:	CVE-2013-7345, CVE-2014-1943, CVE-2014-2270
Security:	FreeBSD-SA-14:16.file
Approved by:	so
2014-06-24 19:05:36 +00:00
Xin LI c32dc90b68 Fix OpenSSL multiple vulnerabilities.
Security:	CVE-2014-0195, CVE-2014-0221, CVE-2014-0224,
		CVE-2014-3470
Security:	SA-14:14.openssl
Approved by:	so
2014-06-05 12:33:23 +00:00
Xin LI a6ea1ee55e Fix sendmail improper close-on-exec flag handling. [SA-14:11]
Fix ktrace memory disclosure. [SA-14:12]

Fix incorrect error handling in PAM policy parser. [SA-14:13]

Fix triple-fault when executing from a threaded process. [EN-14:06]

Approved by:	so
2014-06-03 19:03:11 +00:00
Xin LI e47ad747aa Add pkg bootstrapping, configuration and public keys. [EN-14:03]
Improve build repeatability for kldxref(8). [EN-14:04]
Fix data corruption with ciss(4). [EN-14:05]

Approved by:	so
2014-05-13 23:24:14 +00:00
Xin LI ba35611acd Fix TCP reassembly vulnerability.
Security:	FreeBSD-SA-14:08.tcp
Security:	CVE-2014-3000
Approved by:	so
2014-04-30 04:05:47 +00:00
Xin LI f560df8088 Fix NFS deadlock vulnerability. [SA-14:05]
Fix ECDSA Cache Side-channel Attack in OpenSSL. [SA-14:06]

Approved by:    so
2014-04-08 23:16:05 +00:00
Xin LI 2a3fdf3af1 Fix bsnmpd remote denial of service vulnerability. [SA-14:01]
Fix ntpd distributed reflection Denial of Service vulnerability.
[SA-14:02]

Fix BIND remote denial of service vulnerability. [SA-14:04]

Disable hardware RNGs by default. [EN-14:01]

Fix incorrect coalescing of stack entry with mmap. [EN-14:02]

Approved by:	so
2014-01-14 19:42:28 +00:00
Xin LI 05737dbd6f MFC r257879:
Fix typo in r256646: We want to generate lists of directories in
INDEX-OLD and INDEX-NEW and compare them, not generate the same
list of directories from INDEX-OLD twice...

Pointy hats to: cperciva & everybody who didn't proofread
		EN-13:04 enough
Errata Notice:	FreeBSD-EN-13:05.freebsd-update
Approved by:	so
2013-11-28 22:12:48 +00:00
Xin LI de9a4a2c11 MFC r256646, r256767, r257038:
When installing updates, install new directories first and remove old
  directories last.

  Allow ~ in file names so libtool droppings in contrib don't break updates.
  It has happened twice now, and is likely to happen again.

  Be more selective when filtering for lib*.so.N files.  These are deleted
  at the end of the upgrade process, after warning users to upgrade any
  3rd party software (e.g., from the ports tree) which might link to the
  libraries being removed.

Errata Notice:  FreeBSD-EN-13:04.freebsd-update
Approved by:	so
2013-10-26 20:01:00 +00:00
Glen Barber 335d6b4a0e Update releng/9.2 to -RELEASE status as part of the 9.2-RELEASE
process.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-09-26 18:10:19 +00:00
Glen Barber f6587d9d67 Bump entity versions.
Approved by:	re (implicit)
2013-09-26 16:07:30 +00:00
Glen Barber d0673efba0 Trim the release notes article to the basics, purely for inclusion
in the release build.  The release notes will be updated on the
website as normal.

Discussed with:	hrs
Approved by:	re (implicit)
2013-09-26 15:46:32 +00:00
Glen Barber 0374e3a7f9 - Bump Copyright year
- Trim old entries from releng/9.1

Approved by:	re (implicit)
2013-09-26 15:17:49 +00:00
Glen Barber 9dfe4a21ce - Bump Copyright year
Approved by:	re (implicit)
2013-09-26 14:41:53 +00:00
Glen Barber 946b6deb59 - Bump Copyright year
- Trim old entries from releng/9.1
- Update URLs for 9.2 where needed
- Note CVS/cvsup are not supported methods to update src/

Approved by:	re (implicit)
2013-09-26 14:39:13 +00:00
Glen Barber 13a47ca36a - Bump Copyright year
- Trim old entries from the releng/9.1 branch

Approved by:	re (implicit)
2013-09-26 14:30:02 +00:00
Glen Barber b4b943f46f Update releng/9.2 to -RC4.
Approved by:	re (implicit)
2013-09-11 00:42:50 +00:00
Glen Barber 6d9936ffaf Reintegrate r250907 (previously reverted as r254754) plus MFS r254947,
r255443:

r250907 (scottl):
  MFC r248830, r250027, r250409: Several fixes and improvements
  to sendfile()

r254947 (kib):
  NFS implementation of VOP_READ() sometimes upgrades the vnode lock,
  which causes drop of the shared lock and sleep for exclusive.  As
  result, busying of the page before the call to vn_rdwr() makes NFS
  code to wait for vnode lock while page is busy, which contradicts the
  proper order of vnode lock -> busy.

r255443 (des):
  Fix the length calculation for the final block of a sendfile(2)
  transmission which could be tricked into rounding up to the nearest
  page size, leaking up to a page of kernel memory.  [13:11]

Approved by:	re (delphij)
Sponsored by:	The FreeBSD Foundation
2013-09-10 19:00:32 +00:00
Dag-Erling Smørgrav e2630701b4 In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
and SIOCSIFNETMASK at the socket layer rather than pass them on to the
link layer without validation or credential checks.  [SA-13:12]

Prevent cross-mount hardlinks between different nullfs mounts of the
same underlying filesystem.  [SA-13:13]

Security:	CVE-2013-5691
Security:	FreeBSD-SA-13:12.ifioctl
Security:	CVE-2013-5710
Security:	FreeBSD-SA-13:13.nullfs
Approved by:	re
2013-09-10 10:08:20 +00:00
Xin LI 44f4d2208a MFS r255435: MFC r255320:
Return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.

Approved by:	re (hrs)
2013-09-10 01:38:41 +00:00
Dag-Erling Smørgrav adf82fbc25 MFH (r255243): create /var/authpf with correct ownership and permissions.
Approved by:	re (glebius)
2013-09-08 19:29:45 +00:00
Dag-Erling Smørgrav 47da79014e MFH (r254684, r254955): fix segfault on reload.
MFH (r255156): silence an error message on non-IPv6 interfaces.

Approved by:    re (glebius)
2013-09-08 18:27:26 +00:00
Dimitry Andric 1c1f9c5f39 MFS9 r255306:
MFC r245428:

Add CLOCK_PROCESS_CPUTIME_ID to <time.h>, to synchronize the CLOCK_*
values with those in <sys/time.h>.  Otherwise, if a program includes
<time.h> before <sys/time.h>, the CLOCK_PROCESS_CPUTIME_ID macro never
gets defined.

Reviewed by:	davidxu
Approved by:	re (kib)
2013-09-06 15:38:40 +00:00
Kirk McKusick d15fba2690 MFS of 255104:
MFC of 253998:

This bug fix is in a code path in rename taken when there is a
collision between a rename and an open system call for the same
target file. Here, rename releases its vnode references, waits for
the open to finish, and then restarts by reacquiring its needed
vnode locks. In this case, rename was unlocking but failing to
release its reference to one of its held vnodes. The effect was
that even after all the actual references to the vnode had gone,
the vnode still showed active references. For files that had been
removed, their space was not reclaimed until the filesystem was
forcibly unmounted.

This bug manifested itself in the Postgres server which would
leak/lose hundreds of files per day amounting to many gigabytes of
disk space. This bug required shutting down Postgres, forcibly
unmounting its filesystem, remounting its filesystem and restarting
Postgres every few days to recover the lost space.

Reported by: Dan Thomas and Palle Girgensohn
Bug-fix by:  kib
Tested by:   Dan Thomas and Palle Girgensohn

Approved by: re@ (Marius Strobl <[email protected]>)
2013-09-05 04:00:48 +00:00
Glen Barber 11720a8fdf Reduce the disc1.iso image size by setting WITHOUT_CLANG=1 for the
'system' target.  Since clang is not enabled by default for releng/9.2,
this has no user visible changes by default.

This brings 9.2-R* well enough below the 700MB mark so that we do not
need to be concerned with it fitting on standard CD-ROM medium.

This is a direct commit to releng/9.2, pending further review for head/
and stable/9/.

Discussed with:	delphij, hrs
Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2013-09-04 18:20:24 +00:00
Devin Teske 9219231a82 MFS9 r254953, itself an MFC of r254942 and r254952:
Make alternate layout ``opt-in'' and add support for named releases.
Minor edit to version.4th(8) manual and stack-leak fixes while here.

Approved by:	re (gjb)
2013-08-29 15:29:48 +00:00
Devin Teske ab5450e01f MFS9 r254966:
Add missing mergeinfo from head for stabe/9 revisions: 252995 253168 253169

Reviewed by:	gjb
Approved by:	re (gjb)
2013-08-29 15:12:58 +00:00
Glen Barber 320598646d Update releng/9.2 to -RC3.
Approved by:	re (implicit)
2013-08-24 16:17:33 +00:00
Glen Barber a2d91af3f2 Default net.inet.tcp.experimental.initcwnd10 to 0 in releng/9.2.
Concerns have been raised regarding enabling initcwnd10 by default
in the stable/ branch, so as a cautionary measure, turn this off
for the 9.2-RELEASE.  This sysctl is still available for those
who want to enable this on their own systems.

This is a direct commit to releng/9.2.

Discussed with:	re
Approved by:	re (marius)
2013-08-24 15:09:05 +00:00
Ed Maste 7e6171d327 MFS r254728:
Pull in r182983 from upstream clang trunk:

    Fix handling of braced-init-list as reference initializer within
    aggregate initialization. Previously we would incorrectly require an
    extra set of braces around such initializers.

  Pull in r188718 from upstream clang trunk:

    Handle init lists and _Atomic fields.

    Fixes PR16931.

  These fixes are needed for the atomic_flag type to work correctly in our
  stdatomic.h.

Approved by:	re
2013-08-24 14:33:11 +00:00
Ed Maste 71e454818c MF9 r254783: Correct implementation of atomic_flag_test_and_set
Approved by:	re
2013-08-24 13:58:17 +00:00
Glen Barber b6b4f514e1 Revert r250907 from releng/9.2:
Reports of NFS deadlocks on -stable@ suggest that reverting
 this change resolves the problem.

 This is a direct reverse-merge to releng/9.2, pending further
 review and analysis on the stable/9 branch.

Approved by:	re (marius)
Discussed on:	stable
2013-08-24 00:26:15 +00:00
Xin LI bbd43032ee Fix an integer overflow in computing the size of a temporary buffer
can result in a buffer which is too small for the requested
operation.

Security:	CVE-2013-3077
Security:	FreeBSD-SA-13:09.ip_multicast
Approved by:	re (kib)
2013-08-22 00:51:43 +00:00
Jack F Vogel d94e0506bc MFC r254008,254262: Improve the MSIX setup logic, making sure the requested
number of vectors are actually obtained, and if not cleaning up before falling
back to MSI. Also make the fallback decision as early as possible.

Approved by: re
2013-08-20 17:50:30 +00:00
Glen Barber a0143f7406 MFC r254397:
Mark the makefs(8) '-p' flag as deprecated in preference for
  the '-Z' flag for compatibility with NetBSD.

Approved by:	re (rodrigc)
2013-08-20 01:14:16 +00:00
Glen Barber d103d6c74b MFC r254525:
Add entry for packages-9.2-release directory.

Approved by:	re (implicit)
2013-08-19 14:42:39 +00:00
Devin Teske 81c8b88bbb MFS9 SVN r254331:
Add optional support for default override of standard setup; but only if
corresponding functions are provided. If override function does not exist,
boot remains unmodified. This patch should not result in any changes.

This includes changes to take advantage of the new functionality.

Approved by:	re (marius)
2013-08-15 15:34:26 +00:00
Glen Barber 981363393e Update releng/9.2 to -RC2.
Approved by:	re (implicit)
2013-08-15 14:41:39 +00:00
Andrey V. Elsukov fb4e36f79b Merge r254366:
Make the check for number of entries less strict.
  Some partitioning tools can create GPT with number of entries less
  than 128.

Approved by:	re (marius)
2013-08-15 14:33:09 +00:00
Scott Long 63e0f0f0c2 Merge r254306:
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
 command register.  The lazy BAR allocation code in FreeBSD sometimes
 disables this bit when it detects a range conflict, and will re-enable
 it on demand when a driver allocates the BAR.  Thus, the bit is no longer
 a reliable indication of capability, and should not be checked.  This
 results in the elimination of a lot of code from drivers, and also gives
 the opportunity to simplify a lot of drivers to use a helper API to set
 the busmaster enable bit.

 This changes fixes some recent reports of disk controllers and their
 associated drives/enclosures disappearing during boot.

Submitted by:	jhb
Reviewed by:	jfv, marius, adrian, achim
Approved by:	re
2013-08-15 12:19:16 +00:00
Glen Barber 8a1372723b MFC r254265:
Make sure bootonly.iso for -BETAs and -RCs use the releases/
 directory on the FTP mirrors to fetch distributions, since
 these are always pushed to releases/ during the release cycle.

Approved by:	re (marius)
2013-08-15 10:38:10 +00:00
Jeremie Le Hen 9d99ea26a5 MFC r253853:
Include /usr/local/etc/libmap.d/ by default.

  PR:             180568
  Reviewed by:    bapt
  Obtained from:  kib

Approved by:      re (delphij)
2013-08-15 08:12:16 +00:00
Michael Tuexen 94890e2328 MFC r254352:
Don't send uninitialized memory (two instances of 4 bytes) in
every cookie on the wire. This bug was reported in
https://bugzilla.mozilla.org/show_bug.cgi?id=905080

Approved by:	re@
2013-08-15 05:14:20 +00:00
Gregory Neil Shapiro 6ce432c79d MFC: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags
to prevent problems between the resolver and Microsoft DNS servers with
     AAAA lookups.  The upstream open source project will work on a more
     permanent fix for the next release.  Issue noted by Pavel Timofeev.

Approved by:	re (glebius)
2013-08-15 01:31:31 +00:00
Erwin Lansing 04243eb9b0 MFC 254132, 254270:
Add empty zones for Shared Address Space (RFC 6598)

Approved by:  re (glebius), delphij (mentor)
Sponsored by: DK Hostmaster A/S
2013-08-14 06:06:39 +00:00
Devin Teske 84f0eb3005 Synchronize releng/9.2 Forth code with stable/9 via MFS of 2 revisions:
First, MFS of SVN r254109: itself an MFC of 22 revisions:
227727, 233941, 235560, 238431, 241310, 241361, 241363, 241365, 241367,
241523, 242667-242669, 242923, 243114, 243660, 244048, 244089, 244158,
253715, 254105, and 254108.

This includes critical fixes that sadly should have been merged prior.
Namely, SVN r244158 fixes a possible regression.

Second, MFS of SVN r254146: Itself an MFC of r242688.

Approved by:	re (marius)
2013-08-12 01:21:14 +00:00
Marius Strobl 684428cf6c MFC: r254004
As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
quirk and apply it to these controllers [1]. The same problem was reported
for 2230S, in which case it wasn't actually clear whether the culprit is the
controller or the mainboard, though. In order to be on the safe side, flag
MSIs as being broken with the latter type of controller as well. Given that
these are the only reports of MSI-related breakage with aac(4) so far and
OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
family, however, it doesn't seem warranted to generally disable the use of
MSIs in aac(4).
While at it, simplify the MSI allocation logic a bit; there's no need to
check for the presence of the MSI capability on our own as pci_alloc_msi(9)
will just fail when these kind of interrupts are not available.
Reported and tested by: David Boyd [1]

Approved by:	re (kib)
2013-08-09 18:57:18 +00:00
Jack F Vogel 38ce1e32a9 Automate inet option file creation for module build, change module name to
if_ixgbe, this sync's the Makefile with HEAD.

Approved by:	re
2013-08-09 16:34:12 +00:00
David Chisnall 3dc24e1188 Merge alignment fix for libcxxrt header.
Approved by:	re
2013-08-09 11:26:26 +00:00
Marcel Moolenaar 84148324bd Merge r254075 from stable/9. This fixes the ISO images.
Approved by:	re (gjb@)
2013-08-09 05:27:38 +00:00
Devin Teske 2220ad5a45 Sync-up bsdinstall(8)/bsdconfig(8) list of mirrors.
SVN r253543:
Update mirror list to more closely match
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html

SVN r253545:
Sync-up with bsdinstall(8) FTP mirrorselect changes.

SVN r253566:
Remove ftp2.tr.freebsd.org, it is out of date.

Reviewed by:	gavin
Approved by:	re (glebius)
2013-08-08 21:35:26 +00:00
Devin Teske a06d2ba7db Sync-up bsdinstall(8)/bsdconfig(8) list of mirrors.
SVN r253543:
Update mirror list to more closely match
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html

SVN r253545:
Sync-up with bsdinstall(8) FTP mirrorselect changes.

SVN r253566:
Remove ftp2.tr.freebsd.org, it is out of date.

Reviewed by:	gavin
Approved by:	re (glebius)
2013-08-08 21:33:54 +00:00
Hiroki Sato bff522ef3c MFC 253887,253977:
- Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified
  PID is valid for monitoring in FILEMON_SET_PID ioctl.

- Set the monitored PID to -1 when the process exits.

Suggested by:	jilles
Tested by:	sjg
Approved by:	re (kib)
2013-08-08 20:30:22 +00:00
Jack F Vogel f60ac5764e MFC 253176,253179: make sure the rxbuf->flags is cleared when the RX ring is reset
Approved by: re
2013-08-08 18:16:13 +00:00
Konstantin Belousov bbe825ef49 Revert the MFC of the r244237, done as r244806. There are indeed bugs
in XEN pmap.  The revert hides a panic with the cost of non-working
vfork(2), which means more obscure misbehaviour in the usermode.
Revert is only done on the stable branch to maintain the consistent
erratic behaviour.

PR:	kern/180788
Approved by:	re (marius)
2013-08-07 10:07:55 +00:00
Jack F Vogel db348f4cf2 When the igb driver is static there are cases when early interrupts occur,
resulting in a panic in refresh_mbufs, to prevent this add a check to the
interrupt handler for DRV_RUNNING.

Approved by: re
2013-08-06 21:16:00 +00:00
John Baldwin 73e24a94df MFC 253048,253423,253449,253653,253774,253785:
- Allow mlx4 devices to switch between Ethernet and Infiniband:
  - Fix sysfs attribute handling by using sysctl_handle_string() and
    properly handling trailing newlines in attribute values.
  - Remove check forbidding requests that would result in one port being
    set to Ethernet and the subsequent port being set to IB.
- Avoid trashing IP fragments by correctly managing hardware checksumming.
- Fix panics when downing or unloading the mlx4 driver.

PR:		kern/179999, kern/174213, kern/180430, kern/180791
Approved by:	re (kib)
2013-08-06 20:04:44 +00:00
Jack F Vogel 60f32d33ef MFC r253865: Fixes to RX_COPY optimization code allowing the removal of rearm_queues
routine used in the local_timer.
    r253965: Correct the queue mask bit clearing in the link irq handler.

Approved by: re
2013-08-06 17:22:06 +00:00
Glen Barber fbaf7617a1 - Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
- Update branch name to -RC1.
- Bump __FreeBSD_version.

Approved by:	kib (mentor, implicit)
Approved by:	re (implicit)
2013-08-03 12:41:21 +00:00
259 changed files with 7172 additions and 5129 deletions

No files matched your search

+124
View File
@@ -11,6 +11,130 @@ handbook:
Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running portupgrade.
20141223: p17 FreeBSD-SA-14:31.ntp
FreeBSD-EN-14:13.freebsd-update
Fix multiple vulnerabilities in NTP suite. [SA-14:31]
Fix directory deletion issue in freebsd-update. [EN-14:13]
20141210: p16 FreeBSD-SA-14:28.file
FreeBSD-SA-14:29.bind
Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:28]
Fix BIND remote denial of service vulnerability. [SA-14:29]
20141104: p15 FreeBSD-SA-14:24.sshd
FreeBSD-SA-14:25.setlogin
FreeBSD-SA-14:26.ftp
FreeBSD-EN-14:12.zfs
Fix denial of service attack against sshd(8). [SA-14:24]
Fix kernel stack disclosure in setlogin(2) / getlogin(2).
[SA-14:25]
Fix remote command execution in ftp(1). [SA-14:26]
Fix NFSv4 and ZFS cache consistency issue. [EN-14:12]
20141022: p14 FreeBSD-EN-14:10.tzdata
Time zone data file update. [EN-14:10]
20141021: p13 FreeBSD-SA-14:20.rtsold
FreeBSD-SA-14:21.routed
FreeBSD-SA-14:22.namei
FreeBSD-SA-14:23.openssl
Fix rtsold(8) remote buffer overflow vulnerability. [SA-14:20]
Fix routed(8) remote denial of service vulnerability. [SA-14:21]
Fix memory leak in sandboxed namei lookup. [SA-14:22]
Fix OpenSSL multiple vulnerabilities. [SA-14:23]
20140916: p12 FreeBSD-SA-14:19.tcp
Fix Denial of Service in TCP packet processing. [SA-14:19]
20140909: p11 FreeBSD-SA-14:18.openssl
Fix OpenSSL multiple vulnerabilities. [SA-14:18]
20140708: p10 FreeBSD-SA-14:17.kmem
Fix kernel memory disclosure in control messages and SCTP
notifications. [SA-14:17]
20140624: p9 FreeBSD-SA-14:16.file
FreeBSD-EN-14:08.heimdal
Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:16]
Fix gss_pseudo_random interoperability issue. [EN-14:08]
20140605: p8 FreeBSD-SA-14:14.openssl
Fix OpenSSL multiple vulnerabilities. [SA-14:14]
20140603: p7 FreeBSD-SA-14:11.sendmail
FreeBSD-SA-14:12.ktrace
FreeBSD-SA-14:13.pam
FreeBSD-EN-14:06.exec
Fix sendmail improper close-on-exec flag handling. [SA-14:11]
Fix ktrace memory disclosure. [SA-14:12]
Fix incorrect error handling in PAM policy parser. [SA-14:13]
Fix triple-fault when executing from a threaded process.
[EN-14:06]
20140513: p6 FreeBSD-EN-14:03.pkg
FreeBSD-EN-14:04.kldxref
FreeBSD-EN-14:05.ciss
Add pkg bootstrapping, configuration and public keys. [EN-14:03]
Improve build repeatability for kldxref(8). [EN-14:04]
Fix data corruption with ciss(4). [EN-14:05]
20140430: p5 FreeBSD-SA-14:08.tcp
Fix TCP reassembly vulnerability. [SA-14:08]
20140408: p4 FreeBSD-SA-14:05.nfsserver
FreeBSD-SA-14:06.openssl
Fix deadlock in the NFS server. [SA-14:05]
Fix for ECDSA Cache Side-channel Attack in OpenSSL. [SA-14:06]
20140114: p3 FreeBSD-SA-14:01.bsnmpd
FreeBSD-SA-14:02.ntpd
FreeBSD-SA-14:04.bind
FreeBSD-EN-14:01.random
FreeBSD-EN-14:02.mmap
Fix bsnmpd remote denial of service vulnerability. [SA-14:01]
Fix ntpd distributed reflection Denial of Service
vulnerability. [SA-14:02]
Fix BIND remote denial of service vulnerability. [SA-14:04]
Disable hardware RNGs by default. [EN-14:01]
Fix incorrect coalescing of stack entry with mmap. [EN-14:02]
20131128: p2 FreeBSD-EN-13:05.freebsd-update
Fix error in patch for FreeBSD-EN-13:04.freebsd-update.
20131026: p1 FreeBSD-EN-13:04.freebsd-update
Fix multiple freebsd-update bugs that break upgrading to
FreeBSD 10.0.
20130705:
hastctl(8)'s `status' command output changed to terse one-liner format.
Scripts using this should switch to `list' command or be rewritten.
+12
View File
@@ -1,3 +1,15 @@
4006. [security] A flaw in delegation handling could be exploited
to put named into an infinite loop. This has
been addressed by placing limits on the number
of levels of recursion named will allow (default 7),
and the number of iterative queries that it will
send (default 50) before terminating a recursive
query (CVE-2014-8500).
The recursion depth limit is configured via the
"max-recursion-depth" option, and the query limit
via the "max-recursion-queries" option. [RT #37580]
--- 9.8.4-P2 released ---
3516. [security] Removed the check for regex.h in configure in order
+2 -2
View File
@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.113.16.2 2011/02/28 01:19:58 tbox Exp $ */
/*! \file */
#include <config.h>
@@ -158,6 +156,8 @@ options {\n\
dnssec-accept-expired no;\n\
clients-per-query 10;\n\
max-clients-per-query 100;\n\
max-recursion-depth 7;\n\
max-recursion-queries 50;\n\
zero-no-soa-ttl-cache no;\n\
nsec3-test-zone no;\n\
allow-new-zones no;\n\
+15 -11
View File
@@ -3755,12 +3755,11 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
peeraddr = &client->peeraddr;
else
peeraddr = NULL;
result = dns_resolver_createfetch2(client->view->resolver,
result = dns_resolver_createfetch3(client->view->resolver,
qname, qtype, qdomain, nameservers,
NULL, peeraddr, client->message->id,
client->query.fetchoptions,
client->task,
query_resume, client,
client->query.fetchoptions, 0, NULL,
client->task, query_resume, client,
rdataset, sigrdataset,
&client->query.fetch);
@@ -5088,8 +5087,7 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
dns_fixedname_t fixed;
dns_hash_t hash;
dns_name_t name;
int order;
unsigned int count;
unsigned int skip = 0, labels;
dns_rdata_nsec3_t nsec3;
dns_rdata_t rdata = DNS_RDATA_INIT;
isc_boolean_t optout;
@@ -5102,6 +5100,7 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
dns_name_init(&name, NULL);
dns_name_clone(qname, &name);
labels = dns_name_countlabels(&name);
/*
* Map unknown algorithm to known value.
@@ -5133,13 +5132,14 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
dns_rdata_reset(&rdata);
optout = ISC_TF((nsec3.flags & DNS_NSEC3FLAG_OPTOUT) != 0);
if (found != NULL && optout &&
dns_name_fullcompare(&name, dns_db_origin(db), &order,
&count) == dns_namereln_subdomain) {
dns_name_issubdomain(&name, dns_db_origin(db)))
{
dns_rdataset_disassociate(rdataset);
if (dns_rdataset_isassociated(sigrdataset))
dns_rdataset_disassociate(sigrdataset);
count = dns_name_countlabels(&name) - 1;
dns_name_getlabelsequence(&name, 1, count, &name);
skip++;
dns_name_getlabelsequence(qname, skip, labels - skip,
&name);
ns_client_log(client, DNS_LOGCATEGORY_DNSSEC,
NS_LOGMODULE_QUERY, ISC_LOG_DEBUG(3),
"looking for closest provable encloser");
@@ -5157,7 +5157,11 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
ns_client_log(client, DNS_LOGCATEGORY_DNSSEC,
NS_LOGMODULE_QUERY, ISC_LOG_WARNING,
"expected covering NSEC3, got an exact match");
if (found != NULL)
if (found == qname) {
if (skip != 0U)
dns_name_getlabelsequence(qname, skip, labels - skip,
found);
} else if (found != NULL)
dns_name_copy(&name, found, NULL);
return;
}
+10
View File
@@ -2580,6 +2580,16 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_obj_asuint32(obj),
max_clients_per_query);
obj = NULL;
result = ns_config_get(maps, "max-recursion-depth", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setmaxdepth(view->resolver, cfg_obj_asuint32(obj));
obj = NULL;
result = ns_config_get(maps, "max-recursion-queries", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setmaxqueries(view->resolver, cfg_obj_asuint32(obj));
#ifdef ALLOW_FILTER_AAAA_ON_V4
obj = NULL;
result = ns_config_get(maps, "filter-aaaa-on-v4", &obj);
+33 -12
View File
@@ -201,6 +201,7 @@ struct dns_adbfetch {
unsigned int magic;
dns_fetch_t *fetch;
dns_rdataset_t rdataset;
unsigned int depth;
};
/*%
@@ -300,8 +301,7 @@ static inline isc_boolean_t dec_entry_refcnt(dns_adb_t *, isc_boolean_t,
static inline void violate_locking_hierarchy(isc_mutex_t *, isc_mutex_t *);
static isc_boolean_t clean_namehooks(dns_adb_t *, dns_adbnamehooklist_t *);
static void clean_target(dns_adb_t *, dns_name_t *);
static void clean_finds_at_name(dns_adbname_t *, isc_eventtype_t,
unsigned int);
static void clean_finds_at_name(dns_adbname_t *, isc_eventtype_t, unsigned int);
static isc_boolean_t check_expire_namehooks(dns_adbname_t *, isc_stdtime_t);
static isc_boolean_t check_expire_entry(dns_adb_t *, dns_adbentry_t **,
isc_stdtime_t);
@@ -309,6 +309,7 @@ static void cancel_fetches_at_name(dns_adbname_t *);
static isc_result_t dbfind_name(dns_adbname_t *, isc_stdtime_t,
dns_rdatatype_t);
static isc_result_t fetch_name(dns_adbname_t *, isc_boolean_t,
unsigned int, isc_counter_t *qc,
dns_rdatatype_t);
static inline void check_exit(dns_adb_t *);
static void destroy(dns_adb_t *);
@@ -2759,6 +2760,19 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, dns_adbfind_t **findp)
{
return (dns_adb_createfind2(adb, task, action, arg, name,
qname, qtype, options, now,
target, port, 0, NULL, findp));
}
isc_result_t
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *qname,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, unsigned int depth, isc_counter_t *qc,
dns_adbfind_t **findp)
{
dns_adbfind_t *find;
dns_adbname_t *adbname;
@@ -2990,7 +3004,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
* Start V4.
*/
if (WANT_INET(wanted_fetches) &&
fetch_name(adbname, start_at_zone,
fetch_name(adbname, start_at_zone, depth, qc,
dns_rdatatype_a) == ISC_R_SUCCESS) {
DP(DEF_LEVEL,
"dns_adb_createfind: started A fetch for name %p",
@@ -3001,7 +3015,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
* Start V6.
*/
if (WANT_INET6(wanted_fetches) &&
fetch_name(adbname, start_at_zone,
fetch_name(adbname, start_at_zone, depth, qc,
dns_rdatatype_aaaa) == ISC_R_SUCCESS) {
DP(DEF_LEVEL,
"dns_adb_createfind: "
@@ -3744,6 +3758,12 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
DP(DEF_LEVEL, "adb: fetch of '%s' %s failed: %s",
buf, address_type == DNS_ADBFIND_INET ? "A" : "AAAA",
dns_result_totext(dev->result));
/*
* Don't record a failure unless this is the initial
* fetch of a chain.
*/
if (fetch->depth > 1)
goto out;
/* XXXMLG Don't pound on bad servers. */
if (address_type == DNS_ADBFIND_INET) {
name->expire_v4 = ISC_MIN(name->expire_v4, now + 300);
@@ -3781,9 +3801,8 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
}
static isc_result_t
fetch_name(dns_adbname_t *adbname,
isc_boolean_t start_at_zone,
dns_rdatatype_t type)
fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
unsigned int depth, isc_counter_t *qc, dns_rdatatype_t type)
{
isc_result_t result;
dns_adbfetch_t *fetch = NULL;
@@ -3828,12 +3847,14 @@ fetch_name(dns_adbname_t *adbname,
result = ISC_R_NOMEMORY;
goto cleanup;
}
fetch->depth = depth;
result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
type, name, nameservers, NULL,
options, adb->task, fetch_callback,
adbname, &fetch->rdataset, NULL,
&fetch->fetch);
result = dns_resolver_createfetch3(adb->view->resolver, &adbname->name,
type, name, nameservers, NULL,
NULL, 0, options, depth, qc,
adb->task, fetch_callback, adbname,
&fetch->rdataset, NULL,
&fetch->fetch);
if (result != ISC_R_SUCCESS)
goto cleanup;
+7
View File
@@ -334,6 +334,13 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, dns_adbfind_t **find);
isc_result_t
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *qname,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target, in_port_t port,
unsigned int depth, isc_counter_t *qc,
dns_adbfind_t **find);
/*%<
* Main interface for clients. The adb will look up the name given in
* "name" and will build up a list of found addresses, and perhaps start
@@ -271,6 +271,18 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp);
isc_result_t
dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
dns_forwarders_t *forwarders,
isc_sockaddr_t *client, isc_uint16_t id,
unsigned int options, unsigned int depth,
isc_counter_t *qc, isc_task_t *task,
isc_taskaction_t action, void *arg,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp);
/*%<
* Recurse to answer a question.
*
@@ -572,6 +584,30 @@ dns_resolver_printbadcache(dns_resolver_t *resolver, FILE *fp);
* \li resolver to be valid.
*/
void
dns_resolver_setmaxdepth(dns_resolver_t *resolver, unsigned int maxdepth);
unsigned int
dns_resolver_getmaxdepth(dns_resolver_t *resolver);
/*%
* Get and set how many NS indirections will be followed when looking for
* nameserver addresses.
*
* Requires:
* \li resolver to be valid.
*/
void
dns_resolver_setmaxqueries(dns_resolver_t *resolver, unsigned int queries);
unsigned int
dns_resolver_getmaxqueries(dns_resolver_t *resolver);
/*%
* Get and set how many iterative queries will be allowed before
* terminating a recursive query.
*
* Requires:
* \li resolver to be valid.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_RESOLVER_H */
+120 -18
View File
@@ -21,6 +21,7 @@
#include <config.h>
#include <isc/counter.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/string.h>
@@ -126,6 +127,16 @@
#define MAXIMUM_QUERY_TIMEOUT 30 /* The maximum time in seconds for the whole query to live. */
#endif
/* The default maximum number of recursions to follow before giving up. */
#ifndef DEFAULT_RECURSION_DEPTH
#define DEFAULT_RECURSION_DEPTH 7
#endif
/* The default maximum number of iterative queries to allow before giving up. */
#ifndef DEFAULT_MAX_QUERIES
#define DEFAULT_MAX_QUERIES 50
#endif
/*%
* Maximum EDNS0 input packet size.
*/
@@ -227,12 +238,13 @@ struct fetchctx {
isc_sockaddrlist_t edns;
isc_sockaddrlist_t edns512;
isc_sockaddrlist_t bad_edns;
dns_validator_t *validator;
dns_validator_t * validator;
ISC_LIST(dns_validator_t) validators;
dns_db_t * cache;
dns_adb_t * adb;
isc_boolean_t ns_ttl_ok;
isc_uint32_t ns_ttl;
isc_counter_t * qc;
/*%
* The number of events we're waiting for.
@@ -300,6 +312,7 @@ struct fetchctx {
isc_boolean_t timeout;
dns_adbaddrinfo_t *addrinfo;
isc_sockaddr_t *client;
unsigned int depth;
};
#define FCTX_MAGIC ISC_MAGIC('F', '!', '!', '!')
@@ -412,6 +425,8 @@ struct dns_resolver {
isc_timer_t * spillattimer;
isc_boolean_t zero_no_soa_ttl;
unsigned int query_timeout;
unsigned int maxdepth;
unsigned int maxqueries;
/* Locked by lock. */
unsigned int references;
@@ -1569,6 +1584,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (result != ISC_R_SUCCESS)
goto cleanup_dispatch;
}
fctx->querysent++;
ISC_LIST_APPEND(fctx->queries, query, link);
@@ -2210,9 +2226,9 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
*/
INSIST(!SHUTTINGDOWN(fctx));
fctx->attributes &= ~FCTX_ATTR_ADDRWAIT;
if (event->ev_type == DNS_EVENT_ADBMOREADDRESSES)
if (event->ev_type == DNS_EVENT_ADBMOREADDRESSES) {
want_try = ISC_TRUE;
else {
} else {
fctx->findfail++;
if (fctx->pending == 0) {
/*
@@ -2241,7 +2257,7 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
else if (want_done)
fctx_done(fctx, ISC_R_FAILURE, __LINE__);
else if (destroy) {
fctx_destroy(fctx);
fctx_destroy(fctx);
if (bucket_empty)
empty_bucket(res);
}
@@ -2495,12 +2511,13 @@ findname(fetchctx_t *fctx, dns_name_t *name, in_port_t port,
* See what we know about this address.
*/
find = NULL;
result = dns_adb_createfind(fctx->adb,
res->buckets[fctx->bucketnum].task,
fctx_finddone, fctx, name,
&fctx->name, fctx->type,
options, now, NULL,
res->view->dstport, &find);
result = dns_adb_createfind2(fctx->adb,
res->buckets[fctx->bucketnum].task,
fctx_finddone, fctx, name,
&fctx->name, fctx->type,
options, now, NULL,
res->view->dstport,
fctx->depth + 1, fctx->qc, &find);
if (result != ISC_R_SUCCESS) {
if (result == DNS_R_ALIAS) {
/*
@@ -2608,6 +2625,14 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
res = fctx->res;
if (fctx->depth > res->maxdepth) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
"too much NS indirection resolving '%s'",
fctx->info);
return (DNS_R_SERVFAIL);
}
/*
* Forwarders.
*/
@@ -3083,6 +3108,16 @@ fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache) {
}
}
result = isc_counter_increment(fctx->qc);
if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
"exceeded max queries resolving '%s'",
fctx->info);
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
return;
}
result = fctx_query(fctx, addrinfo, fctx->options);
if (result != ISC_R_SUCCESS)
fctx_done(fctx, result, __LINE__);
@@ -3181,6 +3216,7 @@ fctx_destroy(fetchctx_t *fctx) {
isc_mem_put(fctx->mctx, sa, sizeof(*sa));
}
isc_counter_detach(&fctx->qc);
isc_timer_detach(&fctx->timer);
dns_message_destroy(&fctx->rmessage);
dns_message_destroy(&fctx->qmessage);
@@ -3509,7 +3545,8 @@ log_ns_ttl(fetchctx_t *fctx, const char *where) {
static isc_result_t
fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
unsigned int options, unsigned int bucketnum, unsigned int depth,
isc_counter_t *qc, fetchctx_t **fctxp)
{
fetchctx_t *fctx;
isc_result_t result;
@@ -3531,6 +3568,21 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx = isc_mem_get(mctx, sizeof(*fctx));
if (fctx == NULL)
return (ISC_R_NOMEMORY);
fctx->qc = NULL;
if (qc != NULL) {
isc_counter_attach(qc, &fctx->qc);
} else {
result = isc_counter_create(res->mctx,
res->maxqueries, &fctx->qc);
if (result != ISC_R_SUCCESS)
goto cleanup_fetch;
}
/*
* Make fctx->info point to a copy of a formatted string
* "name/type".
*/
dns_name_format(name, buf, sizeof(buf));
dns_rdatatype_format(type, typebuf, sizeof(typebuf));
strcat(buf, "/"); /* checked */
@@ -3538,7 +3590,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx->info = isc_mem_strdup(mctx, buf);
if (fctx->info == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup_fetch;
goto cleanup_counter;
}
FCTXTRACE("create");
dns_name_init(&fctx->name, NULL);
@@ -3561,6 +3613,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx->state = fetchstate_init;
fctx->want_shutdown = ISC_FALSE;
fctx->cloned = ISC_FALSE;
fctx->depth = depth;
ISC_LIST_INIT(fctx->queries);
ISC_LIST_INIT(fctx->finds);
ISC_LIST_INIT(fctx->altfinds);
@@ -3766,6 +3819,9 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
cleanup_info:
isc_mem_free(mctx, fctx->info);
cleanup_counter:
isc_counter_detach(&fctx->qc);
cleanup_fetch:
isc_mem_put(mctx, fctx, sizeof(*fctx));
@@ -5477,7 +5533,7 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname,
char qbuf[DNS_NAME_FORMATSIZE];
char nbuf[DNS_NAME_FORMATSIZE];
char tbuf[DNS_RDATATYPE_FORMATSIZE];
dns_rdatatype_format(fctx->type, tbuf,
dns_rdatatype_format(type, tbuf,
sizeof(tbuf));
dns_name_format(name, nbuf,
sizeof(nbuf));
@@ -5486,7 +5542,7 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname,
log_formerr(fctx,
"unrelated %s %s in "
"%s authority section",
tbuf, qbuf, nbuf);
tbuf, nbuf, qbuf);
return (DNS_R_FORMERR);
}
if (type == dns_rdatatype_ns) {
@@ -7528,6 +7584,8 @@ dns_resolver_create(dns_view_t *view,
res->query_timeout = DEFAULT_QUERY_TIMEOUT;
res->ndisps = 0;
res->nextdisp = 0; /* meaningless at this point, but init it */
res->maxdepth = DEFAULT_RECURSION_DEPTH;
res->maxqueries = DEFAULT_MAX_QUERIES;
res->nbuckets = ntasks;
res->activebuckets = ntasks;
res->buckets = isc_mem_get(view->mctx,
@@ -7967,9 +8025,9 @@ dns_resolver_createfetch(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
return (dns_resolver_createfetch2(res, name, type, domain,
return (dns_resolver_createfetch3(res, name, type, domain,
nameservers, forwarders, NULL, 0,
options, task, action, arg,
options, 0, NULL, task, action, arg,
rdataset, sigrdataset, fetchp));
}
@@ -7984,6 +8042,25 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
return (dns_resolver_createfetch3(res, name, type, domain,
nameservers, forwarders, client, id,
options, 0, NULL, task, action, arg,
rdataset, sigrdataset, fetchp));
}
isc_result_t
dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
dns_forwarders_t *forwarders,
isc_sockaddr_t *client, dns_messageid_t id,
unsigned int options, unsigned int depth,
isc_counter_t *qc, isc_task_t *task,
isc_taskaction_t action, void *arg,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
dns_fetch_t *fetch;
fetchctx_t *fctx = NULL;
@@ -8071,11 +8148,12 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
if (fctx == NULL) {
result = fctx_create(res, name, type, domain, nameservers,
options, bucketnum, &fctx);
options, bucketnum, depth, qc, &fctx);
if (result != ISC_R_SUCCESS)
goto unlock;
new_fctx = ISC_TRUE;
}
} else if (fctx->depth > depth)
fctx->depth = depth;
result = fctx_join(fctx, task, client, id, action, arg,
rdataset, sigrdataset, fetch);
@@ -8847,3 +8925,27 @@ dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds) {
resolver->query_timeout = seconds;
}
void
dns_resolver_setmaxdepth(dns_resolver_t *resolver, unsigned int maxdepth) {
REQUIRE(VALID_RESOLVER(resolver));
resolver->maxdepth = maxdepth;
}
unsigned int
dns_resolver_getmaxdepth(dns_resolver_t *resolver) {
REQUIRE(VALID_RESOLVER(resolver));
return (resolver->maxdepth);
}
void
dns_resolver_setmaxqueries(dns_resolver_t *resolver, unsigned int queries) {
REQUIRE(VALID_RESOLVER(resolver));
resolver->maxqueries = queries;
}
unsigned int
dns_resolver_getmaxqueries(dns_resolver_t *resolver) {
REQUIRE(VALID_RESOLVER(resolver));
return (resolver->maxqueries);
}
+2 -2
View File
@@ -63,7 +63,7 @@ WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/file.@O@ \
# Alphabetically
OBJS = @ISC_EXTRA_OBJS@ \
assertions.@O@ backtrace.@O@ backtrace-emptytbl.@O@ base32.@O@ \
base64.@O@ buffer.@O@ bufferlist.@O@ \
base64.@O@ buffer.@O@ bufferlist.@O@ counter.@O@ \
error.@O@ event.@O@ \
hash.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
inet_aton.@O@ iterated_hash.@O@ lex.@O@ lfsr.@O@ log.@O@ \
@@ -86,7 +86,7 @@ ISCDRIVERSRCS = mem.c task.c lib.c timer.c heap.c
SRCS = @ISC_EXTRA_SRCS@ \
assertions.c backtrace.c backtrace-emptytbl.c base32.c \
base64.c buffer.c bufferlist.c \
base64.c buffer.c bufferlist.c counter.c \
error.c event.c \
hash.c hex.c hmacmd5.c hmacsha.c \
inet_aton.c iterated_hash.c lex.c log.c lfsr.c \
+3 -5
View File
@@ -13,8 +13,6 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id$
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@@ -53,7 +51,7 @@ WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/file.@O@ \
OBJS = @ISC_EXTRA_OBJS@ \
assertions.@O@ backtrace.@O@ base32.@O@ base64.@O@ \
bitstring.@O@ buffer.@O@ bufferlist.@O@ commandline.@O@ \
error.@O@ event.@O@ \
counter.@O@ error.@O@ event.@O@ \
hash.@O@ heap.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
httpd.@O@ inet_aton.@O@ iterated_hash.@O@ \
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
@@ -69,8 +67,8 @@ SYMTBLOBJS = backtrace-emptytbl.@O@
# Alphabetically
SRCS = @ISC_EXTRA_SRCS@ \
assertions.c backtrace.c base32.c base64.c bitstring.c \
buffer.c bufferlist.c commandline.c error.c event.c \
heap.c hex.c hmacmd5.c hmacsha.c \
buffer.c bufferlist.c commandline.c counter.c \
error.c event.c heap.c hex.c hmacmd5.c hmacsha.c \
httpd.c inet_aton.c iterated_hash.c \
lex.c lfsr.c lib.c log.c \
md5.c mem.c mutexblock.c \
+138
View File
@@ -0,0 +1,138 @@
/*
* Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*! \file */
#include <config.h>
#include <stddef.h>
#include <isc/counter.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/util.h>
#define COUNTER_MAGIC ISC_MAGIC('C', 'n', 't', 'r')
#define VALID_COUNTER(r) ISC_MAGIC_VALID(r, COUNTER_MAGIC)
struct isc_counter {
unsigned int magic;
isc_mem_t *mctx;
isc_mutex_t lock;
unsigned int references;
unsigned int limit;
unsigned int used;
};
isc_result_t
isc_counter_create(isc_mem_t *mctx, int limit, isc_counter_t **counterp) {
isc_result_t result;
isc_counter_t *counter;
REQUIRE(counterp != NULL && *counterp == NULL);
counter = isc_mem_get(mctx, sizeof(*counter));
if (counter == NULL)
return (ISC_R_NOMEMORY);
result = isc_mutex_init(&counter->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, counter, sizeof(*counter));
return (result);
}
counter->mctx = NULL;
isc_mem_attach(mctx, &counter->mctx);
counter->references = 1;
counter->limit = limit;
counter->used = 0;
counter->magic = COUNTER_MAGIC;
*counterp = counter;
return (ISC_R_SUCCESS);
}
isc_result_t
isc_counter_increment(isc_counter_t *counter) {
isc_result_t result = ISC_R_SUCCESS;
LOCK(&counter->lock);
counter->used++;
if (counter->limit != 0 && counter->used >= counter->limit)
result = ISC_R_QUOTA;
UNLOCK(&counter->lock);
return (result);
}
unsigned int
isc_counter_used(isc_counter_t *counter) {
REQUIRE(VALID_COUNTER(counter));
return (counter->used);
}
void
isc_counter_setlimit(isc_counter_t *counter, int limit) {
REQUIRE(VALID_COUNTER(counter));
LOCK(&counter->lock);
counter->limit = limit;
UNLOCK(&counter->lock);
}
void
isc_counter_attach(isc_counter_t *source, isc_counter_t **targetp) {
REQUIRE(VALID_COUNTER(source));
REQUIRE(targetp != NULL && *targetp == NULL);
LOCK(&source->lock);
source->references++;
INSIST(source->references > 0);
UNLOCK(&source->lock);
*targetp = source;
}
static void
destroy(isc_counter_t *counter) {
counter->magic = 0;
isc_mutex_destroy(&counter->lock);
isc_mem_putanddetach(&counter->mctx, counter, sizeof(*counter));
}
void
isc_counter_detach(isc_counter_t **counterp) {
isc_counter_t *counter;
isc_boolean_t want_destroy = ISC_FALSE;
REQUIRE(counterp != NULL && *counterp != NULL);
counter = *counterp;
REQUIRE(VALID_COUNTER(counter));
*counterp = NULL;
LOCK(&counter->lock);
INSIST(counter->references > 0);
counter->references--;
if (counter->references == 0)
want_destroy = ISC_TRUE;
UNLOCK(&counter->lock);
if (want_destroy)
destroy(counter);
}
@@ -13,8 +13,6 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id$
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@@ -27,7 +25,8 @@ top_srcdir = @top_srcdir@
# install target below.
#
HEADERS = app.h assertions.h base64.h bind9.h bitstring.h boolean.h \
buffer.h bufferlist.h commandline.h entropy.h error.h event.h \
buffer.h bufferlist.h \
commandline.h counter.h entropy.h error.h event.h \
eventclass.h file.h formatcheck.h fsaccess.h \
hash.h heap.h hex.h hmacmd5.h hmacsha.h \
httpd.h \
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ISC_COUNTER_H
#define ISC_COUNTER_H 1
/*****
***** Module Info
*****/
/*! \file isc/counter.h
*
* \brief The isc_counter_t object is a simplified version of the
* isc_quota_t object; it tracks the consumption of limited
* resources, returning an error condition when the quota is
* exceeded. However, unlike isc_quota_t, attaching and detaching
* from a counter object does not increment or decrement the counter.
*/
/***
*** Imports.
***/
#include <isc/lang.h>
#include <isc/mutex.h>
#include <isc/types.h>
/*****
***** Types.
*****/
ISC_LANG_BEGINDECLS
isc_result_t
isc_counter_create(isc_mem_t *mctx, int limit, isc_counter_t **counterp);
/*%<
* Allocate and initialize a counter object.
*/
isc_result_t
isc_counter_increment(isc_counter_t *counter);
/*%<
* Increment the counter.
*
* If the counter limit is nonzero and has been reached, then
* return ISC_R_QUOTA, otherwise ISC_R_SUCCESS. (The counter is
* incremented regardless of return value.)
*/
unsigned int
isc_counter_used(isc_counter_t *counter);
/*%<
* Return the current counter value.
*/
void
isc_counter_setlimit(isc_counter_t *counter, int limit);
/*%<
* Set the counter limit.
*/
void
isc_counter_attach(isc_counter_t *source, isc_counter_t **targetp);
/*%<
* Attach to a counter object, increasing its reference counter.
*/
void
isc_counter_detach(isc_counter_t **counterp);
/*%<
* Detach (and destroy if reference counter has dropped to zero)
* a counter object.
*/
ISC_LANG_ENDDECLS
#endif /* ISC_COUNTER_H */
@@ -50,6 +50,7 @@ typedef struct isc_buffer isc_buffer_t; /*%< Buffer */
typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */
typedef struct isc_constregion isc_constregion_t; /*%< Const region */
typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region */
typedef struct isc_counter isc_counter_t; /*%< Counter */
typedef struct isc_entropy isc_entropy_t; /*%< Entropy */
typedef struct isc_entropysource isc_entropysource_t; /*%< Entropy Source */
typedef struct isc_event isc_event_t; /*%< Event */
+2 -2
View File
@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id$ */
/*! \file */
#include <config.h>
@@ -1348,6 +1346,8 @@ view_clauses[] = {
{ "max-cache-ttl", &cfg_type_uint32, 0 },
{ "max-clients-per-query", &cfg_type_uint32, 0 },
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
{ "max-recursion-depth", &cfg_type_uint32, 0 },
{ "max-recursion-queries", &cfg_type_uint32, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "min-roots", &cfg_type_uint32, CFG_CLAUSEFLAG_NOTIMP },
{ "minimal-responses", &cfg_type_boolean, 0 },
+5
View File
@@ -499,6 +499,11 @@ snmp_getbulk(struct snmp_pdu *pdu, struct asn_buf *resp_b,
for (cnt = 0; cnt < pdu->error_index; cnt++) {
eomib = 1;
for (i = non_rep; i < pdu->nbindings; i++) {
if (resp->nbindings == SNMP_MAX_BINDINGS)
/* PDU is full */
goto done;
if (cnt == 0)
result = do_getnext(&context, &pdu->bindings[i],
&resp->bindings[resp->nbindings], pdu);
+2 -1
View File
@@ -49,7 +49,8 @@
!:mime text/x-awk
0 string/wt #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
0 regex =^\\s*BEGIN\\s*[{] awk script text
0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
!:strength - 12
# AT&T Bell Labs' Plan 9 shell
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
+1 -1
View File
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
(size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
rv = -1;
}
+16 -8
View File
@@ -35,10 +35,12 @@
switch (type) {
#ifdef ELFCORE
case ET_CORE:
phnum = elf_getu16(swap, elfhdr.e_phnum);
if (phnum > MAX_PHNUM)
return toomany(ms, "program", phnum);
flags |= FLAGS_IS_CORE;
if (dophn_core(ms, clazz, swap, fd,
(off_t)elf_getu(swap, elfhdr.e_phoff),
elf_getu16(swap, elfhdr.e_phnum),
(off_t)elf_getu(swap, elfhdr.e_phoff), phnum,
(size_t)elf_getu16(swap, elfhdr.e_phentsize),
fsize, &flags) == -1)
return -1;
@@ -46,18 +48,24 @@
#endif
case ET_EXEC:
case ET_DYN:
phnum = elf_getu16(swap, elfhdr.e_phnum);
if (phnum > MAX_PHNUM)
return toomany(ms, "program", phnum);
shnum = elf_getu16(swap, elfhdr.e_shnum);
if (shnum > MAX_SHNUM)
return toomany(ms, "section", shnum);
if (dophn_exec(ms, clazz, swap, fd,
(off_t)elf_getu(swap, elfhdr.e_phoff),
elf_getu16(swap, elfhdr.e_phnum),
(off_t)elf_getu(swap, elfhdr.e_phoff), phnum,
(size_t)elf_getu16(swap, elfhdr.e_phentsize),
fsize, &flags, elf_getu16(swap, elfhdr.e_shnum))
== -1)
fsize, &flags, shnum) == -1)
return -1;
/*FALLTHROUGH*/
case ET_REL:
shnum = elf_getu16(swap, elfhdr.e_shnum);
if (shnum > MAX_SHNUM)
return toomany(ms, "section", shnum);
if (doshn(ms, clazz, swap, fd,
(off_t)elf_getu(swap, elfhdr.e_shoff),
elf_getu16(swap, elfhdr.e_shnum),
(off_t)elf_getu(swap, elfhdr.e_shoff), shnum,
(size_t)elf_getu16(swap, elfhdr.e_shentsize),
fsize, &flags, elf_getu16(swap, elfhdr.e_machine)) == -1)
return -1;
+1 -1
View File
@@ -414,7 +414,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t,
unichar **, size_t *, const char **, const char **, const char **);
protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
int, int);
size_t, int, int);
protected struct mlist *file_apprentice(struct magic_set *, const char *, int);
protected uint64_t file_signextend(struct magic_set *, struct magic *,
uint64_t);
+1 -1
View File
@@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
looks_text)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "softmagic %d\n", m);
+20 -3
View File
@@ -60,6 +60,18 @@ private uint16_t getu16(int, uint16_t);
private uint32_t getu32(int, uint32_t);
private uint64_t getu64(int, uint64_t);
#define MAX_PHNUM 256
#define MAX_SHNUM 1024
private int
toomany(struct magic_set *ms, const char *name, uint16_t num)
{
if (file_printf(ms, ", too many %s header sections (%u)", name, num
) == -1)
return -1;
return 0;
}
private uint16_t
getu16(int swap, uint16_t value)
{
@@ -384,13 +396,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
if (namesz & 0x80000000) {
(void)file_printf(ms, ", bad note name size 0x%lx",
(unsigned long)namesz);
return offset;
return 0;
}
if (descsz & 0x80000000) {
(void)file_printf(ms, ", bad note description size 0x%lx",
(unsigned long)descsz);
return offset;
return 0;
}
@@ -847,6 +859,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
Elf32_Shdr sh32;
Elf64_Shdr sh64;
int stripped = 1;
size_t nbadcap = 0;
void *nbuf;
off_t noff, coff;
uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
@@ -919,6 +932,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
free(nbuf);
break;
case SHT_SUNW_cap:
if (nbadcap > 5)
break;
if (lseek(fd, (off_t)xsh_offset, SEEK_SET) ==
(off_t)-1) {
file_badseek(ms);
@@ -955,6 +970,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
(unsigned long long)xcap_tag,
(unsigned long long)xcap_val) == -1)
return -1;
if (nbadcap++ > 2)
coff = xsh_size;
break;
}
}
@@ -1142,7 +1159,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
int flags = 0;
Elf32_Ehdr elf32hdr;
Elf64_Ehdr elf64hdr;
uint16_t type;
uint16_t type, phnum, shnum;
if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
return 0;
+35 -22
View File
@@ -43,9 +43,9 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $")
private int match(struct magic_set *, struct magic *, uint32_t,
const unsigned char *, size_t, int, int);
const unsigned char *, size_t, int, int, int);
private int mget(struct magic_set *, const unsigned char *,
struct magic *, size_t, unsigned int, int);
struct magic *, size_t, unsigned int, int, int);
private int magiccheck(struct magic_set *, struct magic *);
private int32_t mprint(struct magic_set *, struct magic *);
private int32_t moffset(struct magic_set *, struct magic *);
@@ -60,6 +60,10 @@ private void cvt_16(union VALUETYPE *, const struct magic *);
private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
#define MAX_RECURSION_LEVEL 10
/*
* softmagic - lookup one file in parsed, in-memory copy of database
* Passed the name and FILE * of one file to be typed.
@@ -67,13 +71,13 @@ private void cvt_64(union VALUETYPE *, const struct magic *);
/*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */
protected int
file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
int mode, int text)
size_t level, int mode, int text)
{
struct mlist *ml;
int rv;
for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next)
if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode,
text)) != 0)
text, level)) != 0)
return rv;
return 0;
@@ -108,7 +112,8 @@ file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
*/
private int
match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
const unsigned char *s, size_t nbytes, int mode, int text)
const unsigned char *s, size_t nbytes, int mode, int text,
int recursion_level)
{
uint32_t magindex = 0;
unsigned int cont_level = 0;
@@ -140,7 +145,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
ms->line = m->lineno;
/* if main entry matches, print it... */
switch (mget(ms, s, m, nbytes, cont_level, text)) {
switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
case -1:
return -1;
case 0:
@@ -223,7 +228,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
continue;
}
#endif
switch (mget(ms, s, m, nbytes, cont_level, text)) {
switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
case -1:
return -1;
case 0:
@@ -1018,12 +1023,18 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
private int
mget(struct magic_set *ms, const unsigned char *s,
struct magic *m, size_t nbytes, unsigned int cont_level, int text)
struct magic *m, size_t nbytes, unsigned int cont_level, int text,
int recursion_level)
{
uint32_t offset = ms->offset;
uint32_t count = m->str_range;
union VALUETYPE *p = &ms->ms_value;
if (recursion_level >= MAX_RECURSION_LEVEL) {
file_error(ms, 0, "recursion nesting exceeded");
return -1;
}
if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1)
return -1;
@@ -1073,7 +1084,7 @@ mget(struct magic_set *ms, const unsigned char *s,
}
switch (m->in_type) {
case FILE_BYTE:
if (nbytes < (offset + 1))
if (OFFSET_OOB(nbytes, offset, 1))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1108,7 +1119,7 @@ mget(struct magic_set *ms, const unsigned char *s,
offset = ~offset;
break;
case FILE_BESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1160,7 +1171,7 @@ mget(struct magic_set *ms, const unsigned char *s,
offset = ~offset;
break;
case FILE_LESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1212,7 +1223,7 @@ mget(struct magic_set *ms, const unsigned char *s,
offset = ~offset;
break;
case FILE_SHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1249,7 +1260,7 @@ mget(struct magic_set *ms, const unsigned char *s,
break;
case FILE_BELONG:
case FILE_BEID3:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1320,7 +1331,7 @@ mget(struct magic_set *ms, const unsigned char *s,
break;
case FILE_LELONG:
case FILE_LEID3:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1390,7 +1401,7 @@ mget(struct magic_set *ms, const unsigned char *s,
offset = ~offset;
break;
case FILE_MELONG:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1460,7 +1471,7 @@ mget(struct magic_set *ms, const unsigned char *s,
offset = ~offset;
break;
case FILE_LONG:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1527,14 +1538,14 @@ mget(struct magic_set *ms, const unsigned char *s,
/* Verify we have enough data to match magic type */
switch (m->type) {
case FILE_BYTE:
if (nbytes < (offset + 1)) /* should alway be true */
if (OFFSET_OOB(nbytes, offset, 1))
return 0;
break;
case FILE_SHORT:
case FILE_BESHORT:
case FILE_LESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
break;
@@ -1553,21 +1564,21 @@ mget(struct magic_set *ms, const unsigned char *s,
case FILE_FLOAT:
case FILE_BEFLOAT:
case FILE_LEFLOAT:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
break;
case FILE_DOUBLE:
case FILE_BEDOUBLE:
case FILE_LEDOUBLE:
if (nbytes < (offset + 8))
if (OFFSET_OOB(nbytes, offset, 8))
return 0;
break;
case FILE_STRING:
case FILE_PSTRING:
case FILE_SEARCH:
if (nbytes < (offset + m->vallen))
if (OFFSET_OOB(nbytes, offset, m->vallen))
return 0;
break;
@@ -1577,13 +1588,15 @@ mget(struct magic_set *ms, const unsigned char *s,
break;
case FILE_INDIRECT:
if (offset == 0)
return 0;
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
file_printf(ms, "%s", m->desc) == -1)
return -1;
if (nbytes < offset)
return 0;
return file_softmagic(ms, s + offset, nbytes - offset,
BINTEST, text);
recursion_level, BINTEST, text);
case FILE_DEFAULT: /* nothing to check */
default:
+1 -1
View File
@@ -80,7 +80,7 @@ struct _Unwind_Exception
_Unwind_Exception_Cleanup_Fn exception_cleanup;
unsigned long private_1;
unsigned long private_2;
} __attribute__((__aligned__));
};
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+10 -5
View File
@@ -774,6 +774,11 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
InitListExpr *StructuredList,
unsigned &StructuredIndex) {
Expr *expr = IList->getInit(Index);
if (ElemType->isReferenceType())
return CheckReferenceType(Entity, IList, ElemType, Index,
StructuredList, StructuredIndex);
if (InitListExpr *SubInitList = dyn_cast<InitListExpr>(expr)) {
if (!ElemType->isRecordType() || ElemType->isAggregateType()) {
unsigned newIndex = 0;
@@ -793,13 +798,13 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
// C++ initialization is handled later.
}
if (ElemType->isScalarType()) {
// FIXME: Need to handle atomic aggregate types with implicit init lists.
if (ElemType->isScalarType() || ElemType->isAtomicType())
return CheckScalarType(Entity, IList, ElemType, Index,
StructuredList, StructuredIndex);
} else if (ElemType->isReferenceType()) {
return CheckReferenceType(Entity, IList, ElemType, Index,
StructuredList, StructuredIndex);
}
assert((ElemType->isRecordType() || ElemType->isVectorType() ||
ElemType->isArrayType()) && "Unexpected type");
if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) {
// arrayType can be incomplete if we're initializing a flexible
+3 -1
View File
@@ -597,6 +597,8 @@ getconfig(
#endif /* not SYS_WINNT */
}
proto_config(PROTO_MONITOR, 0, 0., NULL);
for (;;) {
if (tok == CONFIG_END)
break;
@@ -1885,7 +1887,7 @@ getconfig(
for (i = 0; i < 8; i++)
for (j = 1; j < 100; ++j) {
rankey[i] = (char) (ntp_random() & 0xff);
rankey[i] = (char) (arc4random() & 0xff);
if (rankey[i] != 0) break;
}
rankey[8] = 0;
+16 -1
View File
@@ -24,6 +24,10 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef MIN
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
#endif
/*
* Structure to hold request procedure information
*/
@@ -893,6 +897,7 @@ ctl_putdata(
)
{
int overhead;
unsigned int currentlen;
overhead = 0;
if (!bin) {
@@ -916,12 +921,22 @@ ctl_putdata(
/*
* Save room for trailing junk
*/
if (dlen + overhead + datapt > dataend) {
while (dlen + overhead + datapt > dataend) {
/*
* Not enough room in this one, flush it out.
*/
currentlen = MIN(dlen, dataend - datapt);
memcpy(datapt, dp, currentlen);
datapt += currentlen;
dp += currentlen;
dlen -= currentlen;
datalinelen += currentlen;
ctl_flushpkt(CTL_MORE);
}
memmove((char *)datapt, dp, (unsigned)dlen);
datapt += dlen;
datalinelen += dlen;
+17 -5
View File
@@ -864,12 +864,24 @@ crypto_recv(
* errors.
*/
if (vallen == (u_int) EVP_PKEY_size(host_pkey)) {
RSA_private_decrypt(vallen,
u_int32 *cookiebuf = malloc(
RSA_size(host_pkey->pkey.rsa));
if (cookiebuf == NULL) {
rval = XEVNT_CKY;
break;
}
if (RSA_private_decrypt(vallen,
(u_char *)ep->pkt,
(u_char *)&temp32,
(u_char *)cookiebuf,
host_pkey->pkey.rsa,
RSA_PKCS1_OAEP_PADDING);
cookie = ntohl(temp32);
RSA_PKCS1_OAEP_PADDING) != 4) {
rval = XEVNT_CKY;
free(cookiebuf);
break;
} else {
cookie = ntohl(*cookiebuf);
free(cookiebuf);
}
} else {
rval = XEVNT_CKY;
break;
@@ -3914,7 +3926,7 @@ crypto_setup(void)
rand_file);
exit (-1);
}
get_systime(&seed);
arc4random_buf(&seed, sizeof(l_fp));
RAND_seed(&seed, sizeof(l_fp));
RAND_write_file(rand_file);
OpenSSL_add_all_algorithms();
+1
View File
@@ -649,6 +649,7 @@ receive(
has_mac)) {
is_authentic = AUTH_ERROR;
sys_badauth++;
return;
} else {
is_authentic = AUTH_OK;
}
+3 -3
View File
@@ -642,7 +642,7 @@ gen_md5(
for (i = 1; i <= MD5KEYS; i++) {
for (j = 0; j < 16; j++) {
while (1) {
temp = ntp_random() & 0xff;
temp = arc4random() & 0xff;
if (temp == '#')
continue;
if (temp > 0x20 && temp < 0x7f)
@@ -675,7 +675,7 @@ gen_rsa(
FILE *str;
fprintf(stderr, "Generating RSA keys (%d bits)...\n", modulus);
rsa = RSA_generate_key(modulus, 3, cb, "RSA");
rsa = RSA_generate_key(modulus, 65537, cb, "RSA");
fprintf(stderr, "\n");
if (rsa == NULL) {
fprintf(stderr, "RSA generate keys fails\n%s\n",
@@ -954,7 +954,7 @@ gen_gqpar(
*/
fprintf(stderr,
"Generating GQ parameters (%d bits)...\n", modulus);
rsa = RSA_generate_key(modulus, 3, cb, "GQ");
rsa = RSA_generate_key(modulus, 65537, cb, "GQ");
fprintf(stderr, "\n");
if (rsa == NULL) {
fprintf(stderr, "RSA generate keys fails\n%s\n",
+33 -7
View File
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2001-2003 Networks Associates Technology, Inc.
* Copyright (c) 2004-2012 Dag-Erling Smørgrav
* Copyright (c) 2004-2014 Dag-Erling Smørgrav
* All rights reserved.
*
* This software was developed for the FreeBSD Project by ThinkSec AS and
@@ -194,6 +194,7 @@ openpam_parse_chain(pam_handle_t *pamh,
openpam_log(PAM_LOG_ERROR,
"%s(%d): missing or invalid facility",
filename, lineno);
errno = EINVAL;
goto fail;
}
if (facility != fclt && facility != PAM_FACILITY_ANY) {
@@ -209,18 +210,28 @@ openpam_parse_chain(pam_handle_t *pamh,
openpam_log(PAM_LOG_ERROR,
"%s(%d): missing or invalid service name",
filename, lineno);
errno = EINVAL;
goto fail;
}
if (wordv[i] != NULL) {
openpam_log(PAM_LOG_ERROR,
"%s(%d): garbage at end of line",
filename, lineno);
errno = EINVAL;
goto fail;
}
ret = openpam_load_chain(pamh, servicename, fclt);
FREEV(wordc, wordv);
if (ret < 0)
if (ret < 0) {
/*
* Bogus errno, but this ensures that the
* outer loop does not just ignore the
* error and keep searching.
*/
if (errno == ENOENT)
errno = EINVAL;
goto fail;
}
continue;
}
@@ -230,6 +241,7 @@ openpam_parse_chain(pam_handle_t *pamh,
openpam_log(PAM_LOG_ERROR,
"%s(%d): missing or invalid control flag",
filename, lineno);
errno = EINVAL;
goto fail;
}
@@ -239,6 +251,7 @@ openpam_parse_chain(pam_handle_t *pamh,
openpam_log(PAM_LOG_ERROR,
"%s(%d): missing or invalid module name",
filename, lineno);
errno = EINVAL;
goto fail;
}
@@ -248,8 +261,11 @@ openpam_parse_chain(pam_handle_t *pamh,
this->flag = ctlf;
/* load module */
if ((this->module = openpam_load_module(modulename)) == NULL)
if ((this->module = openpam_load_module(modulename)) == NULL) {
if (errno == ENOENT)
errno = ENOEXEC;
goto fail;
}
/*
* The remaining items in wordv are the module's
@@ -282,7 +298,11 @@ openpam_parse_chain(pam_handle_t *pamh,
* The loop ended because openpam_readword() returned NULL, which
* can happen for four different reasons: an I/O error (ferror(f)
* is true), a memory allocation failure (ferror(f) is false,
* errno is non-zero)
* feof(f) is false, errno is non-zero), the file ended with an
* unterminated quote or backslash escape (ferror(f) is false,
* feof(f) is true, errno is non-zero), or the end of the file was
* reached without error (ferror(f) is false, feof(f) is true,
* errno is zero).
*/
if (ferror(f) || errno != 0)
goto syserr;
@@ -411,6 +431,9 @@ openpam_load_chain(pam_handle_t *pamh,
}
ret = openpam_load_file(pamh, service, facility,
filename, style);
/* success */
if (ret > 0)
RETURNN(ret);
/* the file exists, but an error occurred */
if (ret == -1 && errno != ENOENT)
RETURNN(ret);
@@ -420,7 +443,8 @@ openpam_load_chain(pam_handle_t *pamh,
}
/* no hit */
RETURNN(0);
errno = ENOENT;
RETURNN(-1);
}
/*
@@ -441,8 +465,10 @@ openpam_configure(pam_handle_t *pamh,
openpam_log(PAM_LOG_ERROR, "invalid service name");
RETURNC(PAM_SYSTEM_ERR);
}
if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0)
goto load_err;
if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) {
if (errno != ENOENT)
goto load_err;
}
for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) {
if (pamh->chains[fclt] != NULL)
continue;
@@ -39,3 +39,7 @@
#ifndef SM_CONF_MSG
# define SM_CONF_MSG 1
#endif /* SM_CONF_MSG */
#ifndef SM_IPNODEBYNAME_FLAGS
# define SM_IPNODEBYNAME_FLAGS AI_DEFAULT|AI_ALL
#endif /* SM_IPNODEBYNAME_FLAGS */
+2 -2
View File
@@ -5265,8 +5265,8 @@ closefd_walk(lowest, fd)
*/
void
sm_close_on_exec(highest, lowest)
int highest, lowest;
sm_close_on_exec(lowest, highest)
int lowest, highest;
{
#if HASFDWALK
(void) fdwalk(closefd_walk, &lowest);
+22 -14
View File
@@ -547,7 +547,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
url_decode(decodedpath);
if (outfile)
savefile = ftp_strdup(outfile);
savefile = outfile;
else {
cp = strrchr(decodedpath, '/'); /* find savefile */
if (cp != NULL)
@@ -571,8 +571,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
rangestart = rangeend = entitylen = -1;
mtime = -1;
if (restartautofetch) {
if (strcmp(savefile, "-") != 0 && *savefile != '|' &&
stat(savefile, &sb) == 0)
if (stat(savefile, &sb) == 0)
restart_point = sb.st_size;
}
if (urltype == FILE_URL_T) { /* file:// URLs */
@@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
} /* end of ftp:// or http:// specific setup */
/* Open the output file. */
if (strcmp(savefile, "-") == 0) {
fout = stdout;
} else if (*savefile == '|') {
oldintp = xsignal(SIGPIPE, SIG_IGN);
fout = popen(savefile + 1, "w");
if (fout == NULL) {
warn("Can't execute `%s'", savefile + 1);
goto cleanup_fetch_url;
/*
* Only trust filenames with special meaning if they came from
* the command line
*/
if (outfile == savefile) {
if (strcmp(savefile, "-") == 0) {
fout = stdout;
} else if (*savefile == '|') {
oldintp = xsignal(SIGPIPE, SIG_IGN);
fout = popen(savefile + 1, "w");
if (fout == NULL) {
warn("Can't execute `%s'", savefile + 1);
goto cleanup_fetch_url;
}
closefunc = pclose;
}
closefunc = pclose;
} else {
}
if (fout == NULL) {
if ((rangeend != -1 && rangeend <= restart_point) ||
(rangestart == -1 && filesize != -1 && filesize <= restart_point)) {
/* already done */
@@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
(*closefunc)(fout);
if (res0)
freeaddrinfo(res0);
FREEPTR(savefile);
if (savefile != outfile)
FREEPTR(savefile);
FREEPTR(uuser);
if (pass != NULL)
memset(pass, 0, strlen(pass));
+280 -299
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -35,13 +34,13 @@
# Previous editions of this database used WAT, CAT, SAT, and EAT
# for +0:00 through +3:00, respectively,
# but Mark R V Murray reports that
# `SAST' is the official abbreviation for +2:00 in the country of South Africa,
# `CAT' is commonly used for +2:00 in countries north of South Africa, and
# `WAT' is probably the best name for +1:00, as the common phrase for
# the area that includes Nigeria is ``West Africa''.
# He has heard of ``Western Sahara Time'' for +0:00 but can find no reference.
# 'SAST' is the official abbreviation for +2:00 in the country of South Africa,
# 'CAT' is commonly used for +2:00 in countries north of South Africa, and
# 'WAT' is probably the best name for +1:00, as the common phrase for
# the area that includes Nigeria is "West Africa".
# He has heard of "Western Sahara Time" for +0:00 but can find no reference.
#
# To make things confusing, `WAT' seems to have been used for -1:00 long ago;
# To make things confusing, 'WAT' seems to have been used for -1:00 long ago;
# I'd guess that this was because people needed _some_ name for -1:00,
# and at the time, far west Africa was the only major land area in -1:00.
# This usage is now obsolete, as the last use of -1:00 on the African
@@ -54,7 +53,7 @@
# 2:00 SAST South Africa Standard Time
# and Murray suggests the following abbreviation:
# 1:00 WAT West Africa Time
# I realize that this leads to `WAT' being used for both -1:00 and 1:00
# I realize that this leads to 'WAT' being used for both -1:00 and 1:00
# for times before 1976, but this is the best I can think of
# until we get more information.
#
@@ -131,9 +130,7 @@ Zone Africa/Gaborone 1:43:40 - LMT 1885
2:00 - CAT
# Burkina Faso
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Ouagadougou -0:06:04 - LMT 1912
0:00 - GMT
# See Africa/Abidjan.
# Burundi
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -161,7 +158,7 @@ Zone Africa/Bangui 1:14:20 - LMT 1912
# Chad
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Ndjamena 1:00:12 - LMT 1912
Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena
1:00 - WAT 1979 Oct 14
1:00 1:00 WAST 1980 Mar 8
1:00 - WAT
@@ -183,10 +180,20 @@ Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
Zone Africa/Brazzaville 1:01:08 - LMT 1912
1:00 - WAT
# Cote D'Ivoire
# Côte D'Ivoire / Ivory Coast
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Abidjan -0:16:08 - LMT 1912
0:00 - GMT
Link Africa/Abidjan Africa/Bamako # Mali
Link Africa/Abidjan Africa/Banjul # Gambia
Link Africa/Abidjan Africa/Conakry # Guinea
Link Africa/Abidjan Africa/Dakar # Senegal
Link Africa/Abidjan Africa/Freetown # Sierra Leone
Link Africa/Abidjan Africa/Lome # Togo
Link Africa/Abidjan Africa/Nouakchott # Mauritania
Link Africa/Abidjan Africa/Ouagadougou # Burkina Faso
Link Africa/Abidjan Africa/Sao_Tome # São Tomé and Príncipe
Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Djibouti
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -231,30 +238,26 @@ Rule Egypt 1990 1994 - May 1 1:00 1:00 S
# Egyptians would approve the cancellation."
#
# Egypt to cancel daylight saving time
# <a href="http://www.almasryalyoum.com/en/node/407168">
# http://www.almasryalyoum.com/en/node/407168
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_egypt04.html">
# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
# </a>
Rule Egypt 1995 2010 - Apr lastFri 0:00s 1:00 S
Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 -
Rule Egypt 1995 2005 - Sep lastThu 24:00 0 -
# From Steffen Thorsen (2006-09-19):
# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
# Egypt will turn back clocks by one hour at the midnight of Thursday
# after observing the daylight saving time since May.
# http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
Rule Egypt 2006 only - Sep 21 23:00s 0 -
Rule Egypt 2006 only - Sep 21 24:00 0 -
# From Dirk Losch (2007-08-14):
# I received a mail from an airline which says that the daylight
# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
# From Jesper Norgaard Welen (2007-08-15): [The following agree:]
# From Jesper Nørgaard Welen (2007-08-15): [The following agree:]
# http://www.nentjes.info/Bill/bill5.htm
# http://www.timeanddate.com/worldclock/city.html?n=53
# From Steffen Thorsen (2007-09-04): The official information...:
# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# From Abdelrahman Hassan (2007-09-06):
# Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
# than the year of the Gregorian calendar, Ramadan shifts earlier each
@@ -288,15 +291,9 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
#
# timeanddate[2] and another site I've found[3] also support that.
#
# [1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=492263">
# https://bugzilla.redhat.com/show_bug.cgi?id=492263
# </a>
# [2] <a href="http://www.timeanddate.com/worldclock/clockchange.html?n=53">
# http://www.timeanddate.com/worldclock/clockchange.html?n=53
# </a>
# [3] <a href="http://wwp.greenwichmeantime.com/time-zone/africa/egypt/">
# http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# </a>
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=492263
# [2] http://www.timeanddate.com/worldclock/clockchange.html?n=53
# [3] http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# From Arthur David Olson (2009-04-20):
# In 2009 (and for the next several years), Ramadan ends before the fourth
@@ -306,14 +303,10 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
# From Steffen Thorsen (2009-08-11):
# We have been able to confirm the August change with the Egyptian Cabinet
# Information and Decision Support Center:
# <a href="http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html">
# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
# </a>
#
# The Middle East News Agency
# <a href="http://www.mena.org.eg/index.aspx">
# http://www.mena.org.eg/index.aspx
# </a>
# also reports "Egypt starts winter time on August 21"
# today in article numbered "71, 11/08/2009 12:25 GMT."
# Only the title above is available without a subscription to their service,
@@ -321,25 +314,94 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
# (at least today).
# From Alexander Krivenyshev (2010-07-20):
# According to News from Egypt - Al-Masry Al-Youm Egypt's cabinet has
# According to News from Egypt - Al-Masry Al-Youm Egypt's cabinet has
# decided that Daylight Saving Time will not be used in Egypt during
# Ramadan.
#
# Arabic translation:
# "Clocks to go back during Ramadan--and then forward again"
# <a href="http://www.almasryalyoum.com/en/news/clocks-go-back-during-ramadan-and-then-forward-again">
# "Clocks to go back during Ramadan - and then forward again"
# http://www.almasryalyoum.com/en/news/clocks-go-back-during-ramadan-and-then-forward-again
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_egypt02.html">
# http://www.worldtimezone.com/dst_news/dst_news_egypt02.html
# </a>
Rule Egypt 2008 only - Aug lastThu 23:00s 0 -
Rule Egypt 2009 only - Aug 20 23:00s 0 -
Rule Egypt 2010 only - Aug 11 0:00 0 -
Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# From Ahmad El-Dardiry (2014-05-07):
# Egypt is to change back to Daylight system on May 15
# http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx
# From Gunther Vermier (2015-05-13):
# our Egypt office confirms that the change will be at 15 May "midnight" (24:00)
# From Imed Chihi (2014-06-04):
# We have finally "located" a precise official reference about the DST changes
# in Egypt. The Ministers Cabinet decision is explained at
# http://www.cabinet.gov.eg/Media/CabinetMeetingsDetails.aspx?id=347 ...
# [T]his (Arabic) site is not accessible outside Egypt, but the page ...
# translates into: "With regard to daylight saving time, it is scheduled to
# take effect at exactly twelve o'clock this evening, Thursday, 15 MAY 2014,
# to be suspended by twelve o'clock on the evening of Thursday, 26 JUN 2014,
# and re-established again at the end of the month of Ramadan, at twelve
# o'clock on the evening of Thursday, 31 JUL 2014." This statement has been
# reproduced by other (more accessible) sites[, e.g.,]...
# http://elgornal.net/news/news.aspx?id=4699258
# From Paul Eggert (2014-06-04):
# Sarah El Deeb and Lee Keath of AP report that the Egyptian government says
# the change is because of blackouts in Cairo, even though Ahram Online (cited
# above) says DST had no affect on electricity consumption. There is
# no information about when DST will end this fall. See:
# http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
#
# For now, guess that later spring and fall transitions will use
# 2010's rules, and guess that Egypt will switch to standard time at
# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
# first Friday after Ramadan. To implement this,
# transition dates for 2015 through 2037 were determined by running
# the following program under GNU Emacs 24.3, with the results integrated
# by hand into the table below. Ramadan again intrudes on the guessed
# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
# (let ((islamic-year 1436))
# (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)))
# (friday 5))
# (while (/= friday (mod a 7))
# (setq a (1- a)))
# (while (/= friday (mod b 7))
# (setq b (1+ b)))
# (setq a (1- a))
# (setq b (1- b))
# (setq a (calendar-gregorian-from-absolute a))
# (setq b (calendar-gregorian-from-absolute b))
# (insert
# (format
# (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
# "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24: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))))
Rule Egypt 2008 only - Aug lastThu 24:00 0 -
Rule Egypt 2009 only - Aug 20 24:00 0 -
Rule Egypt 2010 only - Aug 10 24:00 0 -
Rule Egypt 2010 only - Sep 9 24:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 24:00 0 -
Rule Egypt 2014 only - May 15 24:00 1:00 S
Rule Egypt 2014 only - Jun 26 24:00 0 -
Rule Egypt 2014 only - Jul 31 24:00 1:00 S
Rule Egypt 2014 max - Sep lastThu 24:00 0 -
Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S
Rule Egypt 2015 only - Jun 11 24:00 0 -
Rule Egypt 2015 only - Jul 23 24:00 1:00 S
Rule Egypt 2016 only - Jun 2 24:00 0 -
Rule Egypt 2016 only - Jul 7 24:00 1:00 S
Rule Egypt 2017 only - May 25 24:00 0 -
Rule Egypt 2017 only - Jun 29 24:00 1:00 S
Rule Egypt 2018 only - May 10 24:00 0 -
Rule Egypt 2018 only - Jun 14 24:00 1:00 S
Rule Egypt 2019 only - May 2 24:00 0 -
Rule Egypt 2019 only - Jun 6 24:00 1:00 S
Rule Egypt 2020 only - May 28 24:00 1:00 S
Rule Egypt 2021 only - May 13 24:00 1:00 S
Rule Egypt 2022 only - May 5 24:00 1:00 S
Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
@@ -359,10 +421,15 @@ Zone Africa/Asmara 2:35:32 - LMT 1870
3:00 - EAT
# Ethiopia
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time zones
# between 1870 and 1890, and that they merged to 38E50 (2:35:20) in 1890.
# We'll guess that 38E50 is for Adis Dera.
# From Paul Eggert (2014-07-31):
# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a
# 12-hour clock starting at our 06:00, so their "8 o'clock" is our
# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic.
#
# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time
# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in
# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50
# was for Adis Dera. Quite likely the Shanks data are wrong anyway.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Addis_Ababa 2:34:48 - LMT 1870
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
@@ -374,28 +441,24 @@ Zone Africa/Libreville 0:37:48 - LMT 1912
1:00 - WAT
# Gambia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Banjul -1:06:36 - LMT 1912
-1:06:36 - BMT 1935 # Banjul Mean Time
-1:00 - WAT 1964
0:00 - GMT
# See Africa/Abidjan.
# Ghana
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Whitman says DST was observed from 1931 to ``the present'';
# go with Shanks & Pottenger.
Rule Ghana 1936 1942 - Sep 1 0:00 0:20 GHST
Rule Ghana 1936 1942 - Dec 31 0:00 0 GMT
# Whitman says DST was observed from 1931 to "the present";
# Shanks & Pottenger say 1936 to 1942;
# and September 1 to January 1 is given by:
# Scott Keltie J, Epstein M (eds), The Statesman's Year-Book,
# 57th ed. Macmillan, London (1920), OCLC 609408015, pp xxviii.
# For lack of better info, assume DST was observed from 1920 to 1942.
Rule Ghana 1920 1942 - Sep 1 0:00 0:20 GHST
Rule Ghana 1920 1942 - Dec 31 0:00 0 GMT
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Accra -0:00:52 - LMT 1918
0:00 Ghana %s
# Guinea
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Conakry -0:54:52 - LMT 1912
0:00 - GMT 1934 Feb 26
-1:00 - WAT 1960
0:00 - GMT
# See Africa/Abidjan.
# Guinea-Bissau
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -451,6 +514,14 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# (either two days before them or five days after them, so as to fall on
# lastFri instead of lastSun).
# From Even Scharning (2013-10-25):
# The scheduled end of DST in Libya on Friday, October 25, 2013 was
# cancelled yesterday....
# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
#
# From Paul Eggert (2013-10-25):
# For now, assume they're reverting to the pre-2012 rules of permanent UTC+2.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Libya 1951 only - Oct 14 2:00 1:00 S
Rule Libya 1952 only - Jan 1 0:00 0 -
@@ -467,8 +538,8 @@ Rule Libya 1987 1989 - Apr 1 0:00 1:00 S
Rule Libya 1987 1989 - Oct 1 0:00 0 -
Rule Libya 1997 only - Apr 4 0:00 1:00 S
Rule Libya 1997 only - Oct 4 0:00 0 -
Rule Libya 2013 max - Mar lastFri 1:00 1:00 S
Rule Libya 2013 max - Oct lastFri 2:00 0 -
Rule Libya 2013 only - Mar lastFri 1:00 1:00 S
Rule Libya 2013 only - Oct lastFri 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Tripoli 0:52:44 - LMT 1920
1:00 Libya CE%sT 1959
@@ -479,7 +550,8 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
2:00 - EET 1996 Sep 30
1:00 Libya CE%sT 1997 Oct 4
2:00 - EET 2012 Nov 10 2:00
1:00 Libya CE%sT
1:00 Libya CE%sT 2013 Oct 25 2:00
2:00 - EET
# Madagascar
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -494,18 +566,8 @@ Zone Africa/Blantyre 2:20:00 - LMT 1903 Mar
2:00 - CAT
# Mali
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Bamako -0:32:00 - LMT 1912
0:00 - GMT 1934 Feb 26
-1:00 - WAT 1960 Jun 20
0:00 - GMT
# Mauritania
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Nouakchott -1:03:48 - LMT 1912
0:00 - GMT 1934 Feb 26
-1:00 - WAT 1960 Nov 28
0:00 - GMT
# See Africa/Abidjan.
# Mauritius
@@ -529,9 +591,7 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# From Steffen Thorsen (2008-07-10):
# According to
# <a href="http://www.lexpress.mu/display_article.php?news_id=111216">
# http://www.lexpress.mu/display_article.php?news_id=111216
# </a>
# (in French), Mauritius will start and end their DST a few days earlier
# than previously announced (2008-11-01 to 2009-03-31). The new start
# date is 2008-10-26 at 02:00 and the new end date is 2009-03-27 (no time
@@ -550,18 +610,13 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# published on Monday, June 30, 2008...
#
# I guess that article in French "Le gouvernement avance l'introduction
# de l'heure d'ete" stating that DST in Mauritius starting on October 26
# and ending on March 27, 2009 is the most recent one.
# ...
# <a href="http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html">
# de l'heure d'été" stating that DST in Mauritius starting on October 26
# and ending on March 27, 2009 is the most recent one....
# http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html
# </a>
# From Riad M. Hossen Ally (2008-08-03):
# The Government of Mauritius weblink
# <a href="http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD">
# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
# </a>
# Cabinet Decision of July 18th, 2008 states as follows:
#
# 4. ...Cabinet has agreed to the introduction into the National Assembly
@@ -571,33 +626,25 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# States of America. It will start at two o'clock in the morning on the
# last Sunday of October and will end at two o'clock in the morning on
# the last Sunday of March the following year. The summer time for the
# year 2008 - 2009 will, therefore, be effective as from 26 October 2008
# year 2008-2009 will, therefore, be effective as from 26 October 2008
# and end on 29 March 2009.
# From Ed Maste (2008-10-07):
# THE TIME BILL (No. XXVII of 2008) Explanatory Memorandum states the
# beginning / ending of summer time is 2 o'clock standard time in the
# morning of the last Sunday of October / last Sunday of March.
# <a href="http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf">
# http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
# </a>
# From Steffen Thorsen (2009-06-05):
# According to several sources, Mauritius will not continue to observe
# DST the coming summer...
#
# Some sources, in French:
# <a href="http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB">
# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB
# </a>
# <a href="http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-">
# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
# </a>
#
# Our wrap-up:
# <a href="http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html">
# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
# </a>
# From Arthur David Olson (2009-07-11):
# The "mauritius-dst-will-not-repeat" wrapup includes this:
@@ -621,7 +668,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# Morocco
# See the `europe' file for Spanish Morocco (Africa/Ceuta).
# See the 'europe' file for Spanish Morocco (Africa/Ceuta).
# From Alex Krivenyshev (2008-05-09):
# Here is an article that Morocco plan to introduce Daylight Saving Time between
@@ -629,69 +676,43 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
#
# "... Morocco is to save energy by adjusting its clock during summer so it will
# be one hour ahead of GMT between 1 June and 27 September, according to
# Communication Minister and Gov ernment Spokesman, Khalid Naciri...."
# Communication Minister and Government Spokesman, Khalid Naciri...."
#
# <a href="http://www.worldtimezone.net/dst_news/dst_news_morocco01.html">
# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
# </a>
# OR
# <a href="http://en.afrik.com/news11892.html">
# http://en.afrik.com/news11892.html
# </a>
# From Alex Krivenyshev (2008-05-09):
# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse:
# <a href="http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view">
# http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view
# </a>
#
# Morocco shifts to daylight time on June 1st through September 27, Govt.
# spokesman.
# From Patrice Scattolin (2008-05-09):
# According to this article:
# <a href="http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html">
# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
# </a>
# (and republished here:
# <a href="http://www.actu.ma/heure-dete-comment_i127896_0.html">
# http://www.actu.ma/heure-dete-comment_i127896_0.html
# </a>
# )
# the changes occurs at midnight:
# (and republished here: <http://www.actu.ma/heure-dete-comment_i127896_0.html>)
# the changes occur at midnight:
#
# saturday night may 31st at midnight (which in french is to be
# intrepreted as the night between saturday and sunday)
# sunday night the 28th at midnight
# Saturday night May 31st at midnight (which in French is to be
# interpreted as the night between Saturday and Sunday)
# Sunday night the 28th at midnight
#
# Seeing that the 28th is monday, I am guessing that she intends to say
# the midnight of the 28th which is the midnight between sunday and
# monday, which jives with other sources that say that it's inclusive
# june1st to sept 27th.
# Seeing that the 28th is Monday, I am guessing that she intends to say
# the midnight of the 28th which is the midnight between Sunday and
# Monday, which jives with other sources that say that it's inclusive
# June 1st to Sept 27th.
#
# The decision was taken by decree *2-08-224 *but I can't find the decree
# published on the web.
#
# It's also confirmed here:
# <a href="http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm">
# http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm
# </a>
# on a government portal as being between june 1st and sept 27th (not yet
# posted in english).
# on a government portal as being between June 1st and Sept 27th (not yet
# posted in English).
#
# The following google query will generate many relevant hits:
# <a href="http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search">
# The following Google query will generate many relevant hits:
# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# </a>
# From Alex Krivenyshev (2008-05-09):
# Is Western Sahara (part which administrated by Morocco) going to follow
# Morocco DST changes? Any information? What about other part of
# Western Sahara - under administration of POLISARIO Front (also named
# SADR Saharawi Arab Democratic Republic)?
# From Arthur David Olson (2008-05-09):
# XXX--guess that it is only Morocco for now; guess only 2008 for now.
# From Steffen Thorsen (2008-08-27):
# Morocco will change the clocks back on the midnight between August 31
@@ -699,47 +720,32 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# of September:
#
# One article about it (in French):
# <a href="http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default">
# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
# </a>
#
# We have some further details posted here:
# <a href="http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html">
# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# </a>
# From Steffen Thorsen (2009-03-17):
# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
# to many sources, such as
# <a href="http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html">
# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
# </a>
# <a href="http://www.medi1sat.ma/fr/depeche.aspx?idp=2312">
# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
# </a>
# (French)
#
# Our summary:
# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html">
# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# </a>
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to official document from Royaume du Maroc Premier Ministre,
# Ministere de la Modernisation des Secteurs Publics
# Ministère de la Modernisation des Secteurs Publics
#
# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
# concerning the amendment of the legal time, the Ministry of Modernization of
# Public Sectors announced that the official time in the Kingdom will be
# advanced 60 minutes from Sunday 31 May 2009 at midnight.
#
# <a href="http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf">
# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
# </a>
#
# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco03.html">
# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
# </a>
# From Steffen Thorsen (2010-04-13):
# Several news media in Morocco report that the Ministry of Modernization
@@ -747,14 +753,10 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# 2010-05-02 to 2010-08-08.
#
# Example:
# <a href="http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html">
# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
# </a>
# (French)
# Our page:
# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html">
# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
# </a>
# From Dan Abitol (2011-03-30):
# ...Rules for Africa/Casablanca are the following (24h format)
@@ -764,34 +766,20 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# The change was broadcast on the FM Radio
# I ve called ANRT (telecom regulations in Morocco) at
# +212.537.71.84.00
# <a href="http://www.anrt.net.ma/fr/">
# http://www.anrt.net.ma/fr/
# </a>
# They said that
# <a href="http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view">
# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
# </a>
# is the official publication to look at.
# They said that the decision was already taken.
#
# More articles in the press
# <a href="http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev">
# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
# </a>
# e.html
# <a href="http://www.lematin.ma/Actualite/Express/Article.asp?id=148923">
# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
# </a>
# <a href="http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim">
# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
# anche-prochain-5538.html
# </a>
# From Petr Machata (2011-03-30):
# They have it written in English here:
# <a href="http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view">
# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
# </a>
#
# It says there that "Morocco will resume its standard time on July 31,
# 2011 at midnight." Now they don't say whether they mean midnight of
@@ -799,20 +787,16 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# also been like that in the past.
# From Alexander Krivenyshev (2012-03-09):
# According to Infom&eacute;diaire web site from Morocco (infomediaire.ma),
# on March 9, 2012, (in French) Heure l&eacute;gale:
# Le Maroc adopte officiellement l'heure d'&eacute;t&eacute;
# <a href="http://www.infomediaire.ma/news/maroc/heure-l%C3%A9gale-le-maroc-adopte-officiellement-lheure-d%C3%A9t%C3%A9">
# According to Infomédiaire web site from Morocco (infomediaire.ma),
# on March 9, 2012, (in French) Heure légale:
# Le Maroc adopte officiellement l'heure d'été
# http://www.infomediaire.ma/news/maroc/heure-l%C3%A9gale-le-maroc-adopte-officiellement-lheure-d%C3%A9t%C3%A9
# </a>
# Governing Council adopted draft decree, that Morocco DST starts on
# the last Sunday of March (March 25, 2012) and ends on
# last Sunday of September (September 30, 2012)
# except the month of Ramadan.
# or (brief)
# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco06.html">
# http://www.worldtimezone.com/dst_news/dst_news_morocco06.html
# </a>
# From Arthur David Olson (2012-03-10):
# The infomediaire.ma source indicates that the system is to be in
@@ -823,17 +807,13 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# From Christophe Tropamer (2012-03-16):
# Seen Morocco change again:
# <a href="http://www.le2uminutes.com/actualite.php">
# http://www.le2uminutes.com/actualite.php
# </a>
# "...&agrave; partir du dernier dimance d'avril et non fins mars,
# comme annonc&eacute; pr&eacute;c&eacute;demment."
# "...à partir du dernier dimanche d'avril et non fins mars,
# comme annoncé précédemment."
# From Milamber Space Network (2012-07-17):
# The official return to GMT is announced by the Moroccan government:
# <a href="http://www.mmsp.gov.ma/fr/actualites.aspx?id=288">
# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 [in French]
# </a>
#
# Google translation, lightly edited:
# Back to the standard time of the Kingdom (GMT)
@@ -858,34 +838,49 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# transitions would be 2013-07-07 and 2013-08-10; see:
# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
# From Paul Eggert (2013-07-03):
# To estimate what the Moroccan government will do in future years,
# transition dates for 2014 through 2021 were determined by running
# the following program under GNU Emacs 24.3:
#
# (let ((islamic-year 1435))
# (while (< islamic-year 1444)
# (let ((a
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
# (b
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
# (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)))))
# From Steffen Thorsen (2013-09-28):
# Morocco extends DST by one month, on very short notice, just 1 day
# before it was going to end. There is a new decree (2.13.781) for
# this, where DST from now on goes from last Sunday of March at 02:00
# to last Sunday of October at 03:00, similar to EU rules. Official
# source (French):
# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013
# Another source (specifying the time for start and end in the decree):
# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
# From Sebastien Willemijns (2014-03-18):
# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
# From Milamber Space Network (2014-06-05):
# The Moroccan government has recently announced that the country will return
# to standard time at 03:00 on Saturday, June 28, 2014 local time.... DST
# will resume again at 02:00 on Saturday, August 2, 2014....
# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
# From Paul Eggert (2014-06-05):
# For now, guess that later spring and fall transitions will use 2014's rules,
# and guess that Morocco will switch to standard time at 03:00 the last
# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
# Ramadan. To implement this, transition dates for 2015 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 1436))
# (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)))
# (saturday 6))
# (while (/= saturday (mod (setq a (1- a)) 7)))
# (while (/= saturday (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))))
#
# with the results hand-edited for 2020-2022, when the normal spring-forward
# date falls during the estimated Ramadan.
#
# From 2023 through 2038 Ramadan is not predicted to overlap with
# daylight saving time. Starting in 2039 there will be overlap again,
# but 32-bit time_t values roll around in 2038 so for now do not worry
# about dates after 2038.
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -907,43 +902,65 @@ Rule Morocco 1978 only - Aug 4 0:00 0 -
Rule Morocco 2008 only - Jun 1 0:00 1:00 S
Rule Morocco 2008 only - Sep 1 0:00 0 -
Rule Morocco 2009 only - Jun 1 0:00 1:00 S
Rule Morocco 2009 only - Aug 21 0:00 0 -
Rule Morocco 2009 only - Aug 21 0:00 0 -
Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S
Rule Morocco 2012 max - Sep lastSun 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 7 3:00 0 -
Rule Morocco 2013 only - Aug 10 2:00 1:00 S
Rule Morocco 2014 only - Jun 29 3:00 0 -
Rule Morocco 2014 only - Jul 29 2:00 1:00 S
Rule Morocco 2015 only - Jun 18 3:00 0 -
Rule Morocco 2015 only - Jul 18 2:00 1:00 S
Rule Morocco 2016 only - Jun 7 3:00 0 -
Rule Morocco 2016 only - Jul 7 2:00 1:00 S
Rule Morocco 2017 only - May 27 3:00 0 -
Rule Morocco 2017 only - Jun 26 2:00 1:00 S
Rule Morocco 2018 only - May 16 3:00 0 -
Rule Morocco 2018 only - Jun 15 2:00 1:00 S
Rule Morocco 2019 only - May 6 3:00 0 -
Rule Morocco 2019 only - Jun 5 2:00 1:00 S
Rule Morocco 2020 only - May 24 2:00 1:00 S
Rule Morocco 2021 only - May 13 2:00 1:00 S
Rule Morocco 2022 only - May 3 2:00 1:00 S
Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S
Rule Morocco 2012 only - Sep 30 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
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 2022 - Mar lastSun 2:00 1:00 S
Rule Morocco 2014 only - Jun 28 3:00 0 -
Rule Morocco 2014 only - Aug 2 2:00 1:00 S
Rule Morocco 2015 only - Jun 13 3:00 0 -
Rule Morocco 2015 only - Jul 18 2:00 1:00 S
Rule Morocco 2016 only - Jun 4 3:00 0 -
Rule Morocco 2016 only - Jul 9 2:00 1:00 S
Rule Morocco 2017 only - May 20 3:00 0 -
Rule Morocco 2017 only - Jul 1 2:00 1:00 S
Rule Morocco 2018 only - May 12 3:00 0 -
Rule Morocco 2018 only - Jun 16 2:00 1:00 S
Rule Morocco 2019 only - May 4 3:00 0 -
Rule Morocco 2019 only - Jun 8 2:00 1:00 S
Rule Morocco 2020 only - Apr 18 3:00 0 -
Rule Morocco 2020 only - May 30 2:00 1:00 S
Rule Morocco 2021 only - Apr 10 3:00 0 -
Rule Morocco 2021 only - May 15 2:00 1:00 S
Rule Morocco 2022 only - Apr 2 3:00 0 -
Rule Morocco 2022 only - May 7 2:00 1:00 S
Rule Morocco 2023 only - Apr 22 2:00 1:00 S
Rule Morocco 2024 only - Apr 13 2:00 1:00 S
Rule Morocco 2025 only - Apr 5 2:00 1:00 S
Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
Rule Morocco 2035 only - Oct 27 3:00 0 -
Rule Morocco 2036 only - Oct 18 3:00 0 -
Rule Morocco 2037 only - Oct 10 3:00 0 -
# 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
# Western Sahara
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan
#
# From Gwillim Law (2013-10-22):
# A correspondent who is usually well informed about time zone matters
# ... says that Western Sahara observes daylight saving time, just as
# Morocco does.
#
# From Paul Eggert (2013-10-23):
# Assume that this has been true since Western Sahara switched to GMT,
# since most of it was then controlled by Morocco.
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
-1:00 - WAT 1976 Apr 14
0:00 - WET
0:00 Morocco WE%sT
# Mozambique
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -991,15 +1008,17 @@ Zone Africa/Niamey 0:08:28 - LMT 1912
Zone Africa/Lagos 0:13:36 - LMT 1919 Sep
1:00 - WAT
# Reunion
# Réunion
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis
4:00 - RET # Reunion Time
4:00 - RET # Réunion Time
#
# Scattered Islands (Iles Eparses) administered from Reunion are as follows.
# Crozet Islands also observes Réunion time; see the 'antarctica' file.
#
# Scattered Islands (Îles Éparses) administered from Réunion are as follows.
# The following information about them is taken from
# Iles Eparses (www.outre-mer.gouv.fr/domtom/ile.htm, 1997-07-22, in French;
# no longer available as of 1999-08-17).
# Îles Éparses (<http://www.outre-mer.gouv.fr/domtom/ile.htm>, 1997-07-22,
# in French; no longer available as of 1999-08-17).
# We have no info about their time zone histories.
#
# Bassas da India - uninhabited
@@ -1014,28 +1033,17 @@ Zone Africa/Kigali 2:00:16 - LMT 1935 Jun
2:00 - CAT
# St Helena
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/St_Helena -0:22:48 - LMT 1890 # Jamestown
-0:22:48 - JMT 1951 # Jamestown Mean Time
0:00 - GMT
# See Africa/Abidjan.
# The other parts of the St Helena territory are similar:
# Tristan da Cunha: on GMT, say Whitman and the CIA
# Ascension: on GMT, says usno1995 and the CIA
# Ascension: on GMT, say the USNO (1995-12-21) and the CIA
# Gough (scientific station since 1955; sealers wintered previously):
# on GMT, says the CIA
# Inaccessible, Nightingale: no information, but probably GMT
# Sao Tome and Principe
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Sao_Tome 0:26:56 - LMT 1884
-0:36:32 - LMT 1912 # Lisbon Mean Time
0:00 - GMT
# Inaccessible, Nightingale: uninhabited
# São Tomé and Príncipe
# Senegal
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Dakar -1:09:44 - LMT 1912
-1:00 - WAT 1941 Jun
0:00 - GMT
# See Africa/Abidjan.
# Seychelles
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1049,17 +1057,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria
# Possibly the islands were uninhabited.
# Sierra Leone
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Whitman gives Mar 31 - Aug 31 for 1931 on; go with Shanks & Pottenger.
Rule SL 1935 1942 - Jun 1 0:00 0:40 SLST
Rule SL 1935 1942 - Oct 1 0:00 0 WAT
Rule SL 1957 1962 - Jun 1 0:00 1:00 SLST
Rule SL 1957 1962 - Sep 1 0:00 0 GMT
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Freetown -0:53:00 - LMT 1882
-0:53:00 - FMT 1913 Jun # Freetown Mean Time
-1:00 SL %s 1957
0:00 SL %s
# See Africa/Abidjan.
# Somalia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1082,9 +1080,9 @@ Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
# Sudan
#
# From <a href="http://www.sunanews.net/sn13jane.html">
# Sudan News Agency (2000-01-13)
# </a>, also reported by Michael De Beukelaer-Dossche via Steffen Thorsen:
# From <http://www.sunanews.net/sn13jane.html>
# Sudan News Agency (2000-01-13),
# also reported by Michaël De Beukelaer-Dossche via Steffen Thorsen:
# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
# Saturday.... This was announced Thursday by Caretaker State Minister for
# Manpower Abdul-Rahman Nur-Eddin.
@@ -1100,9 +1098,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
3:00 - EAT
# South Sudan
Zone Africa/Juba 2:06:24 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
Link Africa/Khartoum Africa/Juba
# Swaziland
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1117,14 +1113,12 @@ Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931
3:00 - EAT
# Togo
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Lome 0:04:52 - LMT 1893
0:00 - GMT
# See Africa/Abidjan.
# Tunisia
# From Gwillim Law (2005-04-30):
# My correspondent, Risto Nykanen, has alerted me to another adoption of DST,
# My correspondent, Risto Nykänen, has alerted me to another adoption of DST,
# this time in Tunisia. According to Yahoo France News
# <http://fr.news.yahoo.com/050426/5/4dumk.html>, in a story attributed to AP
# and dated 2005-04-26, "Tunisia has decided to advance its official time by
@@ -1133,7 +1127,7 @@ Zone Africa/Lome 0:04:52 - LMT 1893
# Saturday." (My translation)
#
# From Oscar van Vlijmen (2005-05-02):
# LaPresse, the first national daily newspaper ...
# La Presse, the first national daily newspaper ...
# <http://www.lapresse.tn/archives/archives280405/actualites/lheure.html>
# ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30,
# 1h standard time.
@@ -1147,18 +1141,12 @@ Zone Africa/Lome 0:04:52 - LMT 1893
# From Steffen Thorsen (2009-03-16):
# According to several news sources, Tunisia will not observe DST this year.
# (Arabic)
# <a href="http://www.elbashayer.com/?page=viewn&nid=42546">
# http://www.elbashayer.com/?page=viewn&nid=42546
# </a>
# <a href="http://www.babnet.net/kiwidetail-15295.asp">
# http://www.babnet.net/kiwidetail-15295.asp
# </a>
#
# We have also confirmed this with the US embassy in Tunisia.
# We have a wrap-up about this on the following page:
# <a href="http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html">
# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# </a>
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to Tunis Afrique Presse News Agency
@@ -1166,20 +1154,17 @@ Zone Africa/Lome 0:04:52 - LMT 1893
# Standard time to be kept the whole year long (tap.info.tn):
#
# (in English)
# <a href="http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157">
# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
# </a>
#
# (in Arabic)
# <a href="http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1">
# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
# </a>
# From Arthur David Olson (2009--3-18):
# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
# that the fasting month of ramadan coincides with the period concerned by summer time.
# Therefore, the standard time will be kept unchanged the whole year long."
# So foregoing DST seems to be an exception (albeit one that may be repeated in the future).
# From Arthur David Olson (2009-03-18):
# The Tunis Afrique Presse News Agency notice contains this: "This measure is
# due to the fact that the fasting month of Ramadan coincides with the period
# concerned by summer time. Therefore, the standard time will be kept
# unchanged the whole year long." So foregoing DST seems to be an exception
# (albeit one that may be repeated in the future).
# From Alexander Krivenyshev (2010-03-27):
# According to some news reports Tunis confirmed not to use DST in 2010
@@ -1191,12 +1176,8 @@ Zone Africa/Lome 0:04:52 - LMT 1893
# coincided with the month of Ramadan..."
#
# (in Arabic)
# <a href="http://www.moheet.com/show_news.aspx?nid=358861&pg=1">
# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
# <a href="http://www.almadenahnews.com/newss/news.php?c=118&id=38036">
# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_tunis02.html">
# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+100 -84
View File
@@ -1,24 +1,21 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# From Paul Eggert (1999-11-15):
# To keep things manageable, we list only locations occupied year-round; see
# <a href="http://www.comnap.aq/comnap/comnap.nsf/P/Stations/">
# COMNAP - Stations and Bases
# </a>
# <http://www.comnap.aq/comnap/comnap.nsf/P/Stations/>
# and
# <a href="http://www.spri.cam.ac.uk/bob/periant.htm">
# Summary of the Peri-Antarctic Islands (1998-07-23)
# </a>
# <http://www.spri.cam.ac.uk/bob/periant.htm>
# for information.
# Unless otherwise specified, we have no time zone information.
#
# Except for the French entries,
# I made up all time zone abbreviations mentioned here; corrections welcome!
# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
# These rules are stolen from the `southamerica' file.
# These rules are stolen from the 'southamerica' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ArgAQ 1964 1966 - Mar 1 0:00 0 -
Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S
@@ -55,19 +52,19 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
# Esperanza, San Martin Land, -6323-05659, since 1952-12-17
# Jubany, Potter Peninsula, King George Island, -6414-0602320, since 1982-01
# Marambio, Seymour I, -6414-05637, since 1969-10-29
# Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
# Esperanza, Hope Bay, -6323-05659, since 1952-12-17
# Marambio, -6414-05637, since 1969-10-29
# Orcadas, Laurie I, -6016-04444, since 1904-02-22
# San Martin, Debenham I, -6807-06708, since 1951-03-21
# San Martín, Barry I, -6808-06706, since 1951-03-21
# (except 1960-03 / 1976-03-21)
# Australia - territories
# Heard Island, McDonald Islands (uninhabited)
# previously sealers and scientific personnel wintered
# <a href="http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html">
# Margaret Turner reports
# </a> (1999-09-30) that they're UTC+5, with no DST;
# <http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html>
# (1999-09-30) that they're UTC+5, with no DST;
# presumably this is when they have visitors.
#
# year-round bases
@@ -84,14 +81,10 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# The changes occurred on 2009-10-18 at 02:00 (local times).
#
# Government source: (Australian Antarctic Division)
# <a href="http://www.aad.gov.au/default.asp?casid=37079">
# http://www.aad.gov.au/default.asp?casid=37079
# </a>
#
# We have more background information here:
# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
# http://www.timeanddate.com/news/time/antarctica-new-times.html
# </a>
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division: ...
@@ -106,19 +99,17 @@ Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# - Mawson station stays on UTC+5.
#
# Background:
# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# </a>
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Casey 0 - zzz 1969
8:00 - WST 2009 Oct 18 2:00
# Western (Aus) Standard Time
8:00 - AWST 2009 Oct 18 2:00
# Australian Western Std Time
11:00 - CAST 2010 Mar 5 2:00
# Casey Time
8:00 - WST 2011 Oct 28 2:00
8:00 - AWST 2011 Oct 28 2:00
11:00 - CAST 2012 Feb 21 17:00u
8:00 - WST
8:00 - AWST
Zone Antarctica/Davis 0 - zzz 1957 Jan 13
7:00 - DAVT 1964 Nov # Davis Time
0 - zzz 1969 Feb
@@ -132,24 +123,27 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
# Mawson Time
5:00 - MAWT
# References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26)
# </a>
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html">
# <http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html>
# Davis Station, Antarctica (1998-02-26)
# </a>
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html">
# <http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html>
# Mawson Station, Antarctica (1998-02-25)
# </a>
# <http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html>
# Belgium - year-round base
# Princess Elisabeth, Queen Maud Land, -713412+0231200, since 2007
# Brazil - year-round base
# Comandante Ferraz, King George Island, -6205+05824, since 1983/4
# Ferraz, King George Island, -6205+05824, since 1983/4
# Bulgaria - year-round base
# St. Kliment Ohridski, Livingston Island, -623829-0602153, since 1988
# Chile - year-round bases and towns
# Escudero, South Shetland Is, -621157-0585735, since 1994
# Presidente Eduadro Frei, King George Island, -6214-05848, since 1969-03-07
# General Bernardo O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
# Capitan Arturo Prat, -6230-05941
# Frei Montalva, King George Island, -6214-05848, since 1969-03-07
# O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
# Prat, -6230-05941
# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
# These locations have always used Santiago time; use TZ='America/Santiago'.
@@ -157,31 +151,35 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
# Great Wall, King George Island, -6213-05858, since 1985-02-20
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
# France - year-round bases
# France - year-round bases (also see "France & Italy")
#
# From Antoine Leca (1997-01-20):
# Time data are from Nicole Pailleau at the IFRTP
# (French Institute for Polar Research and Technology).
# She confirms that French Southern Territories and Terre Adelie bases
# don't observe daylight saving time, even if Terre Adelie supplies came
# She confirms that French Southern Territories and Terre Adélie bases
# don't observe daylight saving time, even if Terre Adélie supplies came
# from Tasmania.
#
# French Southern Territories with year-round inhabitants
#
# Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950
# Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964
# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951;
# Alfred Faure, Possession Island, Crozet Islands, -462551+0515152, since 1964;
# sealing & whaling stations operated variously 1802/1911+;
# see Indian/Reunion.
#
# Martin-de-Viviès, Amsterdam Island, -374105+0773155, since 1950
# Port-aux-Français, Kerguelen Islands, -492110+0701303, since 1951;
# whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
#
# St Paul Island - near Amsterdam, uninhabited
# fishing stations operated variously 1819/1931
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Francais
Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Français
5:00 - TFT # ISO code TF Time
#
# year-round base in the main continent
# Dumont-d'Urville, Ile des Petrels, -6640+14001, since 1956-11
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
# <http://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.
@@ -191,20 +189,22 @@ Zone Antarctica/DumontDUrville 0 - zzz 1947
10:00 - PMT 1952 Jan 14 # Port-Martin Time
0 - zzz 1956 Nov
10:00 - DDUT # Dumont-d'Urville Time
# Reference:
# <a href="http://en.wikipedia.org/wiki/Dumont_d'Urville_Station">
# Dumont d'Urville Station (2005-12-05)
# </a>
# France & Italy - year-round base
# Concordia, -750600+1232000, since 2005
# Germany - year-round base
# Georg von Neumayer, -7039-00815
# Neumayer III, -704080-0081602, since 2009
# India - year-round base
# Dakshin Gangotri, -7005+01200
# India - year-round bases
# Bharati, -692428+0761114, since 2012
# Maitri, -704558+0114356, since 1989
# Italy - year-round base (also see "France & Italy")
# Zuchelli, Terra Nova Bay, -744140+1640647, since 1986
# Japan - year-round bases
# Dome Fuji, -7719+03942
# Syowa, -690022+0393524
# Syowa (also known as Showa), -690022+0393524, since 1957
#
# From Hideyuki Suzuki (1999-02-06):
# In all Japanese stations, +0300 is used as the standard time.
@@ -216,11 +216,11 @@ Zone Antarctica/DumontDUrville 0 - zzz 1947
Zone Antarctica/Syowa 0 - zzz 1957 Jan 29
3:00 - SYOT # Syowa Time
# See:
# <a href="http://www.nipr.ac.jp/english/ara01.html">
# NIPR Antarctic Research Activities (1999-08-17)
# </a>
# <http://www.nipr.ac.jp/english/ara01.html>
# S Korea - year-round base
# Jang Bogo, Terra Nova Bay, -743700+1641205 since 2014
# King Sejong, King George Island, -6213-05847, since 1988
# New Zealand - claims
@@ -228,29 +228,50 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 29
# Scott Island (never inhabited)
#
# year-round base
# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
#
# These rules for New Zealand are stolen from the `australasia' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D
Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D
Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D
Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D
Rule NZAQ 1975 only - Feb 23 2:00s 0 S
Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S
Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S
Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D
Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# Scott Base, Ross Island, since 1957-01.
# See Pacific/Auckland.
# Norway - territories
# Bouvet (never inhabited)
#
# claims
# Peter I Island (never inhabited)
#
# year-round base
# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
#
# From Paul-Inge Flakstad (2014-03-10):
# I recently had a long dialog about this with the developer of timegenie.com.
# In the absence of specific dates, he decided to choose some likely ones:
# GMT +1 - From March 1 to the last Sunday in March
# GMT +2 - From the last Sunday in March until the last Sunday in October
# GMT +1 - From the last Sunday in October until November 7
# GMT +0 - From November 7 until March 1
# The dates for switching to and from UTC+0 will probably not be absolutely
# correct, but they should be quite close to the actual dates.
#
# From Paul Eggert (2014-03-21):
# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
# suggested by Bengt-Inge Larsson comment them out for now, and approximate
# with only UTC and CEST. Uncomment them when 2014b is more prevalent.
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
#Rule Troll 2005 max - Mar 1 1:00u 1:00 CET
Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST
#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET
#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC
# Remove the following line when uncommenting the above '#Rule' lines.
Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Troll 0 - zzz 2005 Feb 12
0:00 Troll %s
# Poland - year-round base
# Arctowski, King George Island, -620945-0582745, since 1977
# Romania - year-bound base
# Law-Racoviță, Larsemann Hills, -692319+0762251, since 1986
# Russia - year-round bases
# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
# Mirny, Davis coast, -6633+09301, since 1956-02
@@ -260,23 +281,23 @@ Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# year-round from 1960/61 to 1992
# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
# <a href="http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP">
# From Craig Mundell (1994-12-15)</a>:
# From Craig Mundell (1994-12-15)
# <http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP>:
# Vostok, which is one of the Russian stations, is set on the same
# time as Moscow, Russia.
#
# From Lee Hotz (2001-03-08):
# I queried the folks at Columbia who spent the summer at Vostok and this is
# what they had to say about time there:
# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
# "in the US Camp (East Camp) we have been on New Zealand (McMurdo)
# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
# of GMT). This is a time zone I think two hours east of Moscow. The
# natural time zone is in between the two: 8 hours ahead of GMT.''
# natural time zone is in between the two: 8 hours ahead of GMT."
#
# From Paul Eggert (2001-05-04):
# This seems to be hopelessly confusing, so I asked Lee Hotz about it
# in person. He said that some Antartic locations set their local
# in person. He said that some Antarctic locations set their local
# time so that noon is the warmest part of the day, and that this
# changes during the year and does not necessarily correspond to mean
# solar noon. So the Vostok time might have been whatever the clocks
@@ -288,9 +309,12 @@ Zone Antarctica/Vostok 0 - zzz 1957 Dec 16
# S Africa - year-round bases
# Marion Island, -4653+03752
# Sanae, -7141-00250
# SANAE IV, Vesleskarvet, Queen Maud Land, -714022-0025026, since 1997
# UK
# Ukraine - year-round base
# Vernadsky (formerly Faraday), Galindez Island, -651445-0641526, since 1954
# United Kingdom
#
# British Antarctic Territories (BAT) claims
# South Orkney Islands
@@ -337,16 +361,8 @@ Zone Antarctica/Palmer 0 - zzz 1965
-4:00 ChileAQ CL%sT
#
#
# McMurdo, Ross Island, since 1955-12
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/McMurdo 0 - zzz 1956
12:00 NZAQ NZ%sT
#
# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
#
# From Paul Eggert (1996-09-03):
# Normally it wouldn't have a separate entry, since it's like the
# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
# McMurdo Station, Ross Island, since 1955-12
# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
#
# From Chris Carrier (1996-06-27):
# Siple, the first commander of the South Pole station,
@@ -354,7 +370,7 @@ Zone Antarctica/McMurdo 0 - zzz 1956
# but that he found it more convenient to keep GMT+12
# as supplies for the station were coming from McMurdo Sound,
# which was on GMT+12 because New Zealand was on GMT+12 all year
# at that time (1957). (Source: Siple's book 90 degrees SOUTH.)
# at that time (1957). (Source: Siple's book 90 Degrees South.)
#
# From Susan Smith
# http://www.cybertours.com/whs/pole10.html
@@ -368,4 +384,4 @@ Zone Antarctica/McMurdo 0 - zzz 1956
# we have to go around and set them back 5 minutes or so.
# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
#
Link Antarctica/McMurdo Antarctica/South_Pole
# See 'australasia' for Antarctica/McMurdo.
+447 -393
View File
File diff suppressed because it is too large. Load diff
+429 -450
View File
File diff suppressed because it is too large. Load diff
+14 -10
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -6,7 +5,7 @@
# and their old names. Many names changed in late 1993.
Link Africa/Asmara Africa/Asmera
Link Africa/Bamako Africa/Timbuktu
Link Africa/Abidjan Africa/Timbuktu
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
Link America/Argentina/Buenos_Aires America/Buenos_Aires
@@ -22,15 +21,20 @@ Link America/Kentucky/Louisville America/Louisville
Link America/Argentina/Mendoza America/Mendoza
Link America/Rio_Branco America/Porto_Acre
Link America/Argentina/Cordoba America/Rosario
Link America/St_Thomas America/Virgin
Link America/Denver America/Shiprock
Link America/Port_of_Spain America/Virgin
Link Pacific/Auckland Antarctica/South_Pole
Link Asia/Ashgabat Asia/Ashkhabad
Link Asia/Chongqing Asia/Chungking
Link Asia/Dhaka Asia/Dacca
Link Asia/Kathmandu Asia/Katmandu
Link Asia/Kolkata Asia/Calcutta
Link Asia/Shanghai Asia/Chongqing
Link Asia/Shanghai Asia/Chungking
Link Asia/Dhaka Asia/Dacca
Link Asia/Shanghai Asia/Harbin
Link Asia/Urumqi Asia/Kashgar
Link Asia/Kathmandu Asia/Katmandu
Link Asia/Macau Asia/Macao
Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Ho_Chi_Minh Asia/Saigon
Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Thimphu Asia/Thimbu
Link Asia/Makassar Asia/Ujung_Pandang
Link Asia/Ulaanbaatar Asia/Ulan_Bator
@@ -88,10 +92,10 @@ Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
Link Asia/Shanghai PRC
Link Pacific/Pago_Pago Pacific/Samoa
Link Pacific/Chuuk Pacific/Yap
Link Pacific/Chuuk Pacific/Truk
Link Pacific/Pohnpei Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
Link Pacific/Chuuk Pacific/Truk
Link Pacific/Chuuk Pacific/Yap
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
Link Asia/Taipei ROC
+3 -4
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -14,7 +13,7 @@ Zone Etc/UTC 0 - UTC
Zone Etc/UCT 0 - UCT
# The following link uses older naming conventions,
# but it belongs here, not in the file `backward',
# but it belongs here, not in the file 'backward',
# as functions like gmtime load the "UTC" file to handle leap seconds properly.
# We want this to work even on installations that omit the other older names.
Link Etc/UTC UTC
@@ -31,9 +30,9 @@ Link Etc/GMT Etc/GMT0
# even though this is the opposite of what many people expect.
# POSIX has positive signs west of Greenwich, but many people expect
# positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses
# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC
# the abbreviation "GMT+4" and corresponds to 4 hours behind UT
# (i.e. west of Greenwich) even though many people would expect it to
# mean 4 hours ahead of UTC (i.e. east of Greenwich).
# mean 4 hours ahead of UT (i.e. east of Greenwich).
#
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
# TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
+742 -375
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
+239
View File
@@ -0,0 +1,239 @@
#
# In the following text, the symbol '#' introduces
# a comment, which continues from that symbol until
# the end of the line. A plain comment line has a
# whitespace character following the comment indicator.
# There are also special comment lines defined below.
# A special comment will always have a non-whitespace
# character in column 2.
#
# A blank line should be ignored.
#
# The following table shows the corrections that must
# be applied to compute International Atomic Time (TAI)
# from the Coordinated Universal Time (UTC) values that
# are transmitted by almost all time services.
#
# The first column shows an epoch as a number of seconds
# since 1 January 1900, 00:00:00 (1900.0 is also used to
# indicate the same epoch.) Both of these time stamp formats
# ignore the complexities of the time scales that were
# used before the current definition of UTC at the start
# of 1972. (See note 3 below.)
# The second column shows the number of seconds that
# must be added to UTC to compute TAI for any timestamp
# at or after that epoch. The value on each line is
# valid from the indicated initial instant until the
# epoch given on the next one or indefinitely into the
# future if there is no next line.
# (The comment on each line shows the representation of
# the corresponding initial epoch in the usual
# day-month-year format. The epoch always begins at
# 00:00:00 UTC on the indicated day. See Note 5 below.)
#
# Important notes:
#
# 1. Coordinated Universal Time (UTC) is often referred to
# as Greenwich Mean Time (GMT). The GMT time scale is no
# longer used, and the use of GMT to designate UTC is
# discouraged.
#
# 2. The UTC time scale is realized by many national
# laboratories and timing centers. Each laboratory
# identifies its realization with its name: Thus
# UTC(NIST), UTC(USNO), etc. The differences among
# these different realizations are typically on the
# order of a few nanoseconds (i.e., 0.000 000 00x s)
# and can be ignored for many purposes. These differences
# are tabulated in Circular T, which is published monthly
# by the International Bureau of Weights and Measures
# (BIPM). See www.bipm.fr for more information.
#
# 3. The current definition of the relationship between UTC
# and TAI dates from 1 January 1972. A number of different
# time scales were in use before that epoch, and it can be
# quite difficult to compute precise timestamps and time
# intervals in those "prehistoric" days. For more information,
# consult:
#
# The Explanatory Supplement to the Astronomical
# Ephemeris.
# or
# Terry Quinn, "The BIPM and the Accurate Measurement
# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905,
# July, 1991.
#
# 4. The decision to insert a leap second into UTC is currently
# the responsibility of the International Earth Rotation and
# Reference Systems Service. (The name was changed from the
# International Earth Rotation Service, but the acronym IERS
# is still used.)
#
# Leap seconds are announced by the IERS in its Bulletin C.
#
# See www.iers.org for more details.
#
# Every national laboratory and timing center uses the
# data from the BIPM and the IERS to construct UTC(lab),
# their local realization of UTC.
#
# Although the definition also includes the possibility
# of dropping seconds ("negative" leap seconds), this has
# never been done and is unlikely to be necessary in the
# foreseeable future.
#
# 5. If your system keeps time as the number of seconds since
# some epoch (e.g., NTP timestamps), then the algorithm for
# assigning a UTC time stamp to an event that happens during a positive
# leap second is not well defined. The official name of that leap
# second is 23:59:60, but there is no way of representing that time
# in these systems.
# Many systems of this type effectively stop the system clock for
# one second during the leap second and use a time that is equivalent
# to 23:59:59 UTC twice. For these systems, the corresponding TAI
# timestamp would be obtained by advancing to the next entry in the
# following table when the time equivalent to 23:59:59 UTC
# is used for the second time. Thus the leap second which
# occurred on 30 June 1972 at 23:59:59 UTC would have TAI
# timestamps computed as follows:
#
# ...
# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds
# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds
# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds
# ...
#
# If your system realizes the leap second by repeating 00:00:00 UTC twice
# (this is possible but not usual), then the advance to the next entry
# in the table must occur the second time that a time equivalent to
# 00:00:00 UTC is used. Thus, using the same example as above:
#
# ...
# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds
# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds
# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds
# ...
#
# in both cases the use of timestamps based on TAI produces a smooth
# time scale with no discontinuity in the time interval. However,
# although the long-term behavior of the time scale is correct in both
# methods, the second method is technically not correct because it adds
# the extra second to the wrong day.
#
# This complexity would not be needed for negative leap seconds (if they
# are ever used). The UTC time would skip 23:59:59 and advance from
# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by
# 1 second at the same instant. This is a much easier situation to deal
# with, since the difficulty of unambiguously representing the epoch
# during the leap second does not arise.
#
# Questions or comments to:
# Judah Levine
# Time and Frequency Division
# NIST
# Boulder, Colorado
# [email protected]
#
# Last Update of leap second values: 11 January 2012
#
# The following line shows this last update date in NTP timestamp
# format. This is the date on which the most recent change to
# the leap second data was added to the file. This line can
# be identified by the unique pair of characters in the first two
# columns as shown below.
#
#$ 3535228800
#
# The NTP timestamps are in units of seconds since the NTP epoch,
# which is 1 January 1900, 00:00:00. The Modified Julian Day number
# corresponding to the NTP time stamp, X, can be computed as
#
# X/86400 + 15020
#
# where the first term converts seconds to days and the second
# term adds the MJD corresponding to the time origin defined above.
# The integer portion of the result is the integer MJD for that
# day, and any remainder is the time of day, expressed as the
# fraction of the day since 0 hours UTC. The conversion from day
# fraction to seconds or to hours, minutes, and seconds may involve
# rounding or truncation, depending on the method used in the
# computation.
#
# The data in this file will be updated periodically as new leap
# seconds are announced. In addition to being entered on the line
# above, the update time (in NTP format) will be added to the basic
# file name leap-seconds to form the name leap-seconds.<NTP TIME>.
# In addition, the generic name leap-seconds.list will always point to
# the most recent version of the file.
#
# This update procedure will be performed only when a new leap second
# is announced.
#
# The following entry specifies the expiration date of the data
# in this file in units of seconds since the origin at the instant
# 1 January 1900, 00:00:00. This expiration date will be changed
# at least twice per year whether or not a new leap second is
# announced. These semi-annual changes will be made no later
# than 1 June and 1 December of each year to indicate what
# action (if any) is to be taken on 30 June and 31 December,
# respectively. (These are the customary effective dates for new
# leap seconds.) This expiration date will be identified by a
# unique pair of characters in columns 1 and 2 as shown below.
# In the unlikely event that a leap second is announced with an
# effective date other than 30 June or 31 December, then this
# file will be edited to include that leap second as soon as it is
# announced or at least one month before the effective date
# (whichever is later).
# If an announcement by the IERS specifies that no leap second is
# scheduled, then only the expiration date of the file will
# be advanced to show that the information in the file is still
# current -- the update time stamp, the data and the name of the file
# will not change.
#
# Updated through IERS Bulletin C48
# File expires on: 28 June 2015
#
#@ 3644438400
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
2303683200 12 # 1 Jan 1973
2335219200 13 # 1 Jan 1974
2366755200 14 # 1 Jan 1975
2398291200 15 # 1 Jan 1976
2429913600 16 # 1 Jan 1977
2461449600 17 # 1 Jan 1978
2492985600 18 # 1 Jan 1979
2524521600 19 # 1 Jan 1980
2571782400 20 # 1 Jul 1981
2603318400 21 # 1 Jul 1982
2634854400 22 # 1 Jul 1983
2698012800 23 # 1 Jul 1985
2776982400 24 # 1 Jan 1988
2840140800 25 # 1 Jan 1990
2871676800 26 # 1 Jan 1991
2918937600 27 # 1 Jul 1992
2950473600 28 # 1 Jul 1993
2982009600 29 # 1 Jul 1994
3029443200 30 # 1 Jan 1996
3076704000 31 # 1 Jul 1997
3124137600 32 # 1 Jan 1999
3345062400 33 # 1 Jan 2006
3439756800 34 # 1 Jan 2009
3550089600 35 # 1 Jul 2012
#
# the following special comment contains the
# hash value of the data in this file computed
# use the secure hash algorithm as specified
# by FIPS 180-1. See the files in ~/pub/sha for
# the details of how this hash value is
# computed. Note that the hash computation
# ignores comments and whitespace characters
# in data lines. It includes the NTP values
# of both the last modification time and the
# expiration time of the file, but not the
# white space on those lines.
# the hash line is also ignored in the
# computation.
#
#h a4862ccd c6f43c6 964f3604 85944a26 b5cfad4e
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1,4 +1,3 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
+2 -2
View File
@@ -5,7 +5,7 @@
case $#-$1 in
2-|2-0*|2-*[!0-9]*)
echo "$0: wild year - $1" >&2
echo "$0: wild year: $1" >&2
exit 1 ;;
esac
@@ -31,7 +31,7 @@ case $#-$2 in
*) exit 1 ;;
esac ;;
2-*)
echo "$0: wild type - $2" >&2 ;;
echo "$0: wild type: $2" >&2 ;;
esac
echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
+30 -42
View File
@@ -1,29 +1,20 @@
# TZ zone descriptions
# tz zone descriptions (deprecated version)
#
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
# From Paul Eggert (2013-05-27):
# From Paul Eggert (2014-07-31):
# 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:
#
# This file contains a table with the following columns:
# 1. ISO 3166 2-character country code. See /usr/share/misc/iso3166.
# This identifies a country that overlaps the zone. The country may
# overlap other zones and the zone may overlap other countries.
# 2. Latitude and longitude of the zone'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).
# This location need not lie within the column-1 country.
# 3. Zone name used in value of TZ environment variable.
# Please see the 'Theory' file for how zone names are chosen.
# 4. Comments; present if and only if the country has multiple rows.
# 1. This file contains only ASCII characters.
# 2. The first data column contains exactly one country code.
#
# Columns are separated by a single tab.
# The table is sorted first by country, then 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).
#
# Lines beginning with `#' are comments.
# 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
# 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 appropriate for their practical needs. It is not intended
@@ -39,8 +30,7 @@ AI +1812-06304 America/Anguilla
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AO -0848+01314 Africa/Luanda
AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole
AQ -7750+16636 Antarctica/McMurdo McMurdo, South Pole, Scott (New Zealand time)
AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
@@ -49,6 +39,7 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
@@ -120,13 +111,12 @@ CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did n
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
CA +4531-07334 America/Montreal Eastern Time - Quebec - most locations
CA +4339-07923 America/Toronto Eastern Time - Ontario - most locations
CA +4339-07923 America/Toronto Eastern Time - Ontario & Quebec - most locations
CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario
CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations
CA +6608-06544 America/Pangnirtung Eastern Time - Pangnirtung, Nunavut
CA +744144-0944945 America/Resolute Central Standard Time - Resolute, Nunavut
CA +744144-0944945 America/Resolute Central Time - Resolute, Nunavut
CA +484531-0913718 America/Atikokan Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
CA +624900-0920459 America/Rankin_Inlet Central Time - central Nunavut
CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario
@@ -151,13 +141,10 @@ CH +4723+00832 Europe/Zurich
CI +0519-00402 Africa/Abidjan
CK -2114-15946 Pacific/Rarotonga
CL -3327-07040 America/Santiago most locations
CL -2709-10926 Pacific/Easter Easter Island & Sala y Gomez
CL -2709-10926 Pacific/Easter Easter Island
CM +0403+00942 Africa/Douala
CN +3114+12128 Asia/Shanghai east China - Beijing, Guangdong, Shanghai, etc.
CN +4545+12641 Asia/Harbin Heilongjiang (except Mohe), Jilin
CN +2934+10635 Asia/Chongqing central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
CN +4348+08735 Asia/Urumqi most of Tibet & Xinjiang
CN +3929+07559 Asia/Kashgar west Tibet & Xinjiang
CN +3114+12128 Asia/Shanghai Beijing Time
CN +4348+08735 Asia/Urumqi Xinjiang Time
CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
CU +2308-08222 America/Havana
@@ -232,7 +219,7 @@ IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT +4154+01229 Europe/Rome
JE +4912-00207 Europe/Jersey
JM +1800-07648 America/Jamaica
JM +175805-0764736 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo
KE -0117+03649 Africa/Nairobi
@@ -339,23 +326,26 @@ RE -2052+05528 Indian/Reunion
RO +4426+02606 Europe/Bucharest
RS +4450+02030 Europe/Belgrade
RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
RU +554521+0373704 Europe/Moscow Moscow+00 - west Russia
RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia
RU +5312+05009 Europe/Samara Moscow+00 (Moscow+01 after 2014-10-26) - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5345+08707 Asia/Novokuznetsk Moscow+03 (Moscow+04 after 2014-10-26) - Kemerovo
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +5203+11328 Asia/Chita Moscow+06 (Moscow+05 after 2014-10-26) - Zabaykalsky
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea
RU +5934+15048 Asia/Magadan Moscow+08 (Moscow+07 after 2014-10-26) - Magadan
RU +6728+15343 Asia/Srednekolymsk Moscow+08 - E Sakha, N Kuril Is
RU +5301+15839 Asia/Kamchatka Moscow+08 (Moscow+09 after 2014-10-26) - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 (Moscow+09 after 2014-10-26) - Bering Sea
RW -0157+03004 Africa/Kigali
SA +2438+04643 Asia/Riyadh
SB -0932+16012 Pacific/Guadalcanal
@@ -397,7 +387,6 @@ TZ -0648+03917 Africa/Dar_es_Salaam
UA +5026+03031 Europe/Kiev most locations
UA +4837+02218 Europe/Uzhgorod Ruthenia
UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
UA +4457+03406 Europe/Simferopol central Crimea
UG +0019+03225 Africa/Kampala
UM +1645-16931 Pacific/Johnston Johnston Atoll
UM +2813-17722 Pacific/Midway Midway Islands
@@ -421,16 +410,15 @@ US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota -
US +471551-1014640 America/North_Dakota/Beulah Central Time - North Dakota - Mercer County
US +394421-1045903 America/Denver Mountain Time
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
US +364708-1084111 America/Shiprock Mountain Time - Navajo
US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo)
US +340308-1181434 America/Los_Angeles Pacific Time
US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska
US +611305-1495401 America/Anchorage Alaska Time
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
US +643004-1652423 America/Nome Alaska Time - west Alaska
US +515248-1763929 America/Adak Aleutian Islands
US +550737-1313435 America/Metlakatla Metlakatla Time - Annette Island
US +211825-1575130 Pacific/Honolulu Hawaii
UY -3453-05611 America/Montevideo
UZ +3940+06648 Asia/Samarkand west Uzbekistan
+370
View File
@@ -0,0 +1,370 @@
# tz zone descriptions
#
# This file is in the public domain.
#
# From Paul Eggert (2014-07-31):
# This file contains a table where each row stands for a zone where
# civil time stamps 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
# of ISO 3166 2-character country codes.
# See the file '/usr/share/misc/iso3166'.
# 2. Latitude and longitude of the zone'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' file for how zone names are chosen.
# If multiple zones 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.
#
# If a zone 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).
#
# This table is intended as an aid for users, to help them select time
# zone data 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
AD +4230+00131 Europe/Andorra
AE,OM +2518+05518 Asia/Dubai
AF +3431+06912 Asia/Kabul
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills
AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
AR -2411-06518 America/Argentina/Jujuy Jujuy (JY)
AR -2649-06513 America/Argentina/Tucuman Tucumán (TM)
AR -2828-06547 America/Argentina/Catamarca Catamarca (CT), Chubut (CH)
AR -2926-06651 America/Argentina/La_Rioja La Rioja (LR)
AR -3132-06831 America/Argentina/San_Juan San Juan (SJ)
AR -3253-06849 America/Argentina/Mendoza Mendoza (MZ)
AR -3319-06621 America/Argentina/San_Luis San Luis (SL)
AR -5138-06913 America/Argentina/Rio_Gallegos Santa Cruz (SC)
AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF)
AS,UM -1416-17042 Pacific/Pago_Pago Samoa, Midway
AT +4813+01620 Europe/Vienna
AU -3133+15905 Australia/Lord_Howe Lord Howe Island
AU -5430+15857 Antarctica/Macquarie Macquarie Island
AU -4253+14719 Australia/Hobart Tasmania - most locations
AU -3956+14352 Australia/Currie Tasmania - King Island
AU -3749+14458 Australia/Melbourne Victoria
AU -3352+15113 Australia/Sydney New South Wales - most locations
AU -3157+14127 Australia/Broken_Hill New South Wales - Yancowinna
AU -2728+15302 Australia/Brisbane Queensland - most locations
AU -2016+14900 Australia/Lindeman Queensland - Holiday Islands
AU -3455+13835 Australia/Adelaide South Australia
AU -1228+13050 Australia/Darwin Northern Territory
AU -3157+11551 Australia/Perth Western Australia - most locations
AU -3143+12852 Australia/Eucla Western Australia - Eucla area
AZ +4023+04951 Asia/Baku
BB +1306-05937 America/Barbados
BD +2343+09025 Asia/Dhaka
BE +5050+00420 Europe/Brussels
BG +4241+02319 Europe/Sofia
BM +3217-06446 Atlantic/Bermuda
BN +0456+11455 Asia/Brunei
BO -1630-06809 America/La_Paz
BR -0351-03225 America/Noronha Atlantic islands
BR -0127-04829 America/Belem Amapá, E Pará
BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PB)
BR -0803-03454 America/Recife Pernambuco
BR -0712-04812 America/Araguaina Tocantins
BR -0940-03543 America/Maceio Alagoas, Sergipe
BR -1259-03831 America/Bahia Bahia
BR -2332-04637 America/Sao_Paulo S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)
BR -2027-05437 America/Campo_Grande Mato Grosso do Sul
BR -1535-05605 America/Cuiaba Mato Grosso
BR -0226-05452 America/Santarem W Pará
BR -0846-06354 America/Porto_Velho Rondônia
BR +0249-06040 America/Boa_Vista Roraima
BR -0308-06001 America/Manaus E Amazonas
BR -0640-06952 America/Eirunepe W Amazonas
BR -0958-06748 America/Rio_Branco Acre
BS +2505-07721 America/Nassau
BT +2728+08939 Asia/Thimphu
BY +5354+02734 Europe/Minsk
BZ +1730-08812 America/Belize
CA +4734-05243 America/St_Johns Newfoundland Time, including SE Labrador
CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (most places), PEI
CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
CA +4339-07923 America/Toronto Eastern Time - Ontario & Quebec - most locations
CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario
CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations
CA +6608-06544 America/Pangnirtung Eastern Time - Pangnirtung, Nunavut
CA +744144-0944945 America/Resolute Central Time - Resolute, Nunavut
CA +484531-0913718 America/Atikokan Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
CA +624900-0920459 America/Rankin_Inlet Central Time - central Nunavut
CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario
CA +4843-09434 America/Rainy_River Central Time - Rainy River & Fort Frances, Ontario
CA +5024-10439 America/Regina Central Standard Time - Saskatchewan - most locations
CA +5017-10750 America/Swift_Current Central Standard Time - Saskatchewan - midwest
CA +5333-11328 America/Edmonton Mountain Time - Alberta, east British Columbia & west Saskatchewan
CA +690650-1050310 America/Cambridge_Bay Mountain Time - west Nunavut
CA +6227-11421 America/Yellowknife Mountain Time - central Northwest Territories
CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories
CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia
CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
CA +4916-12307 America/Vancouver Pacific Time - west British Columbia
CA +6043-13503 America/Whitehorse Pacific Time - south Yukon
CA +6404-13925 America/Dawson Pacific Time - north Yukon
CC -1210+09655 Indian/Cocos
CH,DE,LI +4723+00832 Europe/Zurich Swiss time
CI,BF,GM,GN,ML,MR,SH,SL,SN,ST,TG +0519-00402 Africa/Abidjan
CK -2114-15946 Pacific/Rarotonga
CL -3327-07040 America/Santiago most locations
CL -2709-10926 Pacific/Easter Easter Island
CN +3114+12128 Asia/Shanghai Beijing Time
CN +4348+08735 Asia/Urumqi Xinjiang Time
CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
CU +2308-08222 America/Havana
CV +1455-02331 Atlantic/Cape_Verde
CW,AW,BQ,SX +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia
CZ,SK +5005+01426 Europe/Prague
DE +5230+01322 Europe/Berlin Berlin time
DK +5540+01235 Europe/Copenhagen
DO +1828-06954 America/Santo_Domingo
DZ +3647+00303 Africa/Algiers
EC -0210-07950 America/Guayaquil mainland
EC -0054-08936 Pacific/Galapagos Galápagos Islands
EE +5925+02445 Europe/Tallinn
EG +3003+03115 Africa/Cairo
EH +2709-01312 Africa/El_Aaiun
ES +4024-00341 Europe/Madrid mainland
ES +3553-00519 Africa/Ceuta Ceuta & Melilla
ES +2806-01524 Atlantic/Canary Canary Islands
FI,AX +6010+02458 Europe/Helsinki
FJ -1808+17825 Pacific/Fiji
FK -5142-05751 Atlantic/Stanley
FM +0725+15147 Pacific/Chuuk Chuuk (Truk) and Yap
FM +0658+15813 Pacific/Pohnpei Pohnpei (Ponape)
FM +0519+16259 Pacific/Kosrae Kosrae
FO +6201-00646 Atlantic/Faroe
FR +4852+00220 Europe/Paris
GB,GG,IM,JE +513030-0000731 Europe/London
GE +4143+04449 Asia/Tbilisi
GF +0456-05220 America/Cayenne
GH +0533-00013 Africa/Accra
GI +3608-00521 Europe/Gibraltar
GL +6411-05144 America/Godthab most locations
GL +7646-01840 America/Danmarkshavn east coast, north of Scoresbysund
GL +7029-02158 America/Scoresbysund Scoresbysund / Ittoqqortoormiit
GL +7634-06847 America/Thule Thule / Pituffik
GR +3758+02343 Europe/Athens
GS -5416-03632 Atlantic/South_Georgia
GT +1438-09031 America/Guatemala
GU,MP +1328+14445 Pacific/Guam
GW +1151-01535 Africa/Bissau
GY +0648-05810 America/Guyana
HK +2217+11409 Asia/Hong_Kong
HN +1406-08713 America/Tegucigalpa
HT +1832-07220 America/Port-au-Prince
HU +4730+01905 Europe/Budapest
ID -0610+10648 Asia/Jakarta Java & Sumatra
ID -0002+10920 Asia/Pontianak west & central Borneo
ID -0507+11924 Asia/Makassar east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
ID -0232+14042 Asia/Jayapura west New Guinea (Irian Jaya) & Malukus (Moluccas)
IE +5320-00615 Europe/Dublin
IL +314650+0351326 Asia/Jerusalem
IN +2232+08822 Asia/Kolkata
IO -0720+07225 Indian/Chagos
IQ +3321+04425 Asia/Baghdad
IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT,SM,VA +4154+01229 Europe/Rome
JM +175805-0764736 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo
KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi
KG +4254+07436 Asia/Bishkek
KI +0125+17300 Pacific/Tarawa Gilbert Islands
KI -0308-17105 Pacific/Enderbury Phoenix Islands
KI +0152-15720 Pacific/Kiritimati Line Islands
KP +3901+12545 Asia/Pyongyang
KR +3733+12658 Asia/Seoul
KZ +4315+07657 Asia/Almaty most locations
KZ +4448+06528 Asia/Qyzylorda Qyzylorda (Kyzylorda, Kzyl-Orda)
KZ +5017+05710 Asia/Aqtobe Aqtobe (Aktobe)
KZ +4431+05016 Asia/Aqtau Atyrau (Atirau, Gur'yev), Mangghystau (Mankistau)
KZ +5113+05121 Asia/Oral West Kazakhstan
LB +3353+03530 Asia/Beirut
LK +0656+07951 Asia/Colombo
LR +0618-01047 Africa/Monrovia
LT +5441+02519 Europe/Vilnius
LU +4936+00609 Europe/Luxembourg
LV +5657+02406 Europe/Riga
LY +3254+01311 Africa/Tripoli
MA +3339-00735 Africa/Casablanca
MC +4342+00723 Europe/Monaco
MD +4700+02850 Europe/Chisinau
MH +0709+17112 Pacific/Majuro most locations
MH +0905+16720 Pacific/Kwajalein Kwajalein
MM +1647+09610 Asia/Rangoon
MN +4755+10653 Asia/Ulaanbaatar most locations
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
MQ +1436-06105 America/Martinique
MT +3554+01431 Europe/Malta
MU -2010+05730 Indian/Mauritius
MV +0410+07330 Indian/Maldives
MX +1924-09909 America/Mexico_City Central Time - most locations
MX +2105-08646 America/Cancun Central Time - Quintana Roo
MX +2058-08937 America/Merida Central Time - Campeche, Yucatán
MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo León, Tamaulipas away from US border
MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo León, Tamaulipas near US border
MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa
MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border
MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border
MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora
MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border
MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border
MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahía de Banderas
MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia
MY +0133+11020 Asia/Kuching Sabah & Sarawak
MZ,BI,BW,CD,MW,RW,ZM,ZW -2558+03235 Africa/Maputo Central Africa Time (UTC+2)
NA -2234+01706 Africa/Windhoek
NC -2216+16627 Pacific/Noumea
NF -2903+16758 Pacific/Norfolk
NG,AO,BJ,CD,CF,CG,CM,GA,GQ,NE +0627+00324 Africa/Lagos West Africa Time (UTC+1)
NI +1209-08617 America/Managua
NL +5222+00454 Europe/Amsterdam
NO,SJ +5955+01045 Europe/Oslo
NP +2743+08519 Asia/Kathmandu
NR -0031+16655 Pacific/Nauru
NU -1901-16955 Pacific/Niue
NZ,AQ -3652+17446 Pacific/Auckland New Zealand time
NZ -4357-17633 Pacific/Chatham Chatham Islands
PA,KY +0858-07932 America/Panama
PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands
PF -2308-13457 Pacific/Gambier Gambier Islands
PG -0930+14710 Pacific/Port_Moresby
PH +1435+12100 Asia/Manila
PK +2452+06703 Asia/Karachi
PL +5215+02100 Europe/Warsaw
PM +4703-05620 America/Miquelon
PN -2504-13005 Pacific/Pitcairn
PR +182806-0660622 America/Puerto_Rico
PS +3130+03428 Asia/Gaza Gaza Strip
PS +313200+0350542 Asia/Hebron West Bank
PT +3843-00908 Europe/Lisbon mainland
PT +3238-01654 Atlantic/Madeira Madeira Islands
PT +3744-02540 Atlantic/Azores Azores
PW +0720+13429 Pacific/Palau
PY -2516-05740 America/Asuncion
QA,BH +2517+05132 Asia/Qatar
RE,TF -2052+05528 Indian/Reunion Réunion, Crozet Is, Scattered Is
RO +4426+02606 Europe/Bucharest
RS,BA,HR,ME,MK,SI +4450+02030 Europe/Belgrade
RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
RU +554521+0373704 Europe/Moscow Moscow+00 - west Russia
RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
RU +5312+05009 Europe/Samara Moscow+00 (Moscow+01 after 2014-10-26) - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
RU +5345+08707 Asia/Novokuznetsk Moscow+03 (Moscow+04 after 2014-10-26) - Kemerovo
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +5203+11328 Asia/Chita Moscow+06 (Moscow+05 after 2014-10-26) - Zabaykalsky
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 (Moscow+07 after 2014-10-26) - Magadan
RU +6728+15343 Asia/Srednekolymsk Moscow+08 - E Sakha, N Kuril Is
RU +5301+15839 Asia/Kamchatka Moscow+08 (Moscow+09 after 2014-10-26) - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 (Moscow+09 after 2014-10-26) - Bering Sea
SA,KW,YE +2438+04643 Asia/Riyadh
SB -0932+16012 Pacific/Guadalcanal
SC -0440+05528 Indian/Mahe
SD,SS +1536+03232 Africa/Khartoum
SE +5920+01803 Europe/Stockholm
SG +0117+10351 Asia/Singapore
SR +0550-05510 America/Paramaribo
SV +1342-08912 America/El_Salvador
SY +3330+03618 Asia/Damascus
TC +2128-07108 America/Grand_Turk
TD +1207+01503 Africa/Ndjamena
TF -492110+0701303 Indian/Kerguelen Kerguelen, St Paul I, Amsterdam I
TH,KH,LA,VN +1345+10031 Asia/Bangkok
TJ +3835+06848 Asia/Dushanbe
TK -0922-17114 Pacific/Fakaofo
TL -0833+12535 Asia/Dili
TM +3757+05823 Asia/Ashgabat
TN +3648+01011 Africa/Tunis
TO -2110-17510 Pacific/Tongatapu
TR +4101+02858 Europe/Istanbul
TT,AG,AI,BL,DM,GD,GP,MF,LC,KN,MS,VC,VG,VI +1039-06131 America/Port_of_Spain
TV -0831+17913 Pacific/Funafuti
TW +2503+12130 Asia/Taipei
UA +5026+03031 Europe/Kiev most locations
UA +4837+02218 Europe/Uzhgorod Ruthenia
UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
UM +1917+16637 Pacific/Wake Wake Island
US +404251-0740023 America/New_York Eastern Time
US +421953-0830245 America/Detroit Eastern Time - Michigan - most locations
US +381515-0854534 America/Kentucky/Louisville Eastern Time - Kentucky - Louisville area
US +364947-0845057 America/Kentucky/Monticello Eastern Time - Kentucky - Wayne County
US +394606-0860929 America/Indiana/Indianapolis Eastern Time - Indiana - most locations
US +384038-0873143 America/Indiana/Vincennes Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties
US +410305-0863611 America/Indiana/Winamac Eastern Time - Indiana - Pulaski County
US +382232-0862041 America/Indiana/Marengo Eastern Time - Indiana - Crawford County
US +382931-0871643 America/Indiana/Petersburg Eastern Time - Indiana - Pike County
US +384452-0850402 America/Indiana/Vevay Eastern Time - Indiana - Switzerland County
US +415100-0873900 America/Chicago Central Time
US +375711-0864541 America/Indiana/Tell_City Central Time - Indiana - Perry County
US +411745-0863730 America/Indiana/Knox Central Time - Indiana - Starke County
US +450628-0873651 America/Menominee Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County
US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota - Morton County (except Mandan area)
US +471551-1014640 America/North_Dakota/Beulah Central Time - North Dakota - Mercer County
US +394421-1045903 America/Denver Mountain Time
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo)
US +340308-1181434 America/Los_Angeles Pacific Time
US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska
US +611305-1495401 America/Anchorage Alaska Time
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
US +643004-1652423 America/Nome Alaska Time - west Alaska
US +515248-1763929 America/Adak Aleutian Islands
US,UM +211825-1575130 Pacific/Honolulu Hawaii time
UY -3453-05611 America/Montevideo
UZ +3940+06648 Asia/Samarkand west Uzbekistan
UZ +4120+06918 Asia/Tashkent east Uzbekistan
VE +1030-06656 America/Caracas
VU -1740+16825 Pacific/Efate
WF -1318-17610 Pacific/Wallis
WS -1350-17144 Pacific/Apia
ZA,LS,SZ -2615+02800 Africa/Johannesburg
+1 -1
View File
@@ -117,7 +117,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_status,
num = 0;
p = prf_out->value;
while(desired_output_len > 0) {
_gsskrb5_encode_om_uint32(num, input.data);
_gsskrb5_encode_be_om_uint32(num, input.data);
ret = krb5_crypto_prf(context, crypto, &input, &output);
if (ret) {
OM_uint32 junk;
+18
View File
@@ -518,6 +518,24 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
case 100:
str_details2 = " no_renegotiation";
break;
case 110:
str_details2 = " unsupported_extension";
break;
case 111:
str_details2 = " certificate_unobtainable";
break;
case 112:
str_details2 = " unrecognized_name";
break;
case 113:
str_details2 = " bad_certificate_status_response";
break;
case 114:
str_details2 = " bad_certificate_hash_value";
break;
case 115:
str_details2 = " unknown_psk_identity";
break;
}
}
}
+10
View File
@@ -226,6 +226,7 @@ static void sc_usage(void)
BIO_printf(bio_err," -ssl3 - just use SSLv3\n");
BIO_printf(bio_err," -tls1 - just use TLSv1\n");
BIO_printf(bio_err," -dtls1 - just use DTLSv1\n");
BIO_printf(bio_err," -fallback_scsv - send TLS_FALLBACK_SCSV\n");
BIO_printf(bio_err," -mtu - set the link layer MTU\n");
BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n");
@@ -339,6 +340,7 @@ int MAIN(int argc, char **argv)
char *sess_out = NULL;
struct sockaddr peer;
int peerlen = sizeof(peer);
int fallback_scsv = 0;
int enable_timeouts = 0 ;
long socket_mtu = 0;
#ifndef OPENSSL_NO_JPAKE
@@ -488,6 +490,10 @@ int MAIN(int argc, char **argv)
socket_mtu = atol(*(++argv));
}
#endif
else if (strcmp(*argv,"-fallback_scsv") == 0)
{
fallback_scsv = 1;
}
else if (strcmp(*argv,"-bugs") == 0)
bugs=1;
else if (strcmp(*argv,"-keyform") == 0)
@@ -778,6 +784,10 @@ bad:
SSL_set_session(con, sess);
SSL_SESSION_free(sess);
}
if (fallback_scsv)
SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV);
#ifndef OPENSSL_NO_TLSEXT
if (servername != NULL)
{
+21 -9
View File
@@ -285,16 +285,28 @@ err:
ASN1_OBJECT_free(ret);
return(NULL);
}
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
long len)
{
ASN1_OBJECT *ret=NULL;
const unsigned char *p;
int i;
/* Sanity check OID encoding: can't have leading 0x80 in
* subidentifiers, see: X.690 8.19.2
int i, length;
/* Sanity check OID encoding.
* Need at least one content octet.
* MSB must be clear in the last octet.
* can't have leading 0x80 in subidentifiers, see: X.690 8.19.2
*/
for (i = 0, p = *pp; i < len; i++, p++)
if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
p[len - 1] & 0x80)
{
ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
return NULL;
}
/* Now 0 < len <= INT_MAX, so the cast is safe. */
length = (int)len;
for (i = 0; i < length; i++, p++)
{
if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
{
@@ -313,20 +325,20 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
else ret=(*a);
p= *pp;
if ((ret->data == NULL) || (ret->length < len))
if ((ret->data == NULL) || (ret->length < length))
{
if (ret->data != NULL) OPENSSL_free(ret->data);
ret->data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1);
ret->data=(unsigned char *)OPENSSL_malloc(length);
ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
if (ret->data == NULL)
{ i=ERR_R_MALLOC_FAILURE; goto err; }
}
memcpy(ret->data,p,(int)len);
ret->length=(int)len;
memcpy(ret->data,p,length);
ret->length=length;
ret->sn=NULL;
ret->ln=NULL;
/* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
p+=len;
p+=length;
if (a != NULL) (*a)=ret;
*pp=p;
+11
View File
@@ -511,6 +511,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
/* Deprecated versions */
#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
@@ -740,11 +742,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
#define bn_fix_top(a) bn_check_top(a)
#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
#define bn_wcheck_size(bn, words) \
do { \
const BIGNUM *_bnum2 = (bn); \
assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
} while(0)
#else /* !BN_DEBUG */
#define bn_pollute(a)
#define bn_check_top(a)
#define bn_fix_top(a) bn_correct_top(a)
#define bn_check_size(bn, bits)
#define bn_wcheck_size(bn, words)
#endif
+52
View File
@@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
}
return bn_cmp_words(a,b,cl);
}
/*
* Constant-time conditional swap of a and b.
* a and b are swapped if condition is not 0. The code assumes that at most one bit of condition is set.
* nwords is the number of words to swap. The code assumes that at least nwords are allocated in both a and b,
* and that no more than nwords are used by either a or b.
* a and b cannot be the same number
*/
void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
{
BN_ULONG t;
int i;
bn_wcheck_size(a, nwords);
bn_wcheck_size(b, nwords);
assert(a != b);
assert((condition & (condition - 1)) == 0);
assert(sizeof(BN_ULONG) >= sizeof(int));
condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
t = (a->top^b->top) & condition;
a->top ^= t;
b->top ^= t;
#define BN_CONSTTIME_SWAP(ind) \
do { \
t = (a->d[ind] ^ b->d[ind]) & condition; \
a->d[ind] ^= t; \
b->d[ind] ^= t; \
} while (0)
switch (nwords) {
default:
for (i = 10; i < nwords; i++)
BN_CONSTTIME_SWAP(i);
/* Fallthrough */
case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
case 1: BN_CONSTTIME_SWAP(0);
}
#undef BN_CONSTTIME_SWAP
}
+15 -11
View File
@@ -208,9 +208,12 @@ static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIG
/* Computes scalar*point and stores the result in r.
* point can not equal r.
* Uses algorithm 2P of
* Uses a modified algorithm 2P of
* Lopex, J. and Dahab, R. "Fast multiplication on elliptic curves over
* GF(2^m) without precomputation".
*
* To protect against side-channel attack the function uses constant time
* swap avoiding conditional branches.
*/
static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
const EC_POINT *point, BN_CTX *ctx)
@@ -244,6 +247,11 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
x2 = &r->X;
z2 = &r->Y;
bn_wexpand(x1, group->field.top);
bn_wexpand(z1, group->field.top);
bn_wexpand(x2, group->field.top);
bn_wexpand(z2, group->field.top);
if (!BN_GF2m_mod_arr(x1, &point->X, group->poly)) goto err; /* x1 = x */
if (!BN_one(z1)) goto err; /* z1 = 1 */
if (!group->meth->field_sqr(group, z2, x1, ctx)) goto err; /* z2 = x1^2 = x^2 */
@@ -266,16 +274,12 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
{
for (; j >= 0; j--)
{
if (scalar->d[i] & mask)
{
if (!gf2m_Madd(group, &point->X, x1, z1, x2, z2, ctx)) goto err;
if (!gf2m_Mdouble(group, x2, z2, ctx)) goto err;
}
else
{
if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err;
if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err;
}
BN_consttime_swap(scalar->d[i] & mask, x1, x2, group->field.top);
BN_consttime_swap(scalar->d[i] & mask, z1, z2, group->field.top);
if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err;
if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err;
BN_consttime_swap(scalar->d[i] & mask, x1, x2, group->field.top);
BN_consttime_swap(scalar->d[i] & mask, z1, z2, group->field.top);
mask >>= 1;
}
j = BN_BITS2 - 1;
+6
View File
@@ -69,8 +69,14 @@ R SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
R SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
R SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
R SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
R SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
R SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
R SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
R SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
R SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
R SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
R SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
R SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
R RSAREF_R_CONTENT_ENCODING 0x0400
R RSAREF_R_DATA 0x0401
+9 -7
View File
@@ -444,11 +444,12 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
unsigned char *p;
char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
if ((a == NULL) || (a->data == NULL)) {
buf[0]='\0';
return(0);
}
/* Ensure that, at every state, |buf| is NUL-terminated. */
if (buf && buf_len > 0)
buf[0] = '\0';
if ((a == NULL) || (a->data == NULL))
return(0);
if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
{
@@ -527,9 +528,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
i=(int)(l/40);
l-=(long)(i*40);
}
if (buf && (buf_len > 0))
if (buf && (buf_len > 1))
{
*buf++ = i + '0';
*buf = '\0';
buf_len--;
}
n++;
@@ -544,9 +546,10 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
i = strlen(bndec);
if (buf)
{
if (buf_len > 0)
if (buf_len > 1)
{
*buf++ = '.';
*buf = '\0';
buf_len--;
}
BUF_strlcpy(buf,bndec,buf_len);
@@ -786,4 +789,3 @@ err:
OPENSSL_free(buf);
return(ok);
}
+7 -3
View File
@@ -34,6 +34,7 @@ B<openssl> B<s_client>
[B<-no_ssl2>]
[B<-no_ssl3>]
[B<-no_tls1>]
[B<-fallback_scsv>]
[B<-bugs>]
[B<-cipher cipherlist>]
[B<-starttls protocol>]
@@ -167,10 +168,13 @@ these options disable the use of certain SSL or TLS protocols. By default
the initial handshake uses a method which should be compatible with all
servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
Unfortunately there are a lot of ancient and broken servers in use which
Unfortunately there are still ancient and broken servers in use which
cannot handle this technique and will fail to connect. Some servers only
work if TLS is turned off with the B<-no_tls> option others will only
support SSL v2 and may need the B<-ssl2> option.
work if TLS is turned off.
=item B<-fallback_scsv>
Send TLS_FALLBACK_SCSV in the ClientHello.
=item B<-bugs>
@@ -61,6 +61,12 @@ deal with read/write operations returning without success report. The
flag SSL_MODE_AUTO_RETRY will cause read/write operations to only
return after the handshake and successful completion.
=item SSL_MODE_FALLBACK_SCSV
Send TLS_FALLBACK_SCSV in the ClientHello.
To be set by applications that reconnect with a downgraded protocol
version; see draft-ietf-tls-downgrade-scsv-00 for details.
=back
=head1 RETURN VALUES
+58 -27
View File
@@ -580,29 +580,32 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok)
return 0;
}
/* dtls1_max_handshake_message_len returns the maximum number of bytes
* permitted in a DTLS handshake message for |s|. The minimum is 16KB, but may
* be greater if the maximum certificate list size requires it. */
static unsigned long dtls1_max_handshake_message_len(const SSL *s)
{
unsigned long max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
if (max_len < (unsigned long)s->max_cert_list)
return s->max_cert_list;
return max_len;
}
static int
dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
dtls1_reassemble_fragment(SSL *s, const struct hm_header_st* msg_hdr, int *ok)
{
hm_fragment *frag = NULL;
pitem *item = NULL;
int i = -1, is_complete;
PQ_64BIT seq64;
unsigned long frag_len = msg_hdr->frag_len, max_len;
unsigned long frag_len = msg_hdr->frag_len;
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len ||
msg_hdr->msg_len > dtls1_max_handshake_message_len(s))
goto err;
/* Determine maximum allowed message size. Depends on (user set)
* maximum certificate length, but 16k is minimum.
*/
if (DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH < s->max_cert_list)
max_len = s->max_cert_list;
else
max_len = DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
if ((msg_hdr->frag_off+frag_len) > max_len)
goto err;
if (frag_len == 0)
return DTLS1_HM_FRAGMENT_RETRY;
/* Try to find item in queue */
pq_64bit_init(&seq64);
@@ -620,10 +623,20 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
frag->msg_header.frag_off = 0;
}
else
{
frag = (hm_fragment*) item->data;
if (frag->msg_header.msg_len != msg_hdr->msg_len)
{
item = NULL;
frag = NULL;
goto err;
}
}
/* If message is already reassembled, this must be a
* retransmit and can be dropped.
* retransmit and can be dropped. In this case item != NULL and so frag
* does not need to be freed.
*/
if (frag->reassembly == NULL)
{
@@ -643,7 +656,9 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
/* read the body of the fragment (header has already been read */
i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
frag->fragment + msg_hdr->frag_off,frag_len,0);
if (i<=0 || (unsigned long)i!=frag_len)
if ((unsigned long)i!=frag_len)
i=-1;
if (i<=0)
goto err;
RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off,
@@ -671,21 +686,25 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
i = -1;
}
pqueue_insert(s->d1->buffered_messages, item);
item = pqueue_insert(s->d1->buffered_messages, item);
/* pqueue_insert fails iff a duplicate item is inserted.
* However, |item| cannot be a duplicate. If it were,
* |pqueue_find|, above, would have returned it and control
* would never have reached this branch. */
OPENSSL_assert(item != NULL);
}
return DTLS1_HM_FRAGMENT_RETRY;
err:
if (frag != NULL) dtls1_hm_fragment_free(frag);
if (item != NULL) OPENSSL_free(item);
if (frag != NULL && item == NULL) dtls1_hm_fragment_free(frag);
*ok = 0;
return i;
}
static int
dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st* msg_hdr, int *ok)
{
int i=-1;
hm_fragment *frag = NULL;
@@ -705,7 +724,7 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
/* If we already have an entry and this one is a fragment,
* don't discard it and rather try to reassemble it.
*/
if (item != NULL && frag_len < msg_hdr->msg_len)
if (item != NULL && frag_len != msg_hdr->msg_len)
item = NULL;
/* Discard the message if sequence number was already there, is
@@ -730,9 +749,12 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
}
else
{
if (frag_len && frag_len < msg_hdr->msg_len)
if (frag_len != msg_hdr->msg_len)
return dtls1_reassemble_fragment(s, msg_hdr, ok);
if (frag_len > dtls1_max_handshake_message_len(s))
goto err;
frag = dtls1_hm_fragment_new(frag_len, 0);
if ( frag == NULL)
goto err;
@@ -744,7 +766,9 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
/* read the body of the fragment (header has already been read) */
i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
frag->fragment,frag_len,0);
if (i<=0 || (unsigned long)i!=frag_len)
if ((unsigned long)i!=frag_len)
i = -1;
if (i<=0)
goto err;
}
@@ -756,14 +780,21 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
if ( item == NULL)
goto err;
pqueue_insert(s->d1->buffered_messages, item);
item = pqueue_insert(s->d1->buffered_messages, item);
/* pqueue_insert fails iff a duplicate item is inserted.
* However, |item| cannot be a duplicate. If it were,
* |pqueue_find|, above, would have returned it. Then, either
* |frag_len| != |msg_hdr->msg_len| in which case |item| is set
* to NULL and it will have been processed with
* |dtls1_reassemble_fragment|, above, or the record will have
* been discarded. */
OPENSSL_assert(item != NULL);
}
return DTLS1_HM_FRAGMENT_RETRY;
err:
if ( frag != NULL) dtls1_hm_fragment_free(frag);
if ( item != NULL) OPENSSL_free(item);
if (frag != NULL && item == NULL) dtls1_hm_fragment_free(frag);
*ok = 0;
return i;
}
@@ -777,6 +808,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
int i,al;
struct hm_header_st msg_hdr;
redo:
/* see if we have the required fragment already */
if ((frag_len = dtls1_retrieve_buffered_fragment(s,max,ok)) || *ok)
{
@@ -835,8 +867,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
s->msg_callback_arg);
s->init_num = 0;
return dtls1_get_message_fragment(s, st1, stn,
max, ok);
goto redo;
}
else /* Incorrectly formated Hello request */
{
+14 -2
View File
@@ -796,6 +796,13 @@ int dtls1_send_client_key_exchange(SSL *s)
RSA *rsa;
unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
if (s->session->sess_cert == NULL)
{
/* We should always have a server certificate with SSL_kRSA. */
SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR);
goto err;
}
if (s->session->sess_cert->peer_rsa_tmp != NULL)
rsa=s->session->sess_cert->peer_rsa_tmp;
else
@@ -986,6 +993,13 @@ int dtls1_send_client_key_exchange(SSL *s)
{
DH *dh_srvr,*dh_clnt;
if (s->session->sess_cert == NULL)
{
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE);
SSLerr(SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE);
goto err;
}
if (s->session->sess_cert->peer_dh_tmp != NULL)
dh_srvr=s->session->sess_cert->peer_dh_tmp;
else
@@ -1226,5 +1240,3 @@ int dtls1_send_client_certificate(SSL *s)
/* SSL3_ST_CW_CERT_D */
return(dtls1_do_write(s,SSL3_RT_HANDSHAKE));
}
+10
View File
@@ -301,6 +301,16 @@ long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg)
case DTLS_CTRL_LISTEN:
ret = dtls1_listen(s, parg);
break;
case SSL_CTRL_CHECK_PROTO_VERSION:
/* For library-internal use; checks that the current protocol
* is the highest enabled version (according to s->ctx->method,
* as version negotiation may have changed s->method). */
#if DTLS_MAX_VERSION != DTLS1_VERSION
# error Code needs update for DTLS_method() support beyond DTLS1_VERSION.
#endif
/* Just one protocol version is supported so far;
* fail closed if the version is not as expected. */
return s->version == DTLS_MAX_VERSION;
default:
ret = ssl3_ctrl(s, cmd, larg, parg);
+2 -1
View File
@@ -80,6 +80,8 @@ extern "C" {
#endif
#define DTLS1_VERSION 0xFEFF
#define DTLS_MAX_VERSION DTLS1_VERSION
#define DTLS1_BAD_VER 0x0100
#if 0
@@ -262,4 +264,3 @@ typedef struct dtls1_record_data_st
}
#endif
#endif
+59 -48
View File
@@ -72,9 +72,11 @@ static SSL_METHOD *ssl23_get_client_method(int ver)
if (ver == SSL2_VERSION)
return(SSLv2_client_method());
#endif
#ifndef OPENSSL_NO_SSL3
if (ver == SSL3_VERSION)
return(SSLv3_client_method());
else if (ver == TLS1_VERSION)
#endif
if (ver == TLS1_VERSION)
return(TLSv1_client_method());
else
return(NULL);
@@ -509,7 +511,7 @@ static int ssl23_get_server_hello(SSL *s)
/* use special padding (SSL 3.0 draft/RFC 2246, App. E.2) */
s->s2->ssl2_rollback=1;
/* setup the 5 bytes we have read so we get them from
/* setup the 7 bytes we have read so we get them from
* the sslv2 buffer */
s->rstate=SSL_ST_READ_HEADER;
s->packet_length=n;
@@ -525,28 +527,15 @@ static int ssl23_get_server_hello(SSL *s)
s->handshake_func=s->method->ssl_connect;
#endif
}
else if ((p[0] == SSL3_RT_HANDSHAKE) &&
(p[1] == SSL3_VERSION_MAJOR) &&
((p[2] == SSL3_VERSION_MINOR) ||
(p[2] == TLS1_VERSION_MINOR)) &&
(p[5] == SSL3_MT_SERVER_HELLO))
else if (p[1] == SSL3_VERSION_MAJOR &&
((p[2] == SSL3_VERSION_MINOR) ||
(p[2] == TLS1_VERSION_MINOR)) &&
((p[0] == SSL3_RT_HANDSHAKE && p[5] == SSL3_MT_SERVER_HELLO) ||
(p[0] == SSL3_RT_ALERT && p[3] == 0 && p[4] == 2)))
{
/* we have sslv3 or tls1 */
if (!ssl_init_wbio_buffer(s,1)) goto err;
/* we are in this state */
s->state=SSL3_ST_CR_SRVR_HELLO_A;
/* put the 5 bytes we have read into the input buffer
* for SSLv3 */
s->rstate=SSL_ST_READ_HEADER;
s->packet_length=n;
s->packet= &(s->s3->rbuf.buf[0]);
memcpy(s->packet,buf,n);
s->s3->rbuf.left=n;
s->s3->rbuf.offset=0;
/* we have sslv3 or tls1 (server hello or alert) */
#ifndef OPENSSL_NO_SSL3
if ((p[2] == SSL3_VERSION_MINOR) &&
!(s->options & SSL_OP_NO_SSLv3))
{
@@ -561,7 +550,9 @@ static int ssl23_get_server_hello(SSL *s)
s->version=SSL3_VERSION;
s->method=SSLv3_client_method();
}
else if ((p[2] == TLS1_VERSION_MINOR) &&
else
#endif
if ((p[2] == TLS1_VERSION_MINOR) &&
!(s->options & SSL_OP_NO_TLSv1))
{
s->version=TLS1_VERSION;
@@ -572,35 +563,55 @@ static int ssl23_get_server_hello(SSL *s)
SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL);
goto err;
}
s->handshake_func=s->method->ssl_connect;
}
else if ((p[0] == SSL3_RT_ALERT) &&
(p[1] == SSL3_VERSION_MAJOR) &&
((p[2] == SSL3_VERSION_MINOR) ||
(p[2] == TLS1_VERSION_MINOR)) &&
(p[3] == 0) &&
(p[4] == 2))
{
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int j;
/* An alert */
if (s->info_callback != NULL)
cb=s->info_callback;
else if (s->ctx->info_callback != NULL)
cb=s->ctx->info_callback;
i=p[5];
if (cb != NULL)
/* ensure that TLS_MAX_VERSION is up-to-date */
OPENSSL_assert(s->version <= TLS_MAX_VERSION);
if (p[0] == SSL3_RT_ALERT && p[5] != SSL3_AL_WARNING)
{
j=(i<<8)|p[6];
cb(s,SSL_CB_READ_ALERT,j);
/* fatal alert */
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int j;
if (s->info_callback != NULL)
cb=s->info_callback;
else if (s->ctx->info_callback != NULL)
cb=s->ctx->info_callback;
i=p[5];
if (cb != NULL)
{
j=(i<<8)|p[6];
cb(s,SSL_CB_READ_ALERT,j);
}
if (s->msg_callback)
s->msg_callback(0, s->version, SSL3_RT_ALERT, p+5, 2, s, s->msg_callback_arg);
s->rwstate=SSL_NOTHING;
SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_AD_REASON_OFFSET+p[6]);
goto err;
}
s->rwstate=SSL_NOTHING;
SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_AD_REASON_OFFSET+p[6]);
goto err;
if (!ssl_init_wbio_buffer(s,1)) goto err;
/* we are in this state */
s->state=SSL3_ST_CR_SRVR_HELLO_A;
/* put the 7 bytes we have read into the input buffer
* for SSLv3 */
s->rstate=SSL_ST_READ_HEADER;
s->packet_length=n;
if (s->s3->rbuf.buf == NULL)
if (!ssl3_setup_buffers(s))
goto err;
s->packet= &(s->s3->rbuf.buf[0]);
memcpy(s->packet,buf,n);
s->s3->rbuf.left=n;
s->s3->rbuf.offset=0;
s->handshake_func=s->method->ssl_connect;
}
else
{
+35 -13
View File
@@ -124,9 +124,11 @@ static SSL_METHOD *ssl23_get_server_method(int ver)
if (ver == SSL2_VERSION)
return(SSLv2_server_method());
#endif
#ifndef OPENSSL_NO_SSL3
if (ver == SSL3_VERSION)
return(SSLv3_server_method());
else if (ver == TLS1_VERSION)
#endif
if (ver == TLS1_VERSION)
return(TLSv1_server_method());
else
return(NULL);
@@ -328,23 +330,19 @@ int ssl23_get_client_hello(SSL *s)
* Client Hello message, this would be difficult, and we'd have
* to read more records to find out.
* No known SSL 3.0 client fragments ClientHello like this,
* so we simply assume TLS 1.0 to avoid protocol version downgrade
* attacks. */
* so we simply reject such connections to avoid
* protocol version downgrade attacks. */
if (p[3] == 0 && p[4] < 6)
{
#if 0
SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_TOO_SMALL);
goto err;
#else
v[1] = TLS1_VERSION_MINOR;
#endif
}
/* if major version number > 3 set minor to a value
* which will use the highest version 3 we support.
* If TLS 2.0 ever appears we will need to revise
* this....
*/
else if (p[9] > SSL3_VERSION_MAJOR)
if (p[9] > SSL3_VERSION_MAJOR)
v[1]=0xff;
else
v[1]=p[10]; /* minor version according to client_version */
@@ -402,6 +400,9 @@ int ssl23_get_client_hello(SSL *s)
}
#endif
/* ensure that TLS_MAX_VERSION is up-to-date */
OPENSSL_assert(s->version <= TLS_MAX_VERSION);
if (s->state == SSL23_ST_SR_CLNT_HELLO_B)
{
/* we have SSLv3/TLSv1 in an SSLv2 header
@@ -412,14 +413,34 @@ int ssl23_get_client_hello(SSL *s)
v[0] = p[3]; /* == SSL3_VERSION_MAJOR */
v[1] = p[4];
/* An SSLv3/TLSv1 backwards-compatible CLIENT-HELLO in an SSLv2
* header is sent directly on the wire, not wrapped as a TLS
* record. It's format is:
* Byte Content
* 0-1 msg_length
* 2 msg_type
* 3-4 version
* 5-6 cipher_spec_length
* 7-8 session_id_length
* 9-10 challenge_length
* ... ...
*/
n=((p[0]&0x7f)<<8)|p[1];
if (n > (1024*4))
{
SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_TOO_LARGE);
goto err;
}
if (n < 9)
{
SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_RECORD_LENGTH_MISMATCH);
goto err;
}
j=ssl23_read_bytes(s,n+2);
/* We previously read 11 bytes, so if j > 0, we must have
* j == n+2 == s->packet_length. We have at least 11 valid
* packet bytes. */
if (j <= 0) return(j);
ssl3_finish_mac(s, s->packet+2, s->packet_length-2);
@@ -538,6 +559,12 @@ int ssl23_get_client_hello(SSL *s)
if ((type == 2) || (type == 3))
{
/* we have SSLv3/TLSv1 (type 2: SSL2 style, type 3: SSL3/TLS style) */
s->method = ssl23_get_server_method(s->version);
if (s->method == NULL)
{
SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNSUPPORTED_PROTOCOL);
goto err;
}
if (!ssl_init_wbio_buffer(s,1)) goto err;
@@ -561,11 +588,6 @@ int ssl23_get_client_hello(SSL *s)
s->s3->rbuf.left=0;
s->s3->rbuf.offset=0;
}
if (s->version == TLS1_VERSION)
s->method = TLSv1_server_method();
else
s->method = SSLv3_server_method();
#if 0 /* ssl3_get_client_hello does this */
s->client_version=(v[0]<<8)|v[1];
#endif
+3 -1
View File
@@ -314,6 +314,8 @@ long ssl2_ctrl(SSL *s, int cmd, long larg, void *parg)
case SSL_CTRL_GET_SESSION_REUSED:
ret=s->hit;
break;
case SSL_CTRL_CHECK_PROTO_VERSION:
return ssl3_ctrl(s, SSL_CTRL_CHECK_PROTO_VERSION, larg, parg);
default:
break;
}
@@ -362,7 +364,7 @@ int ssl2_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
if (p != NULL)
{
l=c->id;
if ((l & 0xff000000) != 0x02000000) return(0);
if ((l & 0xff000000) != 0x02000000 && l != SSL3_CK_FALLBACK_SCSV) return(0);
p[0]=((unsigned char)(l>>16L))&0xFF;
p[1]=((unsigned char)(l>> 8L))&0xFF;
p[2]=((unsigned char)(l ))&0xFF;
+16
View File
@@ -491,6 +491,7 @@ int ssl3_connect(SSL *s)
case SSL3_ST_CR_FINISHED_A:
case SSL3_ST_CR_FINISHED_B:
s->s3->flags |= SSL3_FLAGS_CCS_OK;
ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A,
SSL3_ST_CR_FINISHED_B);
if (ret <= 0) goto end;
@@ -777,6 +778,7 @@ int ssl3_get_server_hello(SSL *s)
SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT);
goto f_err;
}
s->s3->flags |= SSL3_FLAGS_CCS_OK;
s->hit=1;
}
else /* a miss or crap from the other end */
@@ -1911,6 +1913,13 @@ int ssl3_send_client_key_exchange(SSL *s)
RSA *rsa;
unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
if (s->session->sess_cert == NULL)
{
/* We should always have a server certificate with SSL_kRSA. */
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR);
goto err;
}
if (s->session->sess_cert->peer_rsa_tmp != NULL)
rsa=s->session->sess_cert->peer_rsa_tmp;
else
@@ -2170,6 +2179,13 @@ int ssl3_send_client_key_exchange(SSL *s)
int ecdh_clnt_cert = 0;
int field_size = 0;
if (s->session->sess_cert == NULL)
{
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE);
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE);
goto err;
}
/* Did we send out the client's
* ECDH share for use in premaster
* computation as part of client certificate?
+7 -1
View File
@@ -758,7 +758,13 @@ int ssl3_alert_code(int code)
case SSL_AD_INTERNAL_ERROR: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_USER_CANCELLED: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_NO_RENEGOTIATION: return(-1); /* Don't send it :-) */
case SSL_AD_UNSUPPORTED_EXTENSION: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_CERTIFICATE_UNOBTAINABLE: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_UNRECOGNIZED_NAME: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_BAD_CERTIFICATE_HASH_VALUE: return(SSL3_AD_HANDSHAKE_FAILURE);
case SSL_AD_UNKNOWN_PSK_IDENTITY:return(TLS1_AD_UNKNOWN_PSK_IDENTITY);
case SSL_AD_INAPPROPRIATE_FALLBACK:return(TLS1_AD_INAPPROPRIATE_FALLBACK);
default: return(-1);
}
}
+24
View File
@@ -1981,6 +1981,29 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
break;
#endif /* !OPENSSL_NO_TLSEXT */
case SSL_CTRL_CHECK_PROTO_VERSION:
/* For library-internal use; checks that the current protocol
* is the highest enabled version (according to s->ctx->method,
* as version negotiation may have changed s->method). */
if (s->version == s->ctx->method->version)
return 1;
/* Apparently we're using a version-flexible SSL_METHOD
* (not at its highest protocol version). */
if (s->ctx->method->version == SSLv23_method()->version)
{
#if TLS_MAX_VERSION != TLS1_VERSION
# error Code needs update for SSLv23_method() support beyond TLS1_VERSION.
#endif
if (!(s->options & SSL_OP_NO_TLSv1))
return s->version == TLS1_VERSION;
if (!(s->options & SSL_OP_NO_SSLv3))
return s->version == SSL3_VERSION;
if (!(s->options & SSL_OP_NO_SSLv2))
return s->version == SSL2_VERSION;
}
return 0; /* Unexpected state; fail closed. */
default:
break;
}
@@ -2269,6 +2292,7 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
break;
#endif
default:
return(0);
}
+10 -1
View File
@@ -1147,6 +1147,15 @@ start:
goto f_err;
}
if (!(s->s3->flags & SSL3_FLAGS_CCS_OK))
{
al=SSL_AD_UNEXPECTED_MESSAGE;
SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_CCS_RECEIVED_EARLY);
goto f_err;
}
s->s3->flags &= ~SSL3_FLAGS_CCS_OK;
rr->length=0;
if (s->msg_callback)
@@ -1278,7 +1287,7 @@ int ssl3_do_change_cipher_spec(SSL *s)
if (s->s3->tmp.key_block == NULL)
{
if (s->session == NULL)
if (s->session == NULL || s->session->master_key_length == 0)
{
/* might happen if dtls1_read_bytes() calls this */
SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY);
+2
View File
@@ -523,6 +523,7 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SR_CERT_VRFY_A:
case SSL3_ST_SR_CERT_VRFY_B:
s->s3->flags |= SSL3_FLAGS_CCS_OK;
/* we should decide if we expected this one */
ret=ssl3_get_cert_verify(s);
if (ret <= 0) goto end;
@@ -533,6 +534,7 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SR_FINISHED_A:
case SSL3_ST_SR_FINISHED_B:
s->s3->flags |= SSL3_FLAGS_CCS_OK;
ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A,
SSL3_ST_SR_FINISHED_B);
if (ret <= 0) goto end;
+16
View File
@@ -560,6 +560,10 @@ typedef struct ssl_session_st
#define SSL_MODE_AUTO_RETRY 0x00000004L
/* Don't attempt to automatically build certificate chain */
#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L
/* Send TLS_FALLBACK_SCSV in the ClientHello.
* To be set by applications that reconnect with a downgraded protocol
* version; see draft-ietf-tls-downgrade-scsv-00 for details. */
#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
@@ -1204,6 +1208,9 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY /* fatal */
#define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK /* fatal */
#define SSL_ERROR_NONE 0
#define SSL_ERROR_SSL 1
@@ -1293,6 +1300,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
#define SSL_CTRL_CLEAR_OPTIONS 77
#define SSL_CTRL_CLEAR_MODE 78
#define SSL_CTRL_CHECK_PROTO_VERSION 119
#define DTLSv1_get_timeout(ssl, arg) \
SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
#define DTLSv1_handle_timeout(ssl) \
@@ -1940,6 +1949,7 @@ void ERR_load_SSL_strings(void);
#define SSL_R_HTTPS_PROXY_REQUEST 155
#define SSL_R_HTTP_REQUEST 156
#define SSL_R_ILLEGAL_PADDING 283
#define SSL_R_INAPPROPRIATE_FALLBACK 373
#define SSL_R_INVALID_CHALLENGE_LENGTH 158
#define SSL_R_INVALID_COMMAND 280
#define SSL_R_INVALID_PURPOSE 278
@@ -2067,6 +2077,7 @@ void ERR_load_SSL_strings(void);
#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
@@ -2074,6 +2085,11 @@ void ERR_load_SSL_strings(void);
#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 227
#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
+7 -1
View File
@@ -129,9 +129,14 @@
extern "C" {
#endif
/* Signalling cipher suite value: from draft-ietf-tls-renegotiation-03.txt */
/* Signalling cipher suite value from RFC 5746
* (TLS_EMPTY_RENEGOTIATION_INFO_SCSV) */
#define SSL3_CK_SCSV 0x030000FF
/* Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
* (TLS_FALLBACK_SCSV) */
#define SSL3_CK_FALLBACK_SCSV 0x03005600
#define SSL3_CK_RSA_NULL_MD5 0x03000001
#define SSL3_CK_RSA_NULL_SHA 0x03000002
#define SSL3_CK_RSA_RC4_40_MD5 0x03000003
@@ -344,6 +349,7 @@ typedef struct ssl3_buffer_st
* effected, but we can't prevent that.
*/
#define SSL3_FLAGS_SGC_RESTART_DONE 0x0040
#define SSL3_FLAGS_CCS_OK 0x0080
typedef struct ssl3_state_st
{
+7
View File
@@ -341,6 +341,7 @@ static ERR_STRING_DATA SSL_str_reasons[]=
{ERR_REASON(SSL_R_HTTPS_PROXY_REQUEST) ,"https proxy request"},
{ERR_REASON(SSL_R_HTTP_REQUEST) ,"http request"},
{ERR_REASON(SSL_R_ILLEGAL_PADDING) ,"illegal padding"},
{ERR_REASON(SSL_R_INAPPROPRIATE_FALLBACK),"inappropriate fallback"},
{ERR_REASON(SSL_R_INVALID_CHALLENGE_LENGTH),"invalid challenge length"},
{ERR_REASON(SSL_R_INVALID_COMMAND) ,"invalid command"},
{ERR_REASON(SSL_R_INVALID_PURPOSE) ,"invalid purpose"},
@@ -468,6 +469,7 @@ static ERR_STRING_DATA SSL_str_reasons[]=
{ERR_REASON(SSL_R_TLSV1_ALERT_DECRYPTION_FAILED),"tlsv1 alert decryption failed"},
{ERR_REASON(SSL_R_TLSV1_ALERT_DECRYPT_ERROR),"tlsv1 alert decrypt error"},
{ERR_REASON(SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION),"tlsv1 alert export restriction"},
{ERR_REASON(SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK),"tlsv1 alert inappropriate fallback"},
{ERR_REASON(SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY),"tlsv1 alert insufficient security"},
{ERR_REASON(SSL_R_TLSV1_ALERT_INTERNAL_ERROR),"tlsv1 alert internal error"},
{ERR_REASON(SSL_R_TLSV1_ALERT_NO_RENEGOTIATION),"tlsv1 alert no renegotiation"},
@@ -475,6 +477,11 @@ static ERR_STRING_DATA SSL_str_reasons[]=
{ERR_REASON(SSL_R_TLSV1_ALERT_RECORD_OVERFLOW),"tlsv1 alert record overflow"},
{ERR_REASON(SSL_R_TLSV1_ALERT_UNKNOWN_CA),"tlsv1 alert unknown ca"},
{ERR_REASON(SSL_R_TLSV1_ALERT_USER_CANCELLED),"tlsv1 alert user cancelled"},
{ERR_REASON(SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE),"tlsv1 bad certificate hash value"},
{ERR_REASON(SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE),"tlsv1 bad certificate status response"},
{ERR_REASON(SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE),"tlsv1 certificate unobtainable"},
{ERR_REASON(SSL_R_TLSV1_UNRECOGNIZED_NAME),"tlsv1 unrecognized name"},
{ERR_REASON(SSL_R_TLSV1_UNSUPPORTED_EXTENSION),"tlsv1 unsupported extension"},
{ERR_REASON(SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER),"tls client cert req with anon cipher"},
{ERR_REASON(SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST),"tls invalid ecpointformat list"},
{ERR_REASON(SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST),"tls peer did not respond with certificate list"},
+46 -14
View File
@@ -1292,6 +1292,8 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p,
if (sk == NULL) return(0);
q=p;
if (put_cb == NULL)
put_cb = s->method->put_cipher_by_char;
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
{
@@ -1301,24 +1303,36 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p,
continue;
#endif /* OPENSSL_NO_KRB5 */
j = put_cb ? put_cb(c,p) : ssl_put_cipher_by_char(s,c,p);
j = put_cb(c,p);
p+=j;
}
/* If p == q, no ciphers and caller indicates an error. Otherwise
* add SCSV if not renegotiating.
*/
if (p != q && !s->new_session)
/* If p == q, no ciphers; caller indicates an error.
* Otherwise, add applicable SCSVs. */
if (p != q)
{
static SSL_CIPHER scsv =
if (!s->new_session)
{
0, NULL, SSL3_CK_SCSV, 0, 0, 0, 0, 0, 0, 0,
};
j = put_cb ? put_cb(&scsv,p) : ssl_put_cipher_by_char(s,&scsv,p);
p+=j;
static SSL_CIPHER scsv =
{
0, NULL, SSL3_CK_SCSV, 0, 0, 0, 0, 0, 0, 0,
};
j = put_cb(&scsv,p);
p+=j;
#ifdef OPENSSL_RI_DEBUG
fprintf(stderr, "SCSV sent by client\n");
fprintf(stderr, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV sent by client\n");
#endif
}
}
if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV)
{
static SSL_CIPHER scsv =
{
0, NULL, SSL3_CK_FALLBACK_SCSV, 0, 0, 0, 0, 0, 0, 0,
};
j = put_cb(&scsv,p);
p+=j;
}
}
return(p-q);
}
@@ -1329,11 +1343,12 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
SSL_CIPHER *c;
STACK_OF(SSL_CIPHER) *sk;
int i,n;
if (s->s3)
s->s3->send_connection_binding = 0;
n=ssl_put_cipher_by_char(s,NULL,NULL);
if ((num%n) != 0)
if (n == 0 || (num%n) != 0)
{
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
return(NULL);
@@ -1348,7 +1363,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
for (i=0; i<num; i+=n)
{
/* Check for SCSV */
/* Check for TLS_EMPTY_RENEGOTIATION_INFO_SCSV */
if (s->s3 && (n != 3 || !p[0]) &&
(p[n-2] == ((SSL3_CK_SCSV >> 8) & 0xff)) &&
(p[n-1] == (SSL3_CK_SCSV & 0xff)))
@@ -1368,6 +1383,23 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
continue;
}
/* Check for TLS_FALLBACK_SCSV */
if ((n != 3 || !p[0]) &&
(p[n-2] == ((SSL3_CK_FALLBACK_SCSV >> 8) & 0xff)) &&
(p[n-1] == (SSL3_CK_FALLBACK_SCSV & 0xff)))
{
/* The SCSV indicates that the client previously tried a higher version.
* Fail if the current version is an unexpected downgrade. */
if (!SSL_ctrl(s, SSL_CTRL_CHECK_PROTO_VERSION, 0, NULL))
{
SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_INAPPROPRIATE_FALLBACK);
if (s->s3)
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INAPPROPRIATE_FALLBACK);
goto err;
}
continue;
}
c=ssl_get_cipher_by_char(s,p);
p+=n;
if (c != NULL)
+24
View File
@@ -414,6 +414,12 @@ const char *SSL_alert_desc_string(int value)
case TLS1_AD_INTERNAL_ERROR: str="IE"; break;
case TLS1_AD_USER_CANCELLED: str="US"; break;
case TLS1_AD_NO_RENEGOTIATION: str="NR"; break;
case TLS1_AD_UNSUPPORTED_EXTENSION: str="UE"; break;
case TLS1_AD_CERTIFICATE_UNOBTAINABLE: str="CO"; break;
case TLS1_AD_UNRECOGNIZED_NAME: str="UN"; break;
case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE: str="BR"; break;
case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE: str="BH"; break;
case TLS1_AD_UNKNOWN_PSK_IDENTITY: str="UP"; break;
default: str="UK"; break;
}
return(str);
@@ -497,6 +503,24 @@ const char *SSL_alert_desc_string_long(int value)
case TLS1_AD_NO_RENEGOTIATION:
str="no renegotiation";
break;
case TLS1_AD_UNSUPPORTED_EXTENSION:
str="unsupported extension";
break;
case TLS1_AD_CERTIFICATE_UNOBTAINABLE:
str="certificate unobtainable";
break;
case TLS1_AD_UNRECOGNIZED_NAME:
str="unrecognized name";
break;
case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
str="bad certificate status response";
break;
case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE:
str="bad certificate hash value";
break;
case TLS1_AD_UNKNOWN_PSK_IDENTITY:
str="unknown PSK identity";
break;
default: str="unknown"; break;
}
return(str);
+7 -1
View File
@@ -853,6 +853,13 @@ int tls1_alert_code(int code)
case SSL_AD_INTERNAL_ERROR: return(TLS1_AD_INTERNAL_ERROR);
case SSL_AD_USER_CANCELLED: return(TLS1_AD_USER_CANCELLED);
case SSL_AD_NO_RENEGOTIATION: return(TLS1_AD_NO_RENEGOTIATION);
case SSL_AD_UNSUPPORTED_EXTENSION: return(TLS1_AD_UNSUPPORTED_EXTENSION);
case SSL_AD_CERTIFICATE_UNOBTAINABLE: return(TLS1_AD_CERTIFICATE_UNOBTAINABLE);
case SSL_AD_UNRECOGNIZED_NAME: return(TLS1_AD_UNRECOGNIZED_NAME);
case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE: return(TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE);
case SSL_AD_BAD_CERTIFICATE_HASH_VALUE: return(TLS1_AD_BAD_CERTIFICATE_HASH_VALUE);
case SSL_AD_UNKNOWN_PSK_IDENTITY:return(TLS1_AD_UNKNOWN_PSK_IDENTITY);
case SSL_AD_INAPPROPRIATE_FALLBACK:return(TLS1_AD_INAPPROPRIATE_FALLBACK);
#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
case DTLS1_AD_MISSING_HANDSHAKE_MESSAGE: return
(DTLS1_AD_MISSING_HANDSHAKE_MESSAGE);
@@ -860,4 +867,3 @@ int tls1_alert_code(int code)
default: return(-1);
}
}
+3
View File
@@ -1013,7 +1013,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen,
HMAC_Final(&hctx, tick_hmac, NULL);
HMAC_CTX_cleanup(&hctx);
if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen))
{
EVP_CIPHER_CTX_cleanup(&ctx);
goto tickerr;
}
/* Attempt to decrypt session data */
/* Move p after IV to start of encrypted ticket, update length */
p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx);
+10 -3
View File
@@ -81,6 +81,15 @@ extern "C" {
#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
#define TLS1_VERSION 0x0301
#define TLS1_1_VERSION 0x0302
#define TLS1_2_VERSION 0x0303
/* TLS 1.1 and 1.2 are not supported by this version of OpenSSL, so
* TLS_MAX_VERSION indicates TLS 1.0 regardless of the above
* definitions. (s23_clnt.c and s23_srvr.c have an OPENSSL_assert()
* check that would catch the error if TLS_MAX_VERSION was too low.)
*/
#define TLS_MAX_VERSION TLS1_VERSION
#define TLS1_VERSION_MAJOR 0x03
#define TLS1_VERSION_MINOR 0x01
@@ -94,6 +103,7 @@ extern "C" {
#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */
#define TLS1_AD_USER_CANCELLED 90
#define TLS1_AD_NO_RENEGOTIATION 100
/* codes 110-114 are from RFC3546 */
@@ -405,6 +415,3 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
}
#endif
#endif
+2
View File
@@ -22,6 +22,7 @@ BIN1= crontab \
hosts.equiv \
inetd.conf \
libalias.conf \
libmap.conf \
login.access \
login.conf \
mac.conf \
@@ -223,6 +224,7 @@ distribution:
${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
+2
View File
@@ -0,0 +1,2 @@
# $FreeBSD$
includedir /usr/local/etc/libmap.d
+2
View File
@@ -52,6 +52,8 @@
weekly
..
..
pkg
..
ppp
..
rc.d
+8
View File
@@ -402,6 +402,14 @@
..
..
..
keys
pkg
revoked
..
trusted
..
..
..
locale
UTF-8
..
+2
View File
@@ -23,6 +23,8 @@
remote uname=auditdistd gname=wheel mode=0700
..
..
authpf uname=root gname=authpf mode=0770
..
/set gname=wheel
backups
..
+66
View File
@@ -153,6 +153,72 @@ zone "30.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
// Shared Address Space (RFC 6598)
zone "64.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "65.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "66.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "67.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "68.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "69.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "70.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "71.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "72.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "73.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "74.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "75.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "76.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "77.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "78.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "79.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "80.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "81.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "82.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "83.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "84.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "85.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "86.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "87.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "88.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "89.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "90.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "91.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "92.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "93.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "94.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "95.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "96.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "97.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "98.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "99.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "100.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "101.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "102.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "103.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "104.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "105.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "106.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "107.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "108.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "109.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "110.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "111.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "112.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "113.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "114.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "115.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "116.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "117.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "118.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "119.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "120.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "121.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "122.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "123.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "124.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "125.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "126.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "127.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
// Link-local/APIPA (RFCs 3927, 5735 and 6303)
zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
+16
View File
@@ -0,0 +1,16 @@
# $FreeBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
# mkdir -p /usr/local/etc/pkg/repos
# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
+10
View File
@@ -0,0 +1,10 @@
# $FreeBSD$
NO_OBJ=
FILES= FreeBSD.conf
FILESDIR= /etc/pkg
FILESMODE= 644
.include <bsd.prog.mk>
+1 -1
View File
@@ -322,7 +322,7 @@ typedef atomic_bool atomic_flag;
#define atomic_flag_clear_explicit(object, order) \
atomic_store_explicit(object, 0, order)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_compare_exchange_strong_explicit(object, 0, 1, order, order)
atomic_exchange_explicit(object, 1, order)
#define atomic_flag_clear(object) \
atomic_flag_clear_explicit(object, memory_order_seq_cst)
+1
View File
@@ -105,6 +105,7 @@ typedef __timer_t timer_t;
#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
#define CLOCK_SECOND 13 /* FreeBSD-specific. */
#define CLOCK_THREAD_CPUTIME_ID 14
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
+2 -1
View File
@@ -28,7 +28,7 @@ SRCS+= condition.c mutex.c \
.PATH: ${SRCDIR}
SRCS+= inet_pton.c \
assertions.c backtrace.c base32.c base64.c bitstring.c \
buffer.c bufferlist.c commandline.c error.c event.c \
buffer.c bufferlist.c commandline.c counter.c error.c event.c \
fsaccess.c hash.c \
heap.c hex.c hmacmd5.c hmacsha.c \
httpd.c inet_aton.c \
@@ -65,6 +65,7 @@ INCS= ${SRCDIR}/include/isc/app.h \
${SRCDIR}/include/isc/buffer.h \
${SRCDIR}/include/isc/bufferlist.h \
${SRCDIR}/include/isc/commandline.h \
${SRCDIR}/include/isc/counter.h \
${SRCDIR}/include/isc/entropy.h \
${SRCDIR}/include/isc/error.h \
${SRCDIR}/include/isc/event.h \
+2 -1
View File
@@ -122,7 +122,8 @@ system: packagesystem
# Install system
mkdir -p release
cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1
DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \
WITHOUT_CLANG=1
# Copy distfiles
mkdir -p release/usr/freebsd-dist
cp *.txz MANIFEST release/usr/freebsd-dist
+1 -1
View File
@@ -24,7 +24,7 @@
# Set these, release builder!
#
# Fixed version:
#BUILDNAME=9.2-BETA2
#BUILDNAME=9.2-RELEASE
#
# Automatic SNAP versioning:
DATE != date +%Y%m%d
+5 -81
View File
@@ -28,7 +28,7 @@
<pubdate>$FreeBSD$</pubdate>
<copyright>
<year>2012</year>
<year>2013</year>
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
</copyright>
@@ -106,59 +106,9 @@
<tbody>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:01.openssl.asc"
>SA-12:01.openssl</ulink></entry>
<entry>3&nbsp;May&nbsp;2012</entry>
<entry><para>OpenSSL multiple vulnerabilities</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:02.crypt.asc"
>SA-12:02.crypt</ulink></entry>
<entry>30&nbsp;May&nbsp;2012</entry>
<entry><para>Incorrect <function>crypt()</function> hashing</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:03.bind.asc"
>SA-12:03.bind</ulink></entry>
<entry>12&nbsp;June&nbsp;2012</entry>
<entry><para>Incorrect handling of zero-length RDATA fields in &man.named.8;</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:04.sysret.asc"
>SA-12:04.sysret</ulink></entry>
<entry>12&nbsp;June&nbsp;2012</entry>
<entry><para>Privilege escalation when returning from kernel</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:05.bind.asc"
>SA-12:05.bind</ulink></entry>
<entry>6&nbsp;August&nbsp;2012</entry>
<entry><para>&man.named.8; DNSSEC validation Denial of Service</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:06.bind.asc"
>SA-12:06.bind</ulink></entry>
<entry>22&nbsp;November&nbsp;2012</entry>
<entry><para>Multiple Denial of Service vulnerabilities with &man.named.8;</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:07.hostapd.asc"
>SA-12:07.hostapd</ulink></entry>
<entry>22&nbsp;November&nbsp;2012</entry>
<entry><para>Insufficient message length validation for EAP-TLS messages</para></entry>
</row>
<row>
<entry><ulink url="http://security.freebsd.org/advisories/FreeBSD-SA-12:08.linux.asc"
>SA-12:08.linux</ulink></entry>
<entry>22&nbsp;November&nbsp;2012</entry>
<entry><para>Linux compatibility layer input validation error</para></entry>
<entry>No security advisories to display.</entry>
<entry>&nbsp;</entry>
<entry>&nbsp;</entry>
</row>
</tbody>
</tgroup>
@@ -168,33 +118,7 @@
<sect1 id="late-news">
<title>Late-Breaking News</title>
<para>[November 2, 2012] The current &man.mfi.4; driver has an
overflow bug when handling disks larger than 2^32 sectors in
SYSPD volumes, also known as JBODs, which will cause data
corruption. This bug has been fixed on this &os;-CURRENT but
was too late for inclusion in this release. An Errata Notice
for &release.current; is planned.</para>
<para>No news items available.</para>
<para>[December 25, 2012] The Installtion Instructions had the
following wrong information about upgrading procedure. All of
them have been fixed in the online version.</para>
<itemizedlist>
<listitem>
<para>The link URL of <quote>upgrading section in the Release
Notes</quote>, branch names where upcoming Security
Advisories or Errata Notices will be applied, and a
command line argument of &man.freebsd-update.8; were ones
for 9.0-RELEASE, not for &release.current;.</para>
</listitem>
<listitem>
<para>The list of releases supported by &man.freebsd-update.8;
utility were incorrect. For 9.X, The following versions are
supported: <literal>9.0-RELEASE</literal>,
<literal>9.1-BETA1</literal>, and
<literal>9.1-RC[123]</literal>.</para>
</listitem>
</itemizedlist>
</sect1>
</article>
@@ -14,7 +14,7 @@
<pubdate>$FreeBSD$</pubdate>
<copyright>
<year>2012</year>
<year>2013</year>
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
</copyright>
@@ -51,7 +51,7 @@
<para>If you are upgrading from a previous release of &os;, please
read <ulink
url="http://www.FreeBSD.org/releases/9.1R/relnotes-detailed.html#upgrade">upgrading
url="http://www.FreeBSD.org/releases/9.2R/relnotes-detailed.html#upgrade">upgrading
section in the Release Notes</ulink> for notable
incompatibilities carefully.</para>
@@ -63,10 +63,15 @@
<ulink url="&url.books.handbook;/synching.html"></ulink> and
<ulink url="&url.books.handbook;/makeworld.html"></ulink>.</para>
<para>For SVN use the <filename>releng/9.1</filename> branch
<para>For SVN use the <filename>releng/9.2</filename> branch
which will be where any upcoming Security Advisories or Errata
Notices will be applied. The branch tag to use for updating
the source is <literal>RELENG_9_1</literal> for CVS.</para>
Notices will be applied.</para>
<note>
<para>CVS and cvsup are both deprecated, and not supported
methods for updating the <filename role="directory">src/</filename>
tree.</para>
</note>
</sect2>
<sect2>
@@ -76,17 +81,10 @@
upgrades of &arch.i386; and &arch.amd64; systems running
earlier FreeBSD releases. Systems running
<literal>7.[34]-RELEASE</literal>,
<literal>8.[12]-RELEASE</literal>,
<literal>8.[1234]-RELEASE</literal>,
<literal>9.0-RELEASE</literal>,
<literal>9.1-BETA1</literal>, or
<literal>9.1-RC[123]</literal> can upgrade as follows:</para>
<para>First, ensure that your current system is up to date; a
change was recently made to &man.freebsd-update.8; (Errata
Notice <ulink
url="http://security.FreeBSD.org/advisories/FreeBSD-EN-12:01.freebsd-update.asc">FreeBSD-EN-12:01.freebsd-update</ulink>)
which is needed in order to upgrade to &os;
&release.current;.</para>
<literal>9.1-RELEASE</literal>, or
<literal>9.2-RC[1234]</literal> can upgrade as follows:</para>
<screen>&prompt.root; freebsd-update fetch
&prompt.root; freebsd-update install</screen>
@@ -96,7 +94,7 @@
&man.freebsd-update.8; will ask for help in merging
configuration files.</para>
<screen>&prompt.root; freebsd-update upgrade -r 9.1-RELEASE</screen>
<screen>&prompt.root; freebsd-update upgrade -r 9.2-RELEASE</screen>
<para>Due to changes in the way that &os; is packaged on the
release media, two complications may arise in this process if
@@ -14,7 +14,7 @@
<pubdate>$FreeBSD$</pubdate>
<copyright>
<year>2012</year>
<year>2013</year>
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
</copyright>
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -6,18 +6,18 @@
<!-- Version of the OS we're describing. This needs to be updated
with each new release. -->
<!ENTITY release.current "9.1-RELEASE">
<!ENTITY release.current "9.2-RELEASE">
<!-- The previous version used for comparison in the "What's New"
section. For -CURRENT, we might point back to the last
branchpoint. -->
<!ENTITY release.prev "9.0-RELEASE">
<!ENTITY release.prev "9.1-RELEASE">
<!-- The next version to be released, usually used for snapshots. -->
<!ENTITY release.next "9.2-RELEASE">
<!ENTITY release.next "9.3-RELEASE">
<!-- The name of this branch. -->
<!ENTITY release.branch "9.1-STABLE">
<!ENTITY release.branch "9.2-STABLE">
<!-- The URL for obtaining this version of FreeBSD. -->
<!ENTITY release.url "http://www.FreeBSD.org/releases/">
@@ -48,7 +48,7 @@
<!ENTITY release.manpath.xorg "7.5.2">
<!ENTITY release.manpath.netbsd "6.0">
<!ENTITY release.manpath.freebsd-ports "Ports">
<!ENTITY release.manpath.freebsd "9.1-RELEASE">
<!ENTITY release.manpath.freebsd "9.2-RELEASE">
<!-- Text constants which probably don't need to be changed.-->
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff. Show more