summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Backend/SHA224.hs14
-rw-r--r--Backend/SHA256.hs14
-rw-r--r--Backend/SHA384.hs14
-rw-r--r--Backend/SHA512.hs14
-rw-r--r--BackendList.hs8
-rw-r--r--configure.hs10
-rw-r--r--debian/changelog1
-rw-r--r--doc/backends.mdwn3
8 files changed, 76 insertions, 2 deletions
diff --git a/Backend/SHA224.hs b/Backend/SHA224.hs
new file mode 100644
index 000000000..614f31c4b
--- /dev/null
+++ b/Backend/SHA224.hs
@@ -0,0 +1,14 @@
+{- git-annex "SHA224" backend
+ -
+ - Copyright 2011 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Backend.SHA224 (backend) where
+
+import Types
+import Backend.SHA
+
+backend :: Backend Annex
+backend = genBackend 224
diff --git a/Backend/SHA256.hs b/Backend/SHA256.hs
new file mode 100644
index 000000000..42d3d48c7
--- /dev/null
+++ b/Backend/SHA256.hs
@@ -0,0 +1,14 @@
+{- git-annex "SHA256" backend
+ -
+ - Copyright 2011 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Backend.SHA256 (backend) where
+
+import Types
+import Backend.SHA
+
+backend :: Backend Annex
+backend = genBackend 256
diff --git a/Backend/SHA384.hs b/Backend/SHA384.hs
new file mode 100644
index 000000000..0cf77ea64
--- /dev/null
+++ b/Backend/SHA384.hs
@@ -0,0 +1,14 @@
+{- git-annex "SHA384" backend
+ -
+ - Copyright 2011 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Backend.SHA384 (backend) where
+
+import Types
+import Backend.SHA
+
+backend :: Backend Annex
+backend = genBackend 384
diff --git a/Backend/SHA512.hs b/Backend/SHA512.hs
new file mode 100644
index 000000000..aed8bbced
--- /dev/null
+++ b/Backend/SHA512.hs
@@ -0,0 +1,14 @@
+{- git-annex "SHA512" backend
+ -
+ - Copyright 2011 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Backend.SHA512 (backend) where
+
+import Types
+import Backend.SHA
+
+backend :: Backend Annex
+backend = genBackend 512
diff --git a/BackendList.hs b/BackendList.hs
index 5ae78bcc7..4279b69fc 100644
--- a/BackendList.hs
+++ b/BackendList.hs
@@ -10,6 +10,10 @@ module BackendList (allBackends) where
-- When adding a new backend, import it here and add it to the list.
import qualified Backend.WORM
import qualified Backend.SHA1
+import qualified Backend.SHA256
+import qualified Backend.SHA512
+import qualified Backend.SHA224
+import qualified Backend.SHA384
import qualified Backend.URL
import Types
@@ -17,5 +21,9 @@ allBackends :: [Backend Annex]
allBackends =
[ Backend.WORM.backend
, Backend.SHA1.backend
+ , Backend.SHA256.backend
+ , Backend.SHA512.backend
+ , Backend.SHA224.backend
+ , Backend.SHA384.backend
, Backend.URL.backend
]
diff --git a/configure.hs b/configure.hs
index b5437ec1a..772ba5489 100644
--- a/configure.hs
+++ b/configure.hs
@@ -11,11 +11,17 @@ tests = [
, testCp "cp_p" "-p"
, testCp "cp_reflink_auto" "--reflink=auto"
, TestCase "uuid generator" $ selectCmd "uuid" ["uuid", "uuidgen"]
- , TestCase "sha1sum" $ requireCmd "sha1sum" "sha1sum </dev/null"
, TestCase "xargs -0" $ requireCmd "xargs_0" "xargs -0 </dev/null"
, TestCase "rsync" $ requireCmd "rsync" "rsync --version >/dev/null"
, TestCase "unicode FilePath support" $ unicodeFilePath
- ]
+ ] ++ shaTestCases [1, 256, 512, 224, 384]
+
+shaTestCases :: [Int] -> [TestCase]
+shaTestCases l = map make l
+ where
+ make n =
+ let cmd = "sha" ++ show n ++ "sum"
+ in TestCase cmd $ requireCmd cmd (cmd ++ " </dev/null")
tmpDir :: String
tmpDir = "tmp"
diff --git a/debian/changelog b/debian/changelog
index d63422324..8d7dd46e5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ git-annex (0.22) UNRELEASED; urgency=low
* Support filenames that start with a dash; when such a file is passed
to a utility it will be escaped to avoid it being interpreted as an
option.
+ * New backends: SHA512 SHA384 SHA256 SHA224
-- Joey Hess <joeyh@debian.org> Sun, 13 Feb 2011 00:48:02 -0400
diff --git a/doc/backends.mdwn b/doc/backends.mdwn
index 3e605e4b1..5d02ad3a1 100644
--- a/doc/backends.mdwn
+++ b/doc/backends.mdwn
@@ -19,6 +19,9 @@ can use different backends for different files.
allows modifications of files to be tracked. Its need to generate checksums
can make it slower for large files.
for use.
+* `SHA512`, `SHA384`, `SHA256`, `SHA224` -- Like SHA1, but larger
+ checksums. Mostly useful for the very paranoid, or anyone who is
+ researching checksum collisions and wants to annex their colliding data. ;)
* `URL` -- This backend downloads the file's content from an external URL.
The `annex.backends` git-config setting can be used to list the backends