EVP_DecryptFinal_ex: fix check for return value

seems like the current docs were updated.
was "positive return code".
now specifically mentions 0 and 1.
This commit is contained in:
Thomas Waldmann 2022-03-18 22:43:38 +01:00
parent c010800f55
commit bb949b25ea
1 changed files with 1 additions and 1 deletions

View File

@ -568,7 +568,7 @@ cdef class _AEAD_BASE:
raise CryptoError('EVP_DecryptUpdate failed') raise CryptoError('EVP_DecryptUpdate failed')
offset += olen offset += olen
rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen) rc = EVP_DecryptFinal_ex(self.ctx, odata+offset, &olen)
if rc <= 0: if not rc:
# a failure here means corrupted or tampered tag (mac) or data. # a failure here means corrupted or tampered tag (mac) or data.
raise IntegrityError('Authentication / EVP_DecryptFinal_ex failed') raise IntegrityError('Authentication / EVP_DecryptFinal_ex failed')
offset += olen offset += olen