diff options
author | joe <joe@jerkface.net> | 2014-05-12 20:55:03 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-05-12 20:55:03 -0400 |
commit | a9f569979d0618d55c273465d85c402d9b6c9a10 (patch) | |
tree | d3eb3355f3a53dabff7e3980ae4bdaaae7eec7e9 /KeyRing.hs | |
parent | 83c9390271cfcb9cd64d0ffab0a2713f204c2ccc (diff) |
Take the date from the certificate when importing PEM files.
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -113,7 +113,7 @@ import Data.ASN1.Types ( toASN1, ASN1Object, fromASN1 | |||
113 | import Data.ASN1.BitArray ( BitArray(..), toBitArray ) | 113 | import Data.ASN1.BitArray ( BitArray(..), toBitArray ) |
114 | import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' ) | 114 | import Data.ASN1.Encoding ( encodeASN1, encodeASN1', decodeASN1, decodeASN1' ) |
115 | import Data.ASN1.BinaryEncoding ( DER(..) ) | 115 | import Data.ASN1.BinaryEncoding ( DER(..) ) |
116 | import Data.Time.Clock.POSIX ( POSIXTime, utcTimeToPOSIXSeconds, posixSecondsToUTCTime ) | 116 | import Data.Time.Clock.POSIX ( POSIXTime, utcTimeToPOSIXSeconds ) |
117 | import Data.Time.Clock ( UTCTime ) | 117 | import Data.Time.Clock ( UTCTime ) |
118 | import Data.Bits ( Bits ) | 118 | import Data.Bits ( Bits ) |
119 | import Data.Text.Encoding ( encodeUtf8 ) | 119 | import 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 | ||