Anondate
extracting time from Tor consensus
anondate-get
[edit]Diagnostic utility. anondate-get. A higher level and easier to use tool than the lower level anondate.
Usage of anondate-get should be safe. It does not use networking. It does not change the time. It only looks at locally available information.
sudo anondate-get
Sample output.
/usr/sbin/anondate-get: INFO: 100% Tor bootstrap, ok. /usr/sbin/anondate-get: INFO: tor_circuit_established_check.py, ok. /usr/sbin/anondate-get: INFO: Tor circuit already established, ok. /usr/sbin/anondate-get: INFO: current time in valid in range, ok. /usr/sbin/anondate-get: INFO: Tor certificate lifetime valid, ok. /usr/sbin/anondate-get: END: Exiting with exit_code '3' indicating 'Could not determine any time using Tor from consensus or certificate life time.'.
anondate-set
[edit]Security impact has yet to be documented.
anondate-set.
sudo anondate-set
/usr/sbin/anondate-set: INFO: Status file '/run/anondate/tor_certificate_lifetime_set' does not yet exist. /usr/sbin/anondate-set: INFO: running anondate-get... /usr/sbin/anondate-get: INFO: 100% Tor bootstrap, ok. /usr/sbin/anondate-get: INFO: tor_circuit_established_check.py, ok. /usr/sbin/anondate-get: INFO: Tor circuit already established, ok. /usr/sbin/anondate-get: INFO: current time in valid in range, ok. /usr/sbin/anondate-get: INFO: Tor certificate lifetime valid, ok. /usr/sbin/anondate-get: END: Exiting with exit_code '3' indicating 'Could not determine any time using Tor from consensus or certificate life time.'. /usr/sbin/anondate-set: END: Exiting with exit_code '3' indicating 'Setting time using anondate either not possible or not required.'.
anondate
[edit]Introduction
[edit]- TODO: documentation on anondate is outdated
- The anondate interface description as per the latest git master:
- Kicksecure GitHub helper-scripts repository subpath
- See also: #Tor Consensus Method
- Needs access to either:
/var/run/tor/log(default only in Kicksecure). [Tor Project upstream feature request: additional /var/run/tor/log default log
] This is preferable because it contains only Tor's log since the last boot, which is more relevant and easier for
anondateto parse.- Or access to
/var/log/tor/log. This is configurable through the environment variableTOR_LOG(export TOR_LOG=/var/log/tor/log). (Alternatively, we could change the default in the code.)
Consensus Related Options
[edit]--verified-only--prefer-verified--unverified-only
Special Exit Codes
[edit]- exit
3:$TOR_LOGnot readable. - exit
4:$consensusnot readable.
Simple Status Checking
[edit]anondate --has-consensus
[edit]Useful for checking whether requesting any of the #Date Ranges Output values is worthwhile.
- yes:
- exit
0
- exit
- no:
- exit
1
- exit
Could be replaced by Tor ControlPort / python-stem?
- verified-only: Yes. (
consensus/valid-after) - unverified: No.
anondate --current-time-in-valid-range
[edit]Useful as a sanity test before setting the time for the first time and before updating it with a newly fetched timestamp.
- yes:
- exit
0
- exit
- no:
- exit
1
- exit
Could be replaced by Tor ControlPort / python-stem?
- verified-only: Yes. (See below.)
- unverified: No. Tor Project upstream feature request: make unverified consensus ISOTime accessible through Tor's ControlPort

Date Ranges Output
[edit]anondate --show-valid-after
[edit]- yes:
- output:
2015-08-15 22:00:00 - exit
0
- output:
- no:
- exit
1
- exit
Could be replaced by Tor ControlPort / python-stem?
- verified-only: Yes.
consensus/valid-after - unverified: No. Tor Project upstream feature request: make unverified consensus ISOTime accessible through Tor's ControlPort

anondate --show-valid-until
[edit]- yes:
- output:
2015-08-16 01:00:00 - exit
0
- output:
- no:
- exit
1
- exit
Could be replaced by Tor ControlPort / python-stem?
- verified-only: Yes.
consensus/valid-until - unverified: No. Tor Project upstream feature request: make unverified consensus ISOTime accessible through Tor's ControlPort

anondate --show-middle-range
[edit]- yes:
- output:
2015-08-15 23:30:00 - exit
0
- output:
- no:
- exit
1
- exit
(A scripted calculation of the above.)
Certificate Validity
[edit]When the clock is several months or years fast or slow, Tor cannot even download the Tor consensus. Tor, however, should always provide a certificate lifetime. For a security discussion, see also Tor Certificate Lifetime.
anondate --tor-cert-lifetime-valid
[edit]Sep 03 10:32:59.000 [warn] Certificate already expired. Either their clock is set wrong, or your clock is wrong. Sep 03 10:32:59.000 [warn] (certificate lifetime runs from Aug 16 00:00:00 2014 GMT through Jul 29 23:59:59 2015 GMT. Your time is Sep 03 10:32:59 2015 UTC.)
- yes:
- output:
Sep 03 10:34:00.000 [warn] Certificate already expired. Either their clock is set wrong, or your clock is wrong. - exit
0
- output:
- no:
- exit
1
- exit
Could this be replaced by Tor ControlPort / python-stem? No. Tor Project upstream feature request: make certificate lifetime accessible through Tor's ControlPort![]()
anondate --tor-cert-valid-after
[edit]Similar to the above, but provides less output.
- output:
Jun 16 00:00:00 2014 GMT - Exit codes unreliable.
- Don't use without invoking the above first.
- (Could be fixed in the code if worthwhile.)
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!