mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-29 07:01:32 +00:00
Only keep keys valid for 100 years rather than the heat death of the universe
WASM builds really dislike thinking that far into the future, causing WASM to trap with "float unrepresentable in integer range", which corrupts the Go stack in wasm_exec which then leads to a segfault and the program exiting.
This commit is contained in:
parent
8db60c90bb
commit
bfb954519b
@ -17,7 +17,7 @@ package postgres
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"math"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ func NewDatabase(
|
|||||||
VerifyKey: gomatrixserverlib.VerifyKey{
|
VerifyKey: gomatrixserverlib.VerifyKey{
|
||||||
Key: gomatrixserverlib.Base64String(serverKey),
|
Key: gomatrixserverlib.Base64String(serverKey),
|
||||||
},
|
},
|
||||||
ValidUntilTS: math.MaxUint64 >> 1,
|
ValidUntilTS: gomatrixserverlib.AsTimestamp(time.Now().Add(100 * 365 * 24 * time.Hour)),
|
||||||
ExpiredTS: gomatrixserverlib.PublicKeyNotExpired,
|
ExpiredTS: gomatrixserverlib.PublicKeyNotExpired,
|
||||||
}
|
}
|
||||||
err = d.StoreKeys(
|
err = d.StoreKeys(
|
||||||
|
@ -17,7 +17,7 @@ package sqlite3
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"math"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/crypto/ed25519"
|
"golang.org/x/crypto/ed25519"
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ func NewDatabase(
|
|||||||
VerifyKey: gomatrixserverlib.VerifyKey{
|
VerifyKey: gomatrixserverlib.VerifyKey{
|
||||||
Key: gomatrixserverlib.Base64String(serverKey),
|
Key: gomatrixserverlib.Base64String(serverKey),
|
||||||
},
|
},
|
||||||
ValidUntilTS: math.MaxUint64 >> 1,
|
ValidUntilTS: gomatrixserverlib.AsTimestamp(time.Now().Add(100 * 365 * 24 * time.Hour)),
|
||||||
ExpiredTS: gomatrixserverlib.PublicKeyNotExpired,
|
ExpiredTS: gomatrixserverlib.PublicKeyNotExpired,
|
||||||
}
|
}
|
||||||
err = d.StoreKeys(
|
err = d.StoreKeys(
|
||||||
|
Loading…
Reference in New Issue
Block a user