Skip to content

Commit 039e16a

Browse files
GustedSysoev, Vladimir
Gusted
authored and
Sysoev, Vladimir
committed
Remove U2F support (go-gitea#20141)
- Completely remove U2F support from 1.18.0, 1.17.0 will be the last release that U2F is somewhat supported. Users who used U2F would already be warned about using U2F for a while now and should hopefully already be migrated. But starting 1.18 definitely remove it.
1 parent 12595c0 commit 039e16a

20 files changed

+4
-61
lines changed

custom/conf/app.example.ini

-14
Original file line numberDiff line numberDiff line change
@@ -475,20 +475,6 @@ ENABLE = true
475475
;; Maximum length of oauth2 token/cookie stored on server
476476
;MAX_TOKEN_LENGTH = 32767
477477

478-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
479-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
480-
[U2F]
481-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
482-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
483-
;;
484-
;; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
485-
;; Two Factor authentication with security keys
486-
;; https://developers.yubico.com/U2F/App_ID.html
487-
;;
488-
;; DEPRECATED - this only applies to previously registered security keys using the U2F standard
489-
APP_ID = ; e.g. http://localhost:3000/
490-
491-
492478
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
493479
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
494480
[log]

docs/content/doc/advanced/config-cheat-sheet.en-us.md

-3
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,6 @@ Default templates for project boards:
10031003
List of locales shown in language selector. The first locale will be used as the default if user browser's language doesn't match any locale in the list.
10041004
- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Türkçe,Čeština,Српски,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia,മലയാളം**: Visible names corresponding to the locales
10051005

1006-
## U2F (`U2F`) **DEPRECATED**
1007-
- `APP_ID`: **`ROOT_URL`**: Declares the facet of the application which is used for authentication of previously registered U2F keys. Requires HTTPS.
1008-
10091006
## Markup (`markup`)
10101007

10111008
- `MERMAID_MAX_SOURCE_CHARACTERS`: **5000**: Set the maximum size of a Mermaid source. (Set to -1 to disable)

docs/content/doc/features/comparison.zh-tw.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ menu:
5050
| 有寫入權限的儲存庫 Token ||||||||
5151
| 內建 Container Registry | [](https://github.com/go-gitea/gitea/issues/2316) |||||||
5252
| 對外部 Git 鏡像 ||||||||
53-
| FIDO U2F (2FA) ||||||||
53+
| FIDO (2FA) ||||||||
5454
| 內建 CI/CD ||||||||
5555
| 子群組: 群組中的群組 ||||||||
5656

modules/setting/setting.go

-15
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,6 @@ var (
402402
MaxTokenLength: math.MaxInt16,
403403
}
404404

405-
// FIXME: DEPRECATED to be removed in v1.18.0
406-
U2F = struct {
407-
AppID string
408-
}{}
409-
410405
// Metrics settings
411406
Metrics = struct {
412407
Enabled bool
@@ -1103,16 +1098,6 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
11031098
for _, emoji := range UI.CustomEmojis {
11041099
UI.CustomEmojisMap[emoji] = ":" + emoji + ":"
11051100
}
1106-
1107-
// FIXME: DEPRECATED to be removed in v1.18.0
1108-
U2F.AppID = strings.TrimSuffix(AppURL, "/")
1109-
if Cfg.Section("U2F").HasKey("APP_ID") {
1110-
log.Error("Deprecated setting `[U2F]` `APP_ID` present. This fallback will be removed in v1.18.0")
1111-
U2F.AppID = Cfg.Section("U2F").Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/"))
1112-
} else if Cfg.Section("u2f").HasKey("APP_ID") {
1113-
log.Error("Deprecated setting `[u2]` `APP_ID` present. This fallback will be removed in v1.18.0")
1114-
U2F.AppID = Cfg.Section("u2f").Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/"))
1115-
}
11161101
}
11171102

11181103
func parseAuthorizedPrincipalsAllow(values []string) ([]string, bool) {

options/locale/locale_cs-CZ.ini

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ webauthn_error_unable_to_process=Server nemohl zpracovat váš požadavek.
4646
webauthn_error_duplicated=Zabezpečovací klíč není pro tento požadavek povolen. Prosím ujistěte se, zda klíč není již registrován.
4747
webauthn_error_empty=Musíte nastavit název tohoto klíče.
4848
webauthn_error_timeout=Požadavek vypršel dříve, než se podařilo přečíst váš klíč. Znovu načtěte tuto stránku a akci opakujte.
49-
webauthn_u2f_deprecated=Klíč: „%s“ autentifikuje pomocí zastaralého procesu U2F. Měli byste znovu zaregistrovat tento klíč a zrušit starou registraci.
5049
webauthn_reload=Znovu načíst
5150

5251
repository=Repozitář

options/locale/locale_de-DE.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=Der Server konnte deine Anfrage nicht bearbeite
4747
webauthn_error_duplicated=Für diese Anfrage ist der Sicherheitsschlüssel nicht erlaubt. Bitte stell sicher, dass er nicht bereits registriert ist.
4848
webauthn_error_empty=Du musst einen Namen für diesen Schlüssel festlegen.
4949
webauthn_error_timeout=Das Zeitlimit wurde erreicht, bevor dein Schlüssel gelesen werden konnte. Bitte lade die Seite erneut.
50-
webauthn_u2f_deprecated=Der Schlüssel: '%s' authentifiziert sich über den veralteten U2F-Prozess. Bitte registriere den Schlüssel neu und lösche die alte Registrierung.
5150
webauthn_reload=Neu laden
5251

5352
repository=Repository

options/locale/locale_el-GR.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=Ο διακομιστής δεν μπόρεσε
4747
webauthn_error_duplicated=Το κλειδί ασφαλείας δεν επιτρέπεται για αυτό το αίτημα. Βεβαιωθείτε ότι το κλειδί δεν έχει ήδη καταχωρηθεί.
4848
webauthn_error_empty=Πρέπει να ορίσετε ένα όνομα για αυτό το κλειδί.
4949
webauthn_error_timeout=Το χρονικό όριο έφτασε πριν το κλειδί να διαβαστεί. Παρακαλώ ανανεώστε τη σελίδα και προσπαθήστε ξανά.
50-
webauthn_u2f_deprecated=Το κλειδί: '%s' πιστοποιεί χρησιμοποιώντας το παρωχημένο πρωτόκολλο U2F. Θα πρέπει να καταχωρήσετε ξανά αυτό το κλειδί και να καταργήσετε την παλιά εγγραφή.
5150
webauthn_reload=Ανανέωση
5251

5352
repository=Αποθετήριο

options/locale/locale_en-US.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process = The server could not process your request.
4747
webauthn_error_duplicated = The security key is not permitted for this request. Please make sure that the key is not already registered.
4848
webauthn_error_empty = You must set a name for this key.
4949
webauthn_error_timeout = Timeout reached before your key could be read. Please reload this page and retry.
50-
webauthn_u2f_deprecated = The key: '%s' authenticates using the deprecated U2F process. You should re-register this key and remove the old registration.
5150
webauthn_reload = Reload
5251

5352
repository = Repository

options/locale/locale_es-ES.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=El servidor no pudo procesar su solicitud.
4747
webauthn_error_duplicated=La clave de seguridad no está permitida para esta solicitud. Por favor, asegúrese de que la clave no está ya registrada.
4848
webauthn_error_empty=Debe establecer un nombre para esta clave.
4949
webauthn_error_timeout=Tiempo de espera máximo alcanzado antes de que su clave pudiese ser leída. Por favor, cargue la página y vuelva a intentarlo.
50-
webauthn_u2f_deprecated=La clave: '%s' se autentifica usando el proceso U2F obsoleto. Debe volver a registrar esta clave y eliminar el registro antiguo.
5150
webauthn_reload=Recargar
5251

5352
repository=Repositorio

options/locale/locale_is-IS.ini

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ webauthn_error_unable_to_process=Netþjónninn gat ekki ráðið við beiðni þ
4646
webauthn_error_duplicated=Öryggislykillinn er ekki leyfður fyrir þessa beiðni. Gakktu úr skugga um að lykillinn sé ekki þegar skráður.
4747
webauthn_error_empty=Þú verður að setja nafn fyrir þennan lykil.
4848
webauthn_error_timeout=Tímamörk náð áður en hægt var að lesa lykilinn þinn. Vinsamlegast endurhlaðið þessa síðu og reyndu aftur.
49-
webauthn_u2f_deprecated=Lykillinn: „%s“ auðkennir með því að nota úrelta U2F aðferð. Þú ættir að endurskrá þennan lykil og fjarlægja gömlu skráninguna.
5049
webauthn_reload=Endurhlaða
5150

5251
repository=Hugbúnaðarsafn

options/locale/locale_ja-JP.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=サーバーがリクエストを処理でき
4747
webauthn_error_duplicated=このリクエストに対しては、許可されていないセキュリティキーです。 キーが未登録であることを確認してください。
4848
webauthn_error_empty=このキーに名前を設定する必要があります。
4949
webauthn_error_timeout=キーを読み取る前にタイムアウトになりました。 このページをリロードしてもう一度やり直してください。
50-
webauthn_u2f_deprecated=キー: '%s' は非推奨のU2Fプロセスを使用して認証しています。このキーを再登録して古い登録を削除したほうが良いでしょう。
5150
webauthn_reload=リロード
5251

5352
repository=リポジトリ

options/locale/locale_lv-LV.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=Serveris nevar apstrādāt Jūsu pieprasījumu.
4747
webauthn_error_duplicated=Drošības atslēga nav atļauta šim pieprasījumam. Pārliecinieties, ka šī atslēga jau nav reģistrēta.
4848
webauthn_error_empty=Norādiet atslēgas nosaukumu.
4949
webauthn_error_timeout=Iestājusies noildze, mēģinot, nolasīt atslēgu. Pārlādējiet lapu un mēģiniet vēlreiz.
50-
webauthn_u2f_deprecated=Atslēga '%s' izmanto novecojušu U2F procesu. Noņemiet iepriekšējo reģistrāciju un veiciet reģistrācijas procesu no jauna.
5150
webauthn_reload=Pārlādēt
5251

5352
repository=Repozitorijs

options/locale/locale_pl-PL.ini

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ webauthn_error_unable_to_process=Serwer nie mógł obsłużyć Twojego żądania
4646
webauthn_error_duplicated=Klucz bezpieczeństwa nie jest dozwolony dla tego żądania. Upewnij się, że klucz nie jest już zarejestrowany.
4747
webauthn_error_empty=Musisz ustawić nazwę dla tego klucza.
4848
webauthn_error_timeout=Osiągnięto limit czasu zanim Twój klucz może zostać odczytany. Odśwież stronę i spróbuj ponownie.
49-
webauthn_u2f_deprecated=Klucz '%s' uwierzytelnia przy użyciu przestarzałego procesu U2F. Powinieneś ponownie zarejestrować ten klucz i usunąć starą rejestrację.
5049
webauthn_reload=Odśwież
5150

5251
repository=Repozytorium

options/locale/locale_pt-BR.ini

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ webauthn_error_unable_to_process=O servidor não pôde processar sua solicitaç
4646
webauthn_error_duplicated=A chave de segurança não é permitida para esta solicitação. Por favor, certifique-se que a chave já não está registrada.
4747
webauthn_error_empty=Você deve definir um nome para esta chave.
4848
webauthn_error_timeout=Tempo limite atingido antes de sua chave poder ser lida. Por favor, recarregue esta página e tente novamente.
49-
webauthn_u2f_deprecated=A chave: '%s' autentica utilizando o processo U2F descontinuado. Você deve registrar novamente esta chave e remover o registro antigo.
5049
webauthn_reload=Recarregar
5150

5251
repository=Repositório

options/locale/locale_pt-PT.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=O servidor não conseguiu processar o seu pedid
4747
webauthn_error_duplicated=A chave de segurança não é permitida neste pedido. Certifique-se de que a chave não está já registada.
4848
webauthn_error_empty=Você tem que definir um nome para esta chave.
4949
webauthn_error_timeout=O tempo limite foi atingido antes que a sua chave pudesse ser lida. Recarregue esta página e tente novamente.
50-
webauthn_u2f_deprecated=A chave: '%s' autentica usando o processo U2F, mas este foi descontinuado. Você deveria registar novamente esta chave e remover o registo antigo.
5150
webauthn_reload=Recarregar
5251

5352
repository=Repositório

options/locale/locale_zh-CN.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=服务器无法处理您的请求。
4747
webauthn_error_duplicated=此安全密钥未被许可用于这个请求。请确保该密钥尚未注册。
4848
webauthn_error_empty=您必须为此密钥设置一个名称。
4949
webauthn_error_timeout=未能在允许的时限内读取密钥。请重新加载此页面并重试。
50-
webauthn_u2f_deprecated=密钥 '%s' 使用的是已经废弃的 U2F 进行身份验证。您应该重新注册此密钥并删除旧的注册。
5150
webauthn_reload=重新加载
5251

5352
repository=仓库

options/locale/locale_zh-TW.ini

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ webauthn_error_unable_to_process=伺服器無法執行您的請求。
4747
webauthn_error_duplicated=此請求不允許使用這個安全金鑰。請確保該金鑰尚未註冊。
4848
webauthn_error_empty=您必須命名此金鑰。
4949
webauthn_error_timeout=在成功讀取金鑰之前已逾時,請重新載入此頁面並重試。
50-
webauthn_u2f_deprecated=「%s」金鑰使用已廢棄的 U2F 流程進行驗證。您應該重新註冊此金鑰並將先前註冊的移除。
5150
webauthn_reload=重新載入
5251

5352
repository=儲存庫

routers/web/auth/auth.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func SignInPost(ctx *context.Context) {
266266
}
267267

268268
if hasTOTPtwofa {
269-
// User will need to use U2F, save data
269+
// User will need to use WebAuthn, save data
270270
if err := ctx.Session.Set("totpEnrolled", u.ID); err != nil {
271271
ctx.ServerError("UserSignIn: Unable to set WebAuthn Enrolled in session", err)
272272
return
@@ -278,7 +278,7 @@ func SignInPost(ctx *context.Context) {
278278
return
279279
}
280280

281-
// If we have U2F redirect there first
281+
// If we have WebAuthn redirect there first
282282
if hasWebAuthnTwofa {
283283
ctx.Redirect(setting.AppSubURL + "/user/webauthn")
284284
return
@@ -317,7 +317,6 @@ func handleSignInFull(ctx *context.Context, u *user_model.User, remember, obeyRe
317317
_ = ctx.Session.Delete("openid_determined_username")
318318
_ = ctx.Session.Delete("twofaUid")
319319
_ = ctx.Session.Delete("twofaRemember")
320-
_ = ctx.Session.Delete("u2fChallenge")
321320
_ = ctx.Session.Delete("linkAccount")
322321
if err := ctx.Session.Set("uid", u.ID); err != nil {
323322
log.Error("Error setting uid %d in session: %v", u.ID, err)

routers/web/auth/webauthn.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ func WebAuthnLoginAssertion(ctx *context.Context) {
6767
return
6868
}
6969

70-
// FIXME: DEPRECATED appid is deprecated and is planned to be removed in v1.18.0
71-
assertion, sessionData, err := wa.WebAuthn.BeginLogin((*wa.User)(user), webauthn.WithAssertionExtensions(protocol.AuthenticationExtensions{
72-
"appid": setting.U2F.AppID,
73-
}))
70+
assertion, sessionData, err := wa.WebAuthn.BeginLogin((*wa.User)(user))
7471
if err != nil {
7572
ctx.ServerError("webauthn.BeginLogin", err)
7673
return
@@ -159,12 +156,5 @@ func WebAuthnLoginAssertionPost(ctx *context.Context) {
159156
}
160157
_ = ctx.Session.Delete("twofaUid")
161158

162-
// Finally check if the appid extension was used:
163-
if value, ok := parsedResponse.ClientExtensionResults["appid"]; ok {
164-
if appid, ok := value.(bool); ok && appid {
165-
ctx.Flash.Error(ctx.Tr("webauthn_u2f_deprecated", dbCred.Name))
166-
}
167-
}
168-
169159
ctx.JSON(http.StatusOK, map[string]string{"redirect": redirect})
170160
}

routers/web/user/setting/security/security.go

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const (
2626
func Security(ctx *context.Context) {
2727
ctx.Data["Title"] = ctx.Tr("settings")
2828
ctx.Data["PageIsSettingsSecurity"] = true
29-
ctx.Data["RequireU2F"] = true
3029

3130
if ctx.FormString("openid.return_to") != "" {
3231
settingsOpenIDVerify(ctx)

0 commit comments

Comments
 (0)