diff options
author | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
commit | e03bb0606a10f29c8b94909a713a5bb5c69e88b7 (patch) | |
tree | 6d8d07894579438c8cc70e08f5730c3c95dfe768 /indra/llmessage/llblowfishcipher.cpp | |
parent | 2638f12f95eea692502836cf6548b4a0b234d009 (diff) |
merge -r62831:64079 branches/maintenance to release
Diffstat (limited to 'indra/llmessage/llblowfishcipher.cpp')
-rw-r--r-- | indra/llmessage/llblowfishcipher.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp index d15e4fb69a..609c136d14 100644 --- a/indra/llmessage/llblowfishcipher.cpp +++ b/indra/llmessage/llblowfishcipher.cpp @@ -1,5 +1,5 @@ /** - * @file llblowcipher.cpp + * @file llblowfishcipher.cpp * @brief Wrapper around OpenSSL Blowfish encryption algorithm. * * We do not have OpenSSL headers or libraries on Windows, so this @@ -65,33 +65,33 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) << " iv_len " << iv_length << llendl; - int output_len = 0;
- int temp_len = 0;
- if (!EVP_EncryptUpdate(&context,
- dst,
- &output_len,
- src,
- src_len))
- {
- llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl;
- goto ERROR;
- }
-
- // There may be some final data left to encrypt if the input is
- // not an exact multiple of the block size.
- if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len))
- {
- llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl;
- goto ERROR;
- }
- output_len += temp_len;
-
- EVP_CIPHER_CTX_cleanup(&context);
- return output_len;
-
-ERROR:
- EVP_CIPHER_CTX_cleanup(&context);
- return 0;
+ int output_len = 0; + int temp_len = 0; + if (!EVP_EncryptUpdate(&context, + dst, + &output_len, + src, + src_len)) + { + llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl; + goto ERROR; + } + + // There may be some final data left to encrypt if the input is + // not an exact multiple of the block size. + if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len)) + { + llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl; + goto ERROR; + } + output_len += temp_len; + + EVP_CIPHER_CTX_cleanup(&context); + return output_len; + +ERROR: + EVP_CIPHER_CTX_cleanup(&context); + return 0; } // virtual |