diff options
-rw-r--r-- | KeyRing.hs | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -108,7 +108,7 @@ import Data.ASN1.Types ( toASN1, ASN1Object, fromASN1 | |||
108 | import Data.ASN1.BitArray ( BitArray(..), toBitArray ) | 108 | import Data.ASN1.BitArray ( BitArray(..), toBitArray ) |
109 | import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' ) | 109 | import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' ) |
110 | import Data.ASN1.BinaryEncoding ( DER(..) ) | 110 | import Data.ASN1.BinaryEncoding ( DER(..) ) |
111 | import Data.Time.Clock.POSIX ( getPOSIXTime, POSIXTime ) | 111 | import Data.Time.Clock.POSIX ( POSIXTime ) |
112 | import Data.Bits ( Bits ) | 112 | import Data.Bits ( Bits ) |
113 | import Data.Text.Encoding ( encodeUtf8 ) | 113 | import Data.Text.Encoding ( encodeUtf8 ) |
114 | import qualified Data.Map as Map | 114 | import qualified Data.Map as Map |
@@ -150,6 +150,8 @@ import qualified Data.ByteString.Lazy.Char8 as Char8 | |||
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | import TimeUtil | ||
154 | import PEM | ||
153 | import qualified Hosts | 155 | import qualified Hosts |
154 | import qualified CryptoCoins | 156 | import qualified CryptoCoins |
155 | import Base58 | 157 | import Base58 |
@@ -1417,10 +1419,6 @@ readKeyFromFile False "PEM" fname = do | |||
1417 | } | 1419 | } |
1418 | readKeyFromFile is_public fmt filename = error ("unimplemented key type: "++fmt) | 1420 | readKeyFromFile is_public fmt filename = error ("unimplemented key type: "++fmt) |
1419 | 1421 | ||
1420 | data PEMBlob = PEMBlob { pemType :: ByteString | ||
1421 | , pemBlob :: ByteString | ||
1422 | } | ||
1423 | |||
1424 | extractPEM :: ByteString -> ByteString -> Maybe ByteString | 1422 | extractPEM :: ByteString -> ByteString -> Maybe ByteString |
1425 | extractPEM typ pem = if L.null blob then Nothing else Just blob | 1423 | extractPEM typ pem = if L.null blob then Nothing else Just blob |
1426 | where | 1424 | where |
@@ -2460,9 +2458,6 @@ readPacketsFromFile ctx fname = do | |||
2460 | return $ decode input | 2458 | return $ decode input |
2461 | #endif | 2459 | #endif |
2462 | 2460 | ||
2463 | now :: IO Integer | ||
2464 | now = floor <$> Data.Time.Clock.POSIX.getPOSIXTime | ||
2465 | |||
2466 | signature_time :: SignatureOver -> Word32 | 2461 | signature_time :: SignatureOver -> Word32 |
2467 | signature_time ov = case if null cs then ds else cs of | 2462 | signature_time ov = case if null cs then ds else cs of |
2468 | [] -> minBound | 2463 | [] -> minBound |