diff --git a/internal/app/wwctl/configure/tls/main_test.go b/internal/app/wwctl/configure/tls/main_test.go index 3c5b20f0..7759dc91 100644 --- a/internal/app/wwctl/configure/tls/main_test.go +++ b/internal/app/wwctl/configure/tls/main_test.go @@ -38,7 +38,6 @@ func Test_Keys(t *testing.T) { assert.NoError(t, err) assert.FileExists(t, path.Join(keystorePath, "warewulf.key")) assert.FileExists(t, path.Join(keystorePath, "warewulf.crt")) - assert.FileExists(t, path.Join(keystorePath, "warewulf.rsa.pub")) }) t.Run("keys exist check", func(t *testing.T) { diff --git a/internal/pkg/configure/tls.go b/internal/pkg/configure/tls.go index 1df303ff..4a65f72c 100644 --- a/internal/pkg/configure/tls.go +++ b/internal/pkg/configure/tls.go @@ -26,7 +26,6 @@ func GenTLSKeys() error { keyFile := path.Join(keystore, "warewulf.key") certFile := path.Join(keystore, "warewulf.crt") - pubFile := path.Join(keystore, "warewulf.rsa.pub") wwlog.Verbose("Generating new x509 keys in %s", keystore) priv, err := rsa.GenerateKey(rand.Reader, 4096) if err != nil { @@ -87,18 +86,5 @@ func GenTLSKeys() error { return fmt.Errorf("failed to write data to cert file: %w", err) } - pubBytes, err := x509.MarshalPKIXPublicKey(&priv.PublicKey) - if err != nil { - return fmt.Errorf("failed to marshal public key: %w", err) - } - pubOut, err := os.OpenFile(pubFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - if err != nil { - return fmt.Errorf("failed to open public key file for writing: %w", err) - } - defer pubOut.Close() - if err := pem.Encode(pubOut, &pem.Block{Type: "PUBLIC KEY", Bytes: pubBytes}); err != nil { - return fmt.Errorf("failed to write data to public key file: %w", err) - } - return nil }