• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rchouinard / rych-otp
93%

Build:
DEFAULT BRANCH: master
Repo Added 24 May 2013 08:27PM UTC
Files 3
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH master
branch: master
CHANGE BRANCH
x
Reset
  • master
  • 2.0-wip
  • develop
  • v1.0.0
  • v1.1.0
  • v1.1.1

pending completion
41

Pull #9

travis-ci

web-flow
Allow tokens to drift away from real time

Over a period of years, the clock in a physical OTP device drifts slowly away from the exact time because it has no way of syncing with the internet (!). We use Feitian c200 tokens. The manufacturer spec is +- 3 periods (of 30 sec each) _per year_. Most tokens are within that tolerance, but a good number fall outside that. We have about 1200 tokens in use at the moment.

To handle this, we need to store the current token offset in a database along with the token secret. The pull request allows us to pass that offset back in so that a token that has drifted well away from real time can still be used to authenticate. At authentication time, we calculate the current offset and use it to re-calibrate the token. So no matter how much the token drifts over time, if the user keeps using it regularly (every 6 months) they can still log in with it.

We also built a tool that allows users to resync their token: it sets the offset to zero, then accepts a very wide window (about 10 minutes either side) to calculate the initial offset. Once the offset is calculated and saved back to the database, the normal window size of 2 applies for all future logins.
Pull Request #9: Allow tokens to drift away from real time

14 of 14 new or added lines in 1 file covered. (100.0%)

161 of 174 relevant lines covered (92.53%)

54.55 hits per line

Relevant lines Covered
Build:
Build:
174 RELEVANT LINES 161 COVERED LINES
54.55 HITS PER LINE
Source Files on master
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
41 master Allow tokens to drift away from real time Over a period of years, the clock in a physical OTP device drifts slowly away from the exact time because it has no way of syncing with the internet (!). We use Feitian c200 tokens. The manufacturer spec ... Pull #9 05 Aug 2016 02:38AM UTC web-flow travis-ci pending completion  
35 master Fix issue with fast-expiring TOTP tokens When a TOTP token is generated in the last second of a time-step it invalidates a second later. Practically, that makes validating a TOTP very difficult, especially because windowing only goes forward in t... Pull #8 02 Jul 2015 03:46PM UTC samwierema travis-ci pending completion  
33 master Update CHANGELOG for 1.1.1 release push 30 Jun 2015 03:47AM UTC rchouinard travis-ci pending completion  
32 master Update CHANGELOG and .gitattributes push 30 Jun 2015 03:24AM UTC rchouinard travis-ci pending completion  
31 master Clean up and improve project documentation push 30 Jun 2015 01:22AM UTC rchouinard travis-ci pending completion  
30 master Merge pull request #4 from Ennosuke/master Merge PR #4, which includes security and documentation fixes - Fixed error in composer.json syntax in README.md (#3) - Fixed incorrect hash comparison in HOTP and TOTP classes (#6) Thanks to @En... push 29 Jun 2015 04:13PM UTC Ryan Chouinard travis-ci pending completion  
29 master fix composer.json syntax Pull #7 28 Jun 2015 01:51AM UTC Steve Pavarno travis-ci pending completion  
28 master Change == to === when comparing hashes Found the same error in the TOPT class and fixed it there also Pull #4 11 Jun 2015 12:46PM UTC Dennis Hillmann travis-ci pending completion  
27 master Change equal operator in HOTP class to identical operator There are security implications with the equal (==) operator on hashes it's better to use the identical operator (===). Pull #4 11 Jun 2015 12:34PM UTC Dennis Hillmann travis-ci pending completion  
26 master Fixed error in README regarding composer.json missing : Pull #4 17 Apr 2015 01:34PM UTC Dennis Hillmann travis-ci pending completion  
See All Builds (38)
  • Repo on GitHub
  • CI Project
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc