File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 44package v1_16 //nolint
55
66import (
7- "crypto/elliptic"
87 "encoding/base32"
98 "fmt"
109 "strings"
@@ -123,13 +122,17 @@ func RemigrateU2FCredentials(x *xorm.Engine) error {
123122 if err != nil {
124123 continue
125124 }
125+ pubKey , err := parsed .PubKey .ECDH ()
126+ if err != nil {
127+ continue
128+ }
126129 remigrated := & webauthnCredential {
127130 ID : reg .ID ,
128131 Name : reg .Name ,
129132 LowerName : strings .ToLower (reg .Name ),
130133 UserID : reg .UserID ,
131134 CredentialID : base32 .HexEncoding .EncodeToString (parsed .KeyHandle ),
132- PublicKey : elliptic . Marshal ( elliptic . P256 (), parsed . PubKey . X , parsed . PubKey . Y ),
135+ PublicKey : pubKey . Bytes ( ),
133136 AttestationType : "fido-u2f" ,
134137 AAGUID : []byte {},
135138 SignCount : reg .Counter ,
You can’t perform that action at this time.
0 commit comments