summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-02 23:56:37 -0400
committerJoe Crayne <joe@jerkface.net>2019-07-03 00:03:04 -0400
commit23ae3589be6273b9fe7b0925a2b290e0e48f38d6 (patch)
tree37d649b3fe16e0ac54c6291f24211e7e7c742f39
parente0bfb091bafa1c9fde9f3f87404115ac5219da5d (diff)
Todo stub and help for new command "spawn".
-rw-r--r--kiki.hs10
-rw-r--r--lib/Kiki.hs4
2 files changed, 14 insertions, 0 deletions
diff --git a/kiki.hs b/kiki.hs
index 4ba9b4b..1143e04 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -54,6 +54,7 @@ import Control.Arrow (first,second)
54import Data.Monoid ( (<>) ) 54import Data.Monoid ( (<>) )
55import Data.Binary.Put 55import Data.Binary.Put
56 56
57import CommandLine
57import Data.OpenPGP.Util (verify, fingerprint, GenerateKeyParams(..)) 58import Data.OpenPGP.Util (verify, fingerprint, GenerateKeyParams(..))
58import ScanningParser 59import ScanningParser
59import PEM 60import PEM
@@ -1518,6 +1519,14 @@ kiki "init" args | "--help" `elem` args = do
1518 ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True 1519 ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True
1519 1520
1520kiki "init" args = run args $ importAndRefresh <$> dashdashChroot <*> dashdashHomedir <*> dashdashCipher 1521kiki "init" args = run args $ importAndRefresh <$> dashdashChroot <*> dashdashHomedir <*> dashdashCipher
1522kiki "spawn" args | "--help" `elem` args =
1523 putStr . unlines $
1524 [ "kiki spawn [ --passphrase-fd=FD"
1525 , " | --homedir[=HOMEDIR]"
1526 , " | --cipher="++intercalate "|" (map ciphername ciphers)++" ]"
1527 , " <PATH>"
1528 ]
1529kiki "spawn" args = run args $ spawn <$> dashdashHomedir <*> dashdashCipher <*> param 0
1521 1530
1522kiki "delete" args | "--help" `elem` args = do 1531kiki "delete" args | "--help" `elem` args = do
1523 putStr . unlines $ 1532 putStr . unlines $
@@ -1739,6 +1748,7 @@ commands =
1739 , ( "merge", "low level import/export operation" ) 1748 , ( "merge", "low level import/export operation" )
1740 -- , ( "init-key", "initialize the samizdat key ring") 1749 -- , ( "init-key", "initialize the samizdat key ring")
1741 , ( "init", "Initialize kiki") 1750 , ( "init", "Initialize kiki")
1751 , ( "spawn", "Initialize a new, pre-authenticated, key set for use by another person.")
1742 , ( "delete", "Delete a subkey and its associated signatures" ) 1752 , ( "delete", "Delete a subkey and its associated signatures" )
1743 , ( "rename", "Change the usage tag on a specified subkey" ) 1753 , ( "rename", "Change the usage tag on a specified subkey" )
1744 -- also repairs signature and adds missing cross-certification. 1754 -- also repairs signature and adds missing cross-certification.
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index 6481b58..5201dac 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -148,6 +148,10 @@ outputReport report = do
148 forM_ report $ \(fname,act) -> do 148 forM_ report $ \(fname,act) -> do
149 putStrLn $ fname ++ ": " ++ reportString act 149 putStrLn $ fname ++ ": " ++ reportString act
150 150
151spawn :: CommonArgsParsed -> SymmetricAlgorithm -> FilePath -> IO ()
152spawn cmn cipher path = do
153 putStrLn "TODO: implement keygen.sh replacement.sh"
154
151importAndRefresh :: (FilePath -> FilePath) -> CommonArgsParsed -> SymmetricAlgorithm -> IO () 155importAndRefresh :: (FilePath -> FilePath) -> CommonArgsParsed -> SymmetricAlgorithm -> IO ()
152importAndRefresh root cmn cipher = do 156importAndRefresh root cmn cipher = do
153 let rootdir = do guard (root "x" /= "x") 157 let rootdir = do guard (root "x" /= "x")