aboutsummaryrefslogtreecommitdiff
path: root/build/gobind-pinecone/monolith.go
diff options
context:
space:
mode:
Diffstat (limited to 'build/gobind-pinecone/monolith.go')
-rw-r--r--build/gobind-pinecone/monolith.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/build/gobind-pinecone/monolith.go b/build/gobind-pinecone/monolith.go
index b51e9778..91bbb687 100644
--- a/build/gobind-pinecone/monolith.go
+++ b/build/gobind-pinecone/monolith.go
@@ -218,6 +218,9 @@ func (m *DendriteMonolith) Start() {
if _, sk, err = config.LoadMatrixKey(keyfile, os.ReadFile); err != nil {
panic("failed to load PEM key: " + err.Error())
}
+ if len(sk) != ed25519.PrivateKeySize {
+ panic("the private key is not long enough")
+ }
} else {
if sk, err = os.ReadFile(oldkeyfile); err != nil {
panic("failed to read the old private key: " + err.Error())
@@ -233,8 +236,13 @@ func (m *DendriteMonolith) Start() {
if _, sk, err = config.LoadMatrixKey(keyfile, os.ReadFile); err != nil {
panic("failed to load PEM key: " + err.Error())
}
+ if len(sk) != ed25519.PrivateKeySize {
+ panic("the private key is not long enough")
+ }
}
+ pk = sk.Public().(ed25519.PublicKey)
+
var err error
m.listener, err = net.Listen("tcp", "localhost:65432")
if err != nil {