]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/Crypto.cc: reduce scope of local variable in_buf
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 14 May 2013 17:54:21 +0000 (19:54 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 12:11:08 +0000 (14:11 +0200)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/auth/Crypto.cc

index f2c82c3ab0c174405709878fc2a568d93e3cd842..cf2a75d612653f713386cb84c22c18e94dc737a8 100644 (file)
@@ -245,7 +245,6 @@ void CryptoAES::encrypt(const bufferptr& secret, const bufferlist& in, bufferlis
 #ifdef USE_CRYPTOPP
   {
     const unsigned char *key = (const unsigned char *)secret.c_str();
-    const unsigned char *in_buf;
 
     string ciphertext;
     CryptoPP::AES::Encryption aesEncryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH);
@@ -255,8 +254,7 @@ void CryptoAES::encrypt(const bufferptr& secret, const bufferlist& in, bufferlis
 
     for (std::list<bufferptr>::const_iterator it = in.buffers().begin();
         it != in.buffers().end(); ++it) {
-      in_buf = (const unsigned char *)it->c_str();
-
+      const unsigned char *in_buf = (const unsigned char *)it->c_str();
       stfEncryptor.Put(in_buf, it->length());
     }
     try {