Changeset 2481 for box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp
- Timestamp:
- 29/03/2009 14:51:24 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp
r2127 r2481 161 161 162 162 // Decode the header 163 int size = BACKUPSTOREFILENAME_GET_SIZE( *this);164 int encoding = BACKUPSTOREFILENAME_GET_ENCODING( *this);163 int size = BACKUPSTOREFILENAME_GET_SIZE(GetEncodedFilename()); 164 int encoding = BACKUPSTOREFILENAME_GET_ENCODING(GetEncodedFilename()); 165 165 166 166 // Decode based on encoding given in the header … … 170 170 BOX_TRACE("**** BackupStoreFilename encoded with " 171 171 "Clear encoding ****"); 172 mClearFilename.assign(c_str() + 2, size - 2); 172 mClearFilename.assign(GetEncodedFilename().c_str() + 2, 173 size - 2); 173 174 break; 174 175 … … 245 246 246 247 // Store the encoded string 247 assign((char*)buffer, encSize);248 SetEncodedFilename(std::string((char*)buffer, encSize)); 248 249 } 249 250 … … 259 260 void BackupStoreFilenameClear::DecryptEncoded(CipherContext &rCipherContext) const 260 261 { 262 const std::string& rEncoded = GetEncodedFilename(); 263 261 264 // Work out max size 262 int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize( size()) + 4;265 int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize(rEncoded.size()) + 4; 263 266 264 267 // Make sure encode/decode buffer has enough space … … 269 272 270 273 // Decrypt 271 const char *str = c_str() + 2;272 int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, size() - 2);274 const char *str = rEncoded.c_str() + 2; 275 int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, rEncoded.size() - 2); 273 276 274 277 // Assign to this
Note: See TracChangeset
for help on using the changeset viewer.
