]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - ImplantFile.hs
updates for new Crypto and dataenc package
[Lucu.git] / ImplantFile.hs
index 26be80e73e7dcd109160dcfe68be812ff4c66af2..7410b5f4cde3803c44a652a179763ee749298660 100644 (file)
@@ -5,7 +5,7 @@ import           Data.Bits
 import qualified Data.ByteString.Lazy as Lazy (ByteString)
 import qualified Data.ByteString.Lazy as L hiding (ByteString)
 import           Data.Char
-import           Data.Digest.SHA1
+import           Data.Digest.SHA2
 import           Data.Int
 import           Data.Maybe
 import           Data.Time
@@ -393,7 +393,7 @@ getMIMEType opts srcFile
 getLastModified :: FilePath -> IO UTCTime
 getLastModified "-"   = getCurrentTime
 getLastModified fpath = getFileStatus fpath
-                        >>= return . posixSecondsToUTCTime . toEnum . fromEnum . modificationTime
+                        >>= return . posixSecondsToUTCTime . fromRational . toRational . modificationTime
 
 
 getETag :: [CmdOpt] -> Lazy.ByteString -> IO String
@@ -408,7 +408,7 @@ getETag opts input
           _                -> error "too many --etag options."
     where
       mkETagFromInput :: String
-      mkETagFromInput = "SHA-1:" ++ (toHex $ hash $ L.unpack input)
+      mkETagFromInput = "SHA-1:" ++ (toHex $ toOctets $ sha256 $ L.unpack input)
 
       toHex :: [Word8] -> String
       toHex []     = ""