VirtualBox

Ignore:
Timestamp:
Sep 18, 2018 9:50:57 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/cipher: Fixed incorrect assertions. bugref:9246

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/cipher-openssl.cpp

    r74327 r74352  
    189189    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    190190    AssertReturn(pThis->u32Magic == RTCRCIPHERINT_MAGIC, VERR_INVALID_HANDLE);
    191     AssertMsgReturn((ssize_t)cbKey != EVP_CIPHER_key_length(pThis->pCipher),
     191    AssertMsgReturn((ssize_t)cbKey == EVP_CIPHER_key_length(pThis->pCipher),
    192192                    ("%zu, expected %d\n", cbKey, EVP_CIPHER_key_length(pThis->pCipher)),
    193193                    VERR_CR_CIPHER_INVALID_KEY_LENGTH);
    194     AssertMsgReturn((ssize_t)cbInitVector != EVP_CIPHER_iv_length(pThis->pCipher),
     194    AssertMsgReturn((ssize_t)cbInitVector == EVP_CIPHER_iv_length(pThis->pCipher),
    195195                    ("%zu, expected %d\n", cbInitVector, EVP_CIPHER_iv_length(pThis->pCipher)),
    196196                    VERR_CR_CIPHER_INVALID_INITIALIZATION_VECTOR_LENGTH);
     
    273273    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    274274    AssertReturn(pThis->u32Magic == RTCRCIPHERINT_MAGIC, VERR_INVALID_HANDLE);
    275     AssertMsgReturn((ssize_t)cbKey != EVP_CIPHER_key_length(pThis->pCipher),
     275    AssertMsgReturn((ssize_t)cbKey == EVP_CIPHER_key_length(pThis->pCipher),
    276276                    ("%zu, expected %d\n", cbKey, EVP_CIPHER_key_length(pThis->pCipher)),
    277277                    VERR_CR_CIPHER_INVALID_KEY_LENGTH);
    278     AssertMsgReturn((ssize_t)cbInitVector != EVP_CIPHER_iv_length(pThis->pCipher),
     278    AssertMsgReturn((ssize_t)cbInitVector == EVP_CIPHER_iv_length(pThis->pCipher),
    279279                    ("%zu, expected %d\n", cbInitVector, EVP_CIPHER_iv_length(pThis->pCipher)),
    280280                    VERR_CR_CIPHER_INVALID_INITIALIZATION_VECTOR_LENGTH);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette