cose-wg / COSE-C

Implementation of COSE in C++; Provides a C interface; Crypto by openssl or mbedtls
BSD 3-Clause "New" or "Revised" License
30 stars 22 forks source link

Report correct unencrypted length #126

Open nevelis opened 3 years ago

nevelis commented 3 years ago

COSE_Encrypt_GetContent() returns a valid pointer to the content, but the length parameter is set to 0.

The reason for this is because cbOut is set to the correct value, but is then used as the remaining bytes in the EVP functions and gets set to 0.

This PR sets the output parameter to the correct value, so we can use the payload safely.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.4%) to 89.348% when pulling 08b55fa7b730434da2ecd072bc7dcb8e370791d8 on selfienetworks:fix-decrypt-length into 97d1805e71b7a6770093c5e6790d46611680d563 on cose-wg:master.