Merge pull request #3964 from satherton/fix-blob-key-length
Bug fix, blob client was not correctly using keys longer than 64 byte…
This commit is contained in:
commit
622985a4cc
|
@ -873,7 +873,12 @@ Future<BlobStoreEndpoint::ListResult> BlobStoreEndpoint::listBucket(std::string
|
|||
std::string BlobStoreEndpoint::hmac_sha1(std::string const &msg) {
|
||||
std::string key = secret;
|
||||
|
||||
// First pad the key to 64 bytes.
|
||||
// Hash key to shorten it if it is longer than SHA1 block size
|
||||
if(key.size() > 64) {
|
||||
key = SHA1::from_string(key);
|
||||
}
|
||||
|
||||
// Pad key up to SHA1 block size if needed
|
||||
key.append(64 - key.size(), '\0');
|
||||
|
||||
std::string kipad = key;
|
||||
|
|
Loading…
Reference in New Issue