Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Global counter #49

Merged
merged 6 commits into from
Jun 14, 2018
Merged

Global counter #49

merged 6 commits into from
Jun 14, 2018

Conversation

btoews
Copy link
Contributor

@btoews btoews commented Mar 12, 2018

This branch switches from using per-registration counters to having a single counter shared between registrations. The U2F docs indicate that its fine to have a single global counter.

This change is needed because the SecItemUpdate API periodically fails for no reason (#47). This had been how we were updating the per-registration counters. I haven't heard anything from Apple after having opened a radar 1.5 months ago.

The new approach is to store the counter as a generic password item in the keychain. This seems hacky, but we want to prevent the counter from being tampered with by other applications and using the keychain for storage seems like a reasonable way to accomplish this.

While we can't update the per-registration counters, we should still be able to read them. For users upgrading their Soft U2F version, we'll use the highest per-registration counter value as our starting place for the global counter. I'll want to test this a bit more before merging this branch and cutting a new release.

Fixes #47. Apple seems to have broken the SecItemUpdate API, which we were using to update the counter we were storing the the applicationTag.
People's counters have been stuck at X. Our first authentication shouldn't return X, but X+1.
@btoews
Copy link
Contributor Author

btoews commented Mar 13, 2018

Upgrading from an older version seems to work fine.

@btoews
Copy link
Contributor Author

btoews commented Jun 14, 2018

I had been hoping that Apple would fix their bug so this hacky workaround wouldn't be necessary. That hasn't happened though, so I'm going to merge this. I snuck a few other minor bug fixes too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants