Use different return values in payload decryption to distinguish between integrity and syntax errors

This commit is contained in:
Martin Willi
2010-08-25 15:29:53 +02:00
parent f1a74a3cab
commit e5c6ebb697
3 changed files with 16 additions and 12 deletions
@@ -85,9 +85,13 @@ struct encryption_payload_t {
* Decrypt, verify and parse contained payloads.
*
* @param assoc associated data
* @return TRUE if decrypted and verified successfully
* - SUCCESS if parsing successful
* - PARSE_ERROR if sub-payload parsing failed
* - VERIFY_ERROR if sub-payload verification failed
* - FAILED if integrity check failed
* - INVALID_STATE if aead not supplied, but needed
*/
bool (*decrypt) (encryption_payload_t *this, chunk_t assoc);
status_t (*decrypt) (encryption_payload_t *this, chunk_t assoc);
/**
* Destroys an encryption_payload_t object.