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

Override xorm type mapping for U2F counter #6232

Merged
merged 8 commits into from
Mar 5, 2019

Conversation

mporrato
Copy link
Contributor

@mporrato mporrato commented Mar 3, 2019

Fix U2F authentication failure with token counter value >= 2^31 when using PostgreSQL.
Closes #6168

Fix U2F autentication failure with token couter value >= 2^31 when using postgres
@codecov-io
Copy link

codecov-io commented Mar 3, 2019

Codecov Report

Merging #6232 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6232      +/-   ##
==========================================
- Coverage   38.86%   38.83%   -0.03%     
==========================================
  Files         354      355       +1     
  Lines       50223    50239      +16     
==========================================
- Hits        19517    19511       -6     
- Misses      27879    27901      +22     
  Partials     2827     2827
Impacted Files Coverage Δ
models/migrations/migrations.go 1.52% <ø> (ø) ⬆️
models/u2f.go 63.15% <ø> (ø) ⬆️
models/migrations/v81.go 0% <0%> (ø)
models/repo_list.go 66.84% <0%> (-1.06%) ⬇️
routers/repo/view.go 41.08% <0%> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 141c58f...6c751fa. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 3, 2019
@jonasfranz
Copy link
Member

Maybe you should consider to add a migration.

@lafriks
Copy link
Member

lafriks commented Mar 3, 2019

Yes, this would need to add migration to update exisiting database

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 3, 2019
models/migrations/v81.go Outdated Show resolved Hide resolved
@lafriks lafriks added this to the 1.8.0 milestone Mar 3, 2019
@lunny
Copy link
Member

lunny commented Mar 4, 2019

Yesterday, I'm also investigate this bug. My yubikey could work with github but not gitea. I will try this PR to check if it fixed the bug.

@lunny
Copy link
Member

lunny commented Mar 4, 2019

But it seems this doesn't fix my issue.

@mporrato
Copy link
Contributor Author

mporrato commented Mar 4, 2019

@lafriks I believe updating the sqlite3 schema is not needed since it has a single integer type which is big enough to hold an uint32. Sorry for my poor xorm knowledge: haven't used it before. :)

@lunny have you checked if your logs look like https://gist.github.com/mporrato/251450f7786075a887ad21a1728a5407 ? If that's the case, can you connect to the gitea db and do a \d u2f_registration ?

models/migrations/v81.go Show resolved Hide resolved
models/migrations/v81.go Outdated Show resolved Hide resolved
models/migrations/v81.go Outdated Show resolved Hide resolved
models/migrations/v81.go Outdated Show resolved Hide resolved
models/migrations/v81.go Outdated Show resolved Hide resolved
@lafriks
Copy link
Member

lafriks commented Mar 4, 2019

No need to be sorry about, that's why there is review process to learn things :)

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 4, 2019
@techknowlogick
Copy link
Member

I don’t think we need tidb case because for tidb v2 the protocol would be MySQL. Also should sessions be used?

@lafriks
Copy link
Member

lafriks commented Mar 4, 2019

@techknowlogick no session is needed for single sql command

@techknowlogick techknowlogick merged commit 1986269 into go-gitea:master Mar 5, 2019
@hpodhaisky
Copy link

hpodhaisky commented Aug 27, 2020

Is this problem still open? I am still getting "Could not read your security key." with gitea 1.12.1 with sqlite3 on debian stable (buster). My solo key NFC works with github.

Update (Solved): The server had two names which can be used synonymously -- but not with the u2f. The error "could not read" disappears if the same name is used for registering and using the dongle.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
9 participants