diff options
Diffstat (limited to 'kiki.hs')
-rw-r--r-- | kiki.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -271,6 +271,7 @@ show_wk secring_file grip db = do | |||
271 | let sec_db = Map.filter gripmatch db | 271 | let sec_db = Map.filter gripmatch db |
272 | gripmatch (KeyData p _ _ _) = | 272 | gripmatch (KeyData p _ _ _) = |
273 | Map.member secring_file (locations p) | 273 | Map.member secring_file (locations p) |
274 | || Map.member "&secret" (locations p) | ||
274 | Message sec = flattenKeys False sec_db | 275 | Message sec = flattenKeys False sec_db |
275 | putStrLn $ listKeysFiltered (maybeToList grip) sec | 276 | putStrLn $ listKeysFiltered (maybeToList grip) sec |
276 | 277 | ||
@@ -1168,6 +1169,9 @@ kiki "init-key" args = do | |||
1168 | sshcpath0 = fromMaybe "" rootdir ++ "/root/.ssh/id_rsa" | 1169 | sshcpath0 = fromMaybe "" rootdir ++ "/root/.ssh/id_rsa" |
1169 | sshspath0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key" | 1170 | sshspath0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key" |
1170 | ipsecpath0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/private/%(onion).pem" | 1171 | ipsecpath0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/private/%(onion).pem" |
1172 | sshcpathpub0 = fromMaybe "" rootdir ++ "/root/.ssh/id_rsa.pub" | ||
1173 | sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" | ||
1174 | ipsecpathpub0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/certs/%(onion).pem" | ||
1171 | 1175 | ||
1172 | -- First, we ensure that the tor key exists and is imported | 1176 | -- First, we ensure that the tor key exists and is imported |
1173 | -- so that we know where to put the strongswan key. | 1177 | -- so that we know where to put the strongswan key. |
@@ -1226,6 +1230,7 @@ kiki "init-key" args = do | |||
1226 | 1230 | ||
1227 | -- Finally, export public keys if they do not exist. | 1231 | -- Finally, export public keys if they do not exist. |
1228 | flip (maybe $ warn "missing working key?") (rtGrip rt) $ \grip -> do | 1232 | flip (maybe $ warn "missing working key?") (rtGrip rt) $ \grip -> do |
1233 | -- TODO: the .pub file paths should be read from config also | ||
1229 | gotc <- doesFileExist (sshcpath++".pub") | 1234 | gotc <- doesFileExist (sshcpath++".pub") |
1230 | when (not gotc) $ do | 1235 | when (not gotc) $ do |
1231 | either warn (writeFile $ sshcpath++".pub") | 1236 | either warn (writeFile $ sshcpath++".pub") |
@@ -1235,6 +1240,8 @@ kiki "init-key" args = do | |||
1235 | either warn (writeFile $ sshspath++".pub") | 1240 | either warn (writeFile $ sshspath++".pub") |
1236 | $ show_ssh' "ssh-host" grip (rtKeyDB rt) | 1241 | $ show_ssh' "ssh-host" grip (rtKeyDB rt) |
1237 | 1242 | ||
1243 | -- TODO: strongswan public /etc/ipsec.d/certs/%(onion).pem | ||
1244 | |||
1238 | return () | 1245 | return () |
1239 | 1246 | ||
1240 | splitArg :: String -> Either (String,Maybe String) String | 1247 | splitArg :: String -> Either (String,Maybe String) String |