diff options
author | Jacek Antonelli | 2008-08-15 23:44:59 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:59 -0500 |
commit | a408bac29378072fbf36864164149458c978cfcc (patch) | |
tree | 67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/llmessage/llblowfishcipher.cpp | |
parent | Second Life viewer sources 1.17.0.12 (diff) | |
download | meta-impy-a408bac29378072fbf36864164149458c978cfcc.zip meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2 meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz |
Second Life viewer sources 1.17.1.0
Diffstat (limited to 'linden/indra/llmessage/llblowfishcipher.cpp')
-rw-r--r-- | linden/indra/llmessage/llblowfishcipher.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/linden/indra/llmessage/llblowfishcipher.cpp b/linden/indra/llmessage/llblowfishcipher.cpp index 1772078..62464de 100644 --- a/linden/indra/llmessage/llblowfishcipher.cpp +++ b/linden/indra/llmessage/llblowfishcipher.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * @file llblowcipher.cpp | 2 | * @file llblowfishcipher.cpp |
3 | * @brief Wrapper around OpenSSL Blowfish encryption algorithm. | 3 | * @brief Wrapper around OpenSSL Blowfish encryption algorithm. |
4 | * | 4 | * |
5 | * We do not have OpenSSL headers or libraries on Windows, so this | 5 | * We do not have OpenSSL headers or libraries on Windows, so this |
@@ -85,33 +85,33 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) | |||
85 | << " iv_len " << iv_length | 85 | << " iv_len " << iv_length |
86 | << llendl; | 86 | << llendl; |
87 | 87 | ||
88 | int output_len = 0; | 88 | int output_len = 0; |
89 | int temp_len = 0; | 89 | int temp_len = 0; |
90 | if (!EVP_EncryptUpdate(&context, | 90 | if (!EVP_EncryptUpdate(&context, |
91 | dst, | 91 | dst, |
92 | &output_len, | 92 | &output_len, |
93 | src, | 93 | src, |
94 | src_len)) | 94 | src_len)) |
95 | { | 95 | { |
96 | llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl; | 96 | llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl; |
97 | goto ERROR; | 97 | goto ERROR; |
98 | } | 98 | } |
99 | 99 | ||
100 | // There may be some final data left to encrypt if the input is | 100 | // There may be some final data left to encrypt if the input is |
101 | // not an exact multiple of the block size. | 101 | // not an exact multiple of the block size. |
102 | if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len)) | 102 | if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len)) |
103 | { | 103 | { |
104 | llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl; | 104 | llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl; |
105 | goto ERROR; | 105 | goto ERROR; |
106 | } | 106 | } |
107 | output_len += temp_len; | 107 | output_len += temp_len; |
108 | 108 | ||
109 | EVP_CIPHER_CTX_cleanup(&context); | 109 | EVP_CIPHER_CTX_cleanup(&context); |
110 | return output_len; | 110 | return output_len; |
111 | 111 | ||
112 | ERROR: | 112 | ERROR: |
113 | EVP_CIPHER_CTX_cleanup(&context); | 113 | EVP_CIPHER_CTX_cleanup(&context); |
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | // virtual | 117 | // virtual |