New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: getTSEnd() and getTSStart() return wrong timestamps #5507

Closed
bjoe2k4 opened this Issue Jul 8, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@bjoe2k4

bjoe2k4 commented Jul 8, 2017

  • Program: dnsdist
  • Issue type: Bug report

Short description

getTSEnd() and getTSStart() are supposed to return unix timestamps of the start- and end-date of the dnscrypt certificates, but the values are wrong.

Environment

  • Operating system: Archlinux
  • Software version: dnsdist 0.0.g6c3281444
  • Software source: dnsdist-git from AUR

Steps to reproduce

  1. Setup dnsdist with dnscrypt and certificates in place, according to the docs
  2. Run the following commands on the console:
> showDNSCryptBinds()
#   Address              Provider Name        Serial   Validity              P. Serial P. Validity
0   [::1]:8443           2.dnscrypt-cert.loca 12       2017-07-08 23:14:41   11        2017-07-08 22:37:48

> getDNSCryptBind(0):getCurrentCertificate():getSerial()
12

> getDNSCryptBind(0):getOldCertificate():getSerial()
11

So let's check the

Expected behaviour

> getDNSCryptBind(0):getCurrentCertificate():getTSEnd()
1499548481

> getDNSCryptBind(0):getOldCertificate():getTSEnd()
1499546268

Actual behaviour

> getDNSCryptBind(0):getCurrentCertificate():getTSEnd()
1095459161

> getDNSCryptBind(0):getOldCertificate():getTSEnd()
2621595993
@zeha

This comment has been minimized.

Collaborator

zeha commented Jul 8, 2017

Looking at the code, the values are unix timestamps, but in network byte order.

@Habbie

This comment has been minimized.

Member

Habbie commented Jul 8, 2017

Looking at the values in the ticket, this theory holds up :)

@bjoe2k4

This comment has been minimized.

bjoe2k4 commented Jul 8, 2017

I am certainly no expert, but wouldn't it be more practical to be able to interact with lua's os.time() directly? If not, how to convert the values in lua?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment