diff options
-rw-r--r-- | kiki.cabal | 19 | ||||
-rw-r--r-- | kiki.hs | 59 |
2 files changed, 54 insertions, 24 deletions
@@ -49,20 +49,29 @@ Executable kiki | |||
49 | 49 | ||
50 | Executable hosts | 50 | Executable hosts |
51 | Main-is: hosts.hs | 51 | Main-is: hosts.hs |
52 | buildable: False | 52 | Build-Depends: base >=4.6.0.0, |
53 | c-sources: dotlock.c | 53 | bytestring, |
54 | network, | ||
55 | kiki | ||
56 | |||
57 | Executable cokiki | ||
58 | Main-is: cokiki.hs | ||
59 | Build-Depends: base >=4.6.0.0, | ||
60 | unix, | ||
61 | kiki | ||
54 | 62 | ||
55 | library | 63 | library |
56 | hs-source-dirs: lib | 64 | hs-source-dirs: lib |
57 | exposed-modules: KeyRing, | 65 | exposed-modules: KeyRing, |
66 | Kiki, | ||
58 | ScanningParser, | 67 | ScanningParser, |
59 | PEM, | 68 | PEM, |
60 | DotLock, | 69 | DotLock, |
61 | Base58, | 70 | Base58, |
62 | CryptoCoins, | 71 | CryptoCoins, |
63 | ProcessUtils | 72 | ProcessUtils, |
64 | other-modules: Hosts, | 73 | Hosts |
65 | TimeUtil, | 74 | other-modules: TimeUtil, |
66 | Compat, | 75 | Compat, |
67 | FunctorToMaybe | 76 | FunctorToMaybe |
68 | 77 | ||
@@ -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 | ||
762 | documentHomeDir :: [String] | ||
763 | documentHomeDir = | ||
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 | |||
772 | documentPassphraseFDFlag bExport bImport bSecret = | 777 | documentPassphraseFDFlag 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 | ||
1428 | kiki "init-key" args | "--help" `elem` args = do | 1433 | kiki "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 | , "" |
1434 | kiki "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 | ||
1454 | kiki "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 | ] |