From ed5795eead303551aacf4ff6e249b9573f4bbf3a Mon Sep 17 00:00:00 2001 From: Earl Chew Date: Sat, 5 Jan 2019 21:08:41 +0000 Subject: [PATCH] [curl] Assume long encryption keys are base64 encoded Correct tabs and whitespace. Signed-off-by: Earl Chew --- src/curl.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index cc70877..58b33cb 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -972,23 +972,23 @@ bool S3fsCurl::PushbackSseKeys(string& onekey) if(NULL != (p_key = (char *)s3fs_decode64(onekey.c_str(), &keylength))) { raw_key = string(p_key, keylength); - base64_key = onekey; - free(p_key); - } else { - S3FS_PRN_ERR("Failed to convert base64 to SSE-C key %s", onekey.c_str()); - return false; - } + base64_key = onekey; + free(p_key); + } else { + S3FS_PRN_ERR("Failed to convert base64 to SSE-C key %s", onekey.c_str()); + return false; + } } else { char* pbase64_key; if(NULL != (pbase64_key = s3fs_base64((unsigned char*)onekey.c_str(), onekey.length()))) { - raw_key = onekey; + raw_key = onekey; base64_key = pbase64_key; free(pbase64_key); - } else { - S3FS_PRN_ERR("Failed to convert base64 from SSE-C key %s", onekey.c_str()); - return false; - } + } else { + S3FS_PRN_ERR("Failed to convert base64 from SSE-C key %s", onekey.c_str()); + return false; + } } // make MD5