Changeset 74314 in vbox for trunk/src/VBox
- Timestamp:
- Sep 17, 2018 3:54:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/cipher-openssl.cpp
r74313 r74314 228 228 * Do the encryption. 229 229 */ 230 int cbEncrypted = 0;231 rcOssl = EVP_EncryptUpdate(pCipherCtx, (unsigned char *)pvEncrypted, &cbEncrypted ,230 int cbEncrypted1 = 0; 231 rcOssl = EVP_EncryptUpdate(pCipherCtx, (unsigned char *)pvEncrypted, &cbEncrypted1, 232 232 (unsigned char const *)pvPlainText, (int)cbPlainText); 233 233 if (rcOssl > 0) 234 234 { 235 Assert(cbEncrypted <= (ssize_t)cbNeeded);236 int cbEncrypted Final= 0;237 rcOssl = EVP_DecryptFinal(pCipherCtx, (unsigned char *)pvEncrypted + cbEncrypted , &cbEncryptedFinal);235 Assert(cbEncrypted1 <= (ssize_t)cbNeeded); 236 int cbEncrypted2 = 0; 237 rcOssl = EVP_DecryptFinal(pCipherCtx, (unsigned char *)pvEncrypted + cbEncrypted1, &cbEncrypted1); 238 238 if (rcOssl > 0) 239 239 { 240 Assert(cbEncrypted Final + cbEncrypted== (ssize_t)cbNeeded);240 Assert(cbEncrypted1 + cbEncrypted2 == (ssize_t)cbNeeded); 241 241 if (pcbEncrypted) 242 *pcbEncrypted = cbEncrypted Final + cbEncrypted;242 *pcbEncrypted = cbEncrypted1 + cbEncrypted2; 243 243 rc = VINF_SUCCESS; 244 244 } … … 312 312 * Do the decryption. 313 313 */ 314 int cbDecrypted = 0;315 rcOssl = EVP_DecryptUpdate(pCipherCtx, (unsigned char *)pvPlainText, &cbDecrypted ,314 int cbDecrypted1 = 0; 315 rcOssl = EVP_DecryptUpdate(pCipherCtx, (unsigned char *)pvPlainText, &cbDecrypted1, 316 316 (unsigned char const *)pvEncrypted, (int)cbEncrypted); 317 317 if (rcOssl > 0) 318 318 { 319 Assert(cbDecrypted <= (ssize_t)cbNeeded);320 int cbDecrypted Final= 0;321 rcOssl = EVP_DecryptFinal(pCipherCtx, (unsigned char *)pvPlainText + cbDecrypted , &cbDecryptedFinal);319 Assert(cbDecrypted1 <= (ssize_t)cbNeeded); 320 int cbDecrypted2 = 0; 321 rcOssl = EVP_DecryptFinal(pCipherCtx, (unsigned char *)pvPlainText + cbDecrypted1, &cbDecrypted2); 322 322 if (rcOssl > 0) 323 323 { 324 Assert(cbDecrypted Final + cbDecrypted== (ssize_t)cbNeeded);324 Assert(cbDecrypted1 + cbDecrypted2 == (ssize_t)cbNeeded); 325 325 if (pcbPlainText) 326 *pcbPlainText = cbDecrypted Final + cbDecrypted;326 *pcbPlainText = cbDecrypted1 + cbDecrypted2; 327 327 rc = VINF_SUCCESS; 328 328 }
Note:
See TracChangeset
for help on using the changeset viewer.