Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ func makeKey(keyAlg string) (crypto.Signer, []byte, error) {
key, err = rsa.GenerateKey(rand.Reader, 2048)
case "ecdsa":
key, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
case "mldsa":
key, err = mldsaGenerateKey()
}
if err != nil {
return nil, nil, err
Expand Down
12 changes: 12 additions & 0 deletions ca/ca_mldsa.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build go1.27

package ca

import (
"crypto"
"crypto/mldsa"
)

func mldsaGenerateKey() (crypto.Signer, error) {
return mldsa.GenerateKey(mldsa.MLDSA65())
}
13 changes: 13 additions & 0 deletions ca/ca_mldsa_stub.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build !go1.27

package ca

import (
"crypto"
"fmt"
)

// crypto/mldsa is not available before Go 1.27
func mldsaGenerateKey() (crypto.Signer, error) {
return nil, fmt.Errorf("unsupported key algorithm: mldsa")
}
2 changes: 1 addition & 1 deletion cmd/pebble/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func main() {
if keyAlg == "" {
keyAlg = "rsa"
}
acceptableKeyAlgs := []string{"rsa", "ecdsa"}
acceptableKeyAlgs := []string{"rsa", "ecdsa", "mldsa"}
if !slices.Contains(acceptableKeyAlgs, keyAlg) {
cmd.FailOnError(fmt.Errorf("%q is not one of %#v", keyAlg, acceptableKeyAlgs), "invalid key algorithm")
}
Expand Down
13 changes: 13 additions & 0 deletions wfe/wfe_mldsa.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build go1.27

package wfe

import (
"crypto/x509"
)

func init() {
goodSignatureAlgorithms[x509.MLDSA44] = true
goodSignatureAlgorithms[x509.MLDSA65] = true
goodSignatureAlgorithms[x509.MLDSA87] = true
}
Loading