diff options
-rw-r--r-- | src/lib/object_store/FileSystem.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/object_store/FileSystem.cpp b/src/lib/object_store/FileSystem.cpp index 322e811..663472b 100644 --- a/src/lib/object_store/FileSystem.cpp +++ b/src/lib/object_store/FileSystem.cpp | |||
@@ -1125,11 +1125,19 @@ bool FileSystem::checkHash() | |||
1125 | int FileSystem::getFSHashLength() const | 1125 | int FileSystem::getFSHashLength() const |
1126 | { | 1126 | { |
1127 | int32_t const version = Configuration::i()->getInt("secstore.version", 2); | 1127 | int32_t const version = Configuration::i()->getInt("secstore.version", 2); |
1128 | int len; | ||
1129 | HashAlgorithm * hash; | ||
1128 | if(version < 3) { | 1130 | if(version < 3) { |
1129 | return CryptoFactory::i()->getHashAlgorithm("md5")->getHashSize(); | 1131 | hash = CryptoFactory::i()->getHashAlgorithm("md5"); |
1130 | } else { | 1132 | } else { |
1131 | return CryptoFactory::i()->getHashAlgorithm("hmacsha1")->getHashSize(); | 1133 | hash = CryptoFactory::i()->getHashAlgorithm("hmacsha1"); |
1134 | } | ||
1135 | if (hash){ | ||
1136 | len = hash->getHashSize(); | ||
1137 | CryptoFactory::i()->recycleHashAlgorithm(hash); | ||
1138 | return len; | ||
1132 | } | 1139 | } |
1140 | return -1; | ||
1133 | } | 1141 | } |
1134 | 1142 | ||
1135 | 1143 | ||