From 84685f24c9614d5f2c19851b4c63744bcb037241 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jan 2015 15:59:42 -0400 Subject: [PATCH] Ssh.hostKeys now also installs any available SshEd25519 keys. --- debian/changelog | 3 ++- src/Propellor/Property/Ssh.hs | 9 +++------ src/Propellor/Types/PrivData.hs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0176daf..3cdaaa8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,8 @@ propellor (1.3.0) UNRELEASED; urgency=medium * Update intermediary propellor in --spin --via * Added support for DNSSEC. * sshPubKey is renamed to Ssh.pubKey, and has an added SshKeyType - parameter. + parameter. (API change) + * Ssh.hostKeys now also installs any available SshEd25519 keys. * Fix build with process 1.2.1.0. -- Joey Hess Thu, 01 Jan 2015 13:27:23 -0400 diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index 9a0b215..301c628 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -90,13 +90,10 @@ pubKey t k = pureInfoProperty ("ssh pubkey known") $ getPubKey :: Propellor (M.Map SshKeyType String) getPubKey = asks (_sshPubKey . hostInfo) --- | Installs all commonly used types of ssh host keys. +-- | Installs all available types of ssh host keys. hostKeys :: IsContext c => c -> Property -hostKeys ctx = propertyList "known ssh host keys" - [ hostKey SshDsa ctx - , hostKey SshRsa ctx - , hostKey SshEcdsa ctx - ] +hostKeys ctx = propertyList "known ssh host keys" $ + map (flip hostKey ctx) [minBound..maxBound] -- | Installs a single ssh host key. -- diff --git a/src/Propellor/Types/PrivData.hs b/src/Propellor/Types/PrivData.hs index d6941a7..c760ae5 100644 --- a/src/Propellor/Types/PrivData.hs +++ b/src/Propellor/Types/PrivData.hs @@ -90,7 +90,7 @@ hostContext = HostContext Context type PrivData = String data SshKeyType = SshRsa | SshDsa | SshEcdsa | SshEd25519 - deriving (Read, Show, Ord, Eq) + deriving (Read, Show, Ord, Eq, Enum, Bounded) -- | Parameter that would be passed to ssh-keygen to generate key of this type sshKeyTypeParam :: SshKeyType -> String