summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs59
1 files changed, 40 insertions, 19 deletions
diff --git a/kiki.hs b/kiki.hs
index 32aad70..e4d8e23 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -697,18 +697,8 @@ kiki_usage bExport bImport bSecret cmd = putStr $
697 [" --help" 697 [" --help"
698 ," Gives usage information" 698 ," Gives usage information"
699 ,"" 699 ,""
700 ," --homedir DIR" 700 ] ++ documentHomeDir ++ [""]
701 ," Where to find the files secring.gpg and pubring.gpg. The" 701 ++ documentPassphraseFDFlag bExport bImport bSecret
702 ," default location is taken from the environment variable"
703 ," GNUPGHOME. If this environment variable is not set and no"
704 ," directory is specified using this option then a hardcoded"
705 ," default of ~/.gnupg is assumed. "
706 ,""
707 ," WARNING: Confusingly, this is *not* your home directory as"
708 ," given by the HOME environment variable. The option is named"
709 ," or rather misnamed in a fashion similar to the gpg option with"
710 ," exactly the same functionality."
711 ,""] ++ documentPassphraseFDFlag bExport bImport bSecret
712 showwk :: [String] 702 showwk :: [String]
713 showwk = 703 showwk =
714 [" --show-wk" 704 [" --show-wk"
@@ -769,6 +759,21 @@ kiki_usage bExport bImport bSecret cmd = putStr $
769 ," 5E24CD442AA6965D2012E62A905C24185D5379C2" 759 ," 5E24CD442AA6965D2012E62A905C24185D5379C2"
770 ] 760 ]
771 761
762documentHomeDir :: [String]
763documentHomeDir =
764 [" --homedir DIR"
765 ," Where to find the files secring.gpg and pubring.gpg. The"
766 ," default location is taken from the environment variable"
767 ," GNUPGHOME. If this environment variable is not set and no"
768 ," directory is specified using this option then a hardcoded"
769 ," default of ~/.gnupg is assumed. "
770 ,""
771 ," WARNING: Confusingly, this is *not* your home directory as"
772 ," given by the HOME environment variable. The option is named"
773 ," or rather misnamed in a fashion similar to the gpg option with"
774 ," exactly the same functionality."
775 ]
776
772documentPassphraseFDFlag bExport bImport bSecret = 777documentPassphraseFDFlag bExport bImport bSecret =
773 if bSecret then 778 if bSecret then
774 [" --passphrase-fd FD" 779 [" --passphrase-fd FD"
@@ -1425,13 +1430,28 @@ kiki "merge" args = do
1425 Nothing -> error "Valid flow words are: spill,fill,sync,subkeys or match=KEYSPEC" 1430 Nothing -> error "Valid flow words are: spill,fill,sync,subkeys or match=KEYSPEC"
1426 Left (option,_) -> error $ "Unrecognized option: " ++ option 1431 Left (option,_) -> error $ "Unrecognized option: " ++ option
1427 1432
1428kiki "init-key" args | "--help" `elem` args = do 1433kiki "init" args | "--help" `elem` args = do
1429 putStr . unlines $ 1434 putStr . unlines $
1430 [ "kiki init-key [ --passphrase-fd=FD" 1435 [ "kiki init [ --passphrase-fd=FD"
1431 , " | --home[=HOMEDIR]" 1436 , " | --home[=HOMEDIR]"
1432 , " | --chroot=ROOTDIR ] ..."] 1437 , " | --chroot=ROOTDIR ] ..."
1433 return () 1438 , ""
1434kiki "init-key" args = do 1439 , "Initialize a GnuPG keyring for use with kiki. After completion, you"
1440 , "willl have a GnuPG master key with following specialized subkeys:"
1441 , ""
1442 , " tor - freshly generated tor hidden service key"
1443 , " ipsec - freshly generated VPN key"
1444 , " ssh-server - possibly read from /etc/ssh/*"
1445 , " ssh-client - possibly read from /root/.ssh/id_rsa"
1446 , ""
1447 , "OPTIONS"
1448 , ""
1449 , " --chroot=ROOTDIR"
1450 , " Use ROOTDIR for input of ssh keys and export files to"
1451 , " ROOTDIR/var/cache/kiki instead of the current system path."
1452 , ""
1453 ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True
1454kiki "init" args = do
1435 me <- getEffectiveUserID 1455 me <- getEffectiveUserID
1436 {- 1456 {-
1437 if me/=0 then error "This command requires root." else do 1457 if me/=0 then error "This command requires root." else do
@@ -1860,7 +1880,8 @@ commands =
1860 , ( "export-secret", "export (both public and secret) information into your keyring" ) 1880 , ( "export-secret", "export (both public and secret) information into your keyring" )
1861 , ( "export-public", "import (public) information into your keyring" ) 1881 , ( "export-public", "import (public) information into your keyring" )
1862 , ( "merge", "low level import/export operation" ) 1882 , ( "merge", "low level import/export operation" )
1863 , ( "init-key", "initialize the samizdat key ring") 1883 -- , ( "init-key", "initialize the samizdat key ring")
1884 , ( "init", "Initialize kiki")
1864 , ( "delete", "Delete a subkey and its associated signatures" ) 1885 , ( "delete", "Delete a subkey and its associated signatures" )
1865 , ( "tar", "import or export system key files in tar format" ) 1886 , ( "tar", "import or export system key files in tar format" )
1866 ] 1887 ]