summaryrefslogtreecommitdiff
path: root/KeyRing.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-05-12 20:55:03 -0400
committerjoe <joe@jerkface.net>2014-05-12 20:55:03 -0400
commita9f569979d0618d55c273465d85c402d9b6c9a10 (patch)
treed3eb3355f3a53dabff7e3980ae4bdaaae7eec7e9 /KeyRing.hs
parent83c9390271cfcb9cd64d0ffab0a2713f204c2ccc (diff)
Take the date from the certificate when importing PEM files.
Diffstat (limited to 'KeyRing.hs')
-rw-r--r--KeyRing.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index 94039f6..e0994cf 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -113,7 +113,7 @@ import Data.ASN1.Types ( toASN1, ASN1Object, fromASN1
113import Data.ASN1.BitArray ( BitArray(..), toBitArray ) 113import Data.ASN1.BitArray ( BitArray(..), toBitArray )
114import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' ) 114import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' )
115import Data.ASN1.BinaryEncoding ( DER(..) ) 115import Data.ASN1.BinaryEncoding ( DER(..) )
116import Data.Time.Clock.POSIX ( POSIXTime, utcTimeToPOSIXSeconds, posixSecondsToUTCTime ) 116import Data.Time.Clock.POSIX ( POSIXTime, utcTimeToPOSIXSeconds )
117import Data.Time.Clock ( UTCTime ) 117import Data.Time.Clock ( UTCTime )
118import Data.Bits ( Bits ) 118import Data.Bits ( Bits )
119import Data.Text.Encoding ( encodeUtf8 ) 119import Data.Text.Encoding ( encodeUtf8 )
@@ -1573,7 +1573,9 @@ doImport doDecrypt db (fname,subspec,ms,_) = do
1573 { human_readable = False 1573 { human_readable = False
1574 , notation_name = "x509cert@" 1574 , notation_name = "x509cert@"
1575 , notation_value = Char8.unpack bs } 1575 , notation_value = Char8.unpack bs }
1576 r <- doImportG doDecrypt db m0 (mkUsage tag:blobs) fname key 1576 datedKey = key { timestamp = fromTime $ minimum dates }
1577 dates = fromTime (timestamp key) : map pcertTimestamp certs
1578 r <- doImportG doDecrypt db m0 (mkUsage tag:blobs) fname datedKey
1577 try r $ \(db',report') -> do 1579 try r $ \(db',report') -> do
1578 return $ KikiSuccess (db',report++report') 1580 return $ KikiSuccess (db',report++report')
1579 1581