summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-12-13 01:48:50 -0500
committerjoe <joe@jerkface.net>2013-12-13 01:48:50 -0500
commit43478c909db3efb9ea1f7ab1942c92c46026f869 (patch)
treeb24a481a60be7877ad77fb2d36bf00619ea52b00
parentb7416ca157968c70ab07d47666af188e0ba9acaa (diff)
Updated to patched OpenPGP with ecc_curve fields
-rw-r--r--kiki.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/kiki.hs b/kiki.hs
index 22000d0..789bc07 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -23,7 +23,7 @@ import Control.Monad
23import qualified Text.Show.Pretty as PP 23import qualified Text.Show.Pretty as PP
24import Text.PrettyPrint as PP hiding ((<>)) 24import Text.PrettyPrint as PP hiding ((<>))
25import Data.List 25import Data.List
26import Data.OpenPGP.CryptoAPI 26import Data.OpenPGP.CryptoAPI (verify,fingerprint,sign,decryptSecretKey)
27import Data.Ord 27import Data.Ord
28import Data.Maybe 28import Data.Maybe
29import Data.Bits 29import Data.Bits
@@ -236,10 +236,13 @@ getPackets = do
236 Left (_,_,_) -> return [] 236 Left (_,_,_) -> return []
237 237
238 238
239instance Default S.ByteString where def = S.empty
240
239secretToPublic pkt@(SecretKeyPacket {}) = 241secretToPublic pkt@(SecretKeyPacket {}) =
240 PublicKeyPacket { version = version pkt 242 PublicKeyPacket { version = version pkt
241 , timestamp = timestamp pkt 243 , timestamp = timestamp pkt
242 , key_algorithm = key_algorithm pkt 244 , key_algorithm = key_algorithm pkt
245 , ecc_curve = def
243 , key = let seckey = key pkt 246 , key = let seckey = key pkt
244 pubs = public_key_fields (key_algorithm pkt) 247 pubs = public_key_fields (key_algorithm pkt)
245 in filter (\(k,v) -> k `elem` pubs) seckey 248 in filter (\(k,v) -> k `elem` pubs) seckey
@@ -844,6 +847,7 @@ readKeyFromFile False "PEM" fname = do
844 { version = 4 847 { version = 4
845 , timestamp = toEnum (fromEnum timestamp) 848 , timestamp = toEnum (fromEnum timestamp)
846 , key_algorithm = RSA 849 , key_algorithm = RSA
850 , ecc_curve = def
847 , key = [ -- public fields... 851 , key = [ -- public fields...
848 ('n',rsaN rsa) 852 ('n',rsaN rsa)
849 ,('e',rsaE rsa) 853 ,('e',rsaE rsa)