mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-28 16:08:27 +00:00
Fix error when keyblock is nil (#394)
This commit is contained in:
parent
139cb7a01e
commit
6b55972183
1 changed files with 3 additions and 0 deletions
|
@ -525,6 +525,9 @@ func readKeyPEM(path string, data []byte) (gomatrixserverlib.KeyID, ed25519.Priv
|
||||||
if data == nil {
|
if data == nil {
|
||||||
return "", nil, fmt.Errorf("no matrix private key PEM data in %q", path)
|
return "", nil, fmt.Errorf("no matrix private key PEM data in %q", path)
|
||||||
}
|
}
|
||||||
|
if keyBlock == nil {
|
||||||
|
return "", nil, fmt.Errorf("keyBlock is nil %q", path)
|
||||||
|
}
|
||||||
if keyBlock.Type == "MATRIX PRIVATE KEY" {
|
if keyBlock.Type == "MATRIX PRIVATE KEY" {
|
||||||
keyID := keyBlock.Headers["Key-ID"]
|
keyID := keyBlock.Headers["Key-ID"]
|
||||||
if keyID == "" {
|
if keyID == "" {
|
||||||
|
|
Loading…
Reference in a new issue