Skip to content
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
Closed

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

bjoe2k4 opened this issue Jul 8, 2017 · 3 comments
Assignees
Milestone

Comments

@bjoe2k4
Copy link

@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
Copy link
Collaborator

@zeha zeha commented Jul 8, 2017

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

@Habbie
Copy link
Member

@Habbie Habbie commented Jul 8, 2017

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

@bjoe2k4
Copy link
Author

@bjoe2k4 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants