mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-09 14:22:40 +02:00
internal/cryptutil: fixed panic on nil pubkey
This commit is contained in:
parent
22fb3a0f7e
commit
c5bcc9bbef
5 changed files with 81 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
package cryptutil
|
||||
package cryptutil // import "github.com/pomerium/pomerium/internal/cryptutil"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -35,6 +35,10 @@ func TestPublicKeyMarshaling(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = DecodePublicKey(nil)
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
|
||||
pemBytes, _ := EncodePublicKey(ecKey)
|
||||
if !bytes.Equal(pemBytes, []byte(pemECPublicKeyP256)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue