Make generating cross-signing keys work
This commit is contained in:
parent
ae862b9f44
commit
c6d1c62b65
2
go.mod
2
go.mod
@ -29,4 +29,4 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//replace maunium.net/go/mautrix => ../mautrix-go
|
//replace maunium.net/go/mautrix => ../mautrix-go
|
||||||
replace maunium.net/go/mautrix => github.com/nikofil/mautrix-go v0.5.2-0.20200911232449-6010305aed05
|
replace maunium.net/go/mautrix => github.com/nikofil/mautrix-go v0.5.2-0.20200911234625-a585557b3750
|
||||||
|
2
go.sum
2
go.sum
@ -54,6 +54,8 @@ github.com/nikofil/mautrix-go v0.5.2-0.20200911223256-b40ab761fadc h1:Un166sriST
|
|||||||
github.com/nikofil/mautrix-go v0.5.2-0.20200911223256-b40ab761fadc/go.mod h1:xd0D0ekVts/UDBbjeDSs4wGlBfcarJDg0MMhVgHbxhs=
|
github.com/nikofil/mautrix-go v0.5.2-0.20200911223256-b40ab761fadc/go.mod h1:xd0D0ekVts/UDBbjeDSs4wGlBfcarJDg0MMhVgHbxhs=
|
||||||
github.com/nikofil/mautrix-go v0.5.2-0.20200911232449-6010305aed05 h1:WFyJHdXasAvpno0OSvKgfmZHlq0WoyK+254vxmz4Mag=
|
github.com/nikofil/mautrix-go v0.5.2-0.20200911232449-6010305aed05 h1:WFyJHdXasAvpno0OSvKgfmZHlq0WoyK+254vxmz4Mag=
|
||||||
github.com/nikofil/mautrix-go v0.5.2-0.20200911232449-6010305aed05/go.mod h1:xd0D0ekVts/UDBbjeDSs4wGlBfcarJDg0MMhVgHbxhs=
|
github.com/nikofil/mautrix-go v0.5.2-0.20200911232449-6010305aed05/go.mod h1:xd0D0ekVts/UDBbjeDSs4wGlBfcarJDg0MMhVgHbxhs=
|
||||||
|
github.com/nikofil/mautrix-go v0.5.2-0.20200911234625-a585557b3750 h1:3eUgrAhYHnI0HidL2uO1uga8dpnqpAXIN0DB7uWc95Y=
|
||||||
|
github.com/nikofil/mautrix-go v0.5.2-0.20200911234625-a585557b3750/go.mod h1:xd0D0ekVts/UDBbjeDSs4wGlBfcarJDg0MMhVgHbxhs=
|
||||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
@ -42,6 +42,7 @@ const uiaFallbackPage = `<!DOCTYPE html>
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>Please complete the login in the popup window</h2>
|
<h2>Please complete the login in the popup window</h2>
|
||||||
|
<p>Keep this page open while logging in, it will close automatically after the login finishes.</p>
|
||||||
<button onclick="openPopup()">Open popup</button>
|
<button onclick="openPopup()">Open popup</button>
|
||||||
<button onclick="finish(false)">Cancel</button>
|
<button onclick="finish(false)">Cancel</button>
|
||||||
<script>
|
<script>
|
||||||
|
@ -350,6 +350,7 @@ func cmdS4Status(cmd *Command, mach *crypto.OlmMachine, keyID string) {
|
|||||||
}
|
}
|
||||||
if errors.Is(err, ssss.ErrNoDefaultKeyAccountDataEvent) {
|
if errors.Is(err, ssss.ErrNoDefaultKeyAccountDataEvent) {
|
||||||
cmd.Reply("SSSS is not set up: no default key set")
|
cmd.Reply("SSSS is not set up: no default key set")
|
||||||
|
return
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
cmd.Reply("Failed to get key data: %v", err)
|
cmd.Reply("Failed to get key data: %v", err)
|
||||||
return
|
return
|
||||||
@ -366,7 +367,7 @@ func cmdS4Status(cmd *Command, mach *crypto.OlmMachine, keyID string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cmdS4Generate(cmd *Command, mach *crypto.OlmMachine, setDefault bool) {
|
func cmdS4Generate(cmd *Command, mach *crypto.OlmMachine, setDefault bool) {
|
||||||
passphrase, ok := cmd.MainView.AskPassword("Passphrase", "", "", false)
|
passphrase, ok := cmd.MainView.AskPassword("Passphrase", "", "", true)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -554,9 +555,9 @@ func cmdCrossSigningGenerate(cmd *Command, container ifc.MatrixContainer, mach *
|
|||||||
cmd.Reply("Authentication failed: %v", err)
|
cmd.Reply("Authentication failed: %v", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &mautrix.BaseAuthData{
|
return &mautrix.ReqUIAuthFallback{
|
||||||
Type: flow.Stages[0],
|
|
||||||
Session: uia.Session,
|
Session: uia.Session,
|
||||||
|
User: mach.Client.UserID.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd.Reply("No supported authentication mechanisms found")
|
cmd.Reply("No supported authentication mechanisms found")
|
||||||
@ -581,6 +582,12 @@ func cmdCrossSigningGenerate(cmd *Command, container ifc.MatrixContainer, mach *
|
|||||||
}
|
}
|
||||||
|
|
||||||
mach.CrossSigningKeys = keys
|
mach.CrossSigningKeys = keys
|
||||||
|
cmd.Reply("Successfully generated and published cross-signing keys")
|
||||||
|
|
||||||
|
err = mach.SignOwnMasterKey()
|
||||||
|
if err != nil {
|
||||||
|
cmd.Reply("Failed to sign master key with device key: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSSSS(cmd *Command, mach *crypto.OlmMachine) *ssss.Key {
|
func getSSSS(cmd *Command, mach *crypto.OlmMachine) *ssss.Key {
|
||||||
@ -646,7 +653,6 @@ func cmdCrossSigningUpload(cmd *Command, mach *crypto.OlmMachine) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func cmdCrossSigningSelfSign(cmd *Command, mach *crypto.OlmMachine) {
|
func cmdCrossSigningSelfSign(cmd *Command, mach *crypto.OlmMachine) {
|
||||||
if mach.CrossSigningKeys == nil {
|
if mach.CrossSigningKeys == nil {
|
||||||
cmd.Reply("Cross-signing keys not cached")
|
cmd.Reply("Cross-signing keys not cached")
|
||||||
|
Loading…
Reference in New Issue
Block a user