Add a return value to crypter_t.encrypt

This commit is contained in:
Martin Willi committed 2012-07-16 14:53:37 +02:00
1 parent c3858662d2
commit e35abbe588
21 files changed
+233 -143

No files matched your search

@@ -337,9 +337,15 @@ static status_t ChallengeResponse(chunk_t challenge_hash, chunk_t password_hash,
for (i = 0; i < 3; i++)
{
chunk_t expanded, encrypted;
expanded = ExpandDESKey(keys[i]);
crypter->set_key(crypter, expanded);
crypter->encrypt(crypter, challenge_hash, chunk_empty, &encrypted);
if (!crypter->encrypt(crypter, challenge_hash, chunk_empty, &encrypted))
{
chunk_clear(&expanded);
crypter->destroy(crypter);
return FAILED;
}
memcpy(&response->ptr[i * 8], encrypted.ptr, encrypted.len);
chunk_clear(&encrypted);
chunk_clear(&expanded);
+1 -2
View File
@@ -167,8 +167,7 @@ METHOD(aead_t, encrypt, bool,
private_aead_t *this, chunk_t plain, chunk_t assoc, chunk_t iv,
chunk_t *encrypted)
{
this->crypter->encrypt(this->crypter, plain, iv, encrypted);
return TRUE;
return this->crypter->encrypt(this->crypter, plain, iv, encrypted);
}
METHOD(aead_t, decrypt, bool,