Add a return value to crypter_t.set_key()

This commit is contained in:
Martin Willi
2012-07-16 14:53:38 +02:00
parent 3b96189a2a
commit ce73fc19db
23 changed files with 87 additions and 57 deletions
+5 -6
View File
@@ -257,17 +257,16 @@ METHOD(mac_t, set_key, bool,
memset(this->k2, 0x02, this->b);
memset(this->k3, 0x03, this->b);
this->k1->set_key(this->k1, lengthened);
if (!this->k1->encrypt(this->k1, chunk_create(this->k2, this->b), iv, NULL) ||
if (!this->k1->set_key(this->k1, lengthened) ||
!this->k1->encrypt(this->k1, chunk_create(this->k2, this->b), iv, NULL) ||
!this->k1->encrypt(this->k1, chunk_create(this->k3, this->b), iv, NULL) ||
!this->k1->encrypt(this->k1, k1, iv, NULL))
!this->k1->encrypt(this->k1, k1, iv, NULL) ||
!this->k1->set_key(this->k1, k1))
{
memwipe(k1.ptr, k1.len);
return FALSE;
}
this->k1->set_key(this->k1, k1);
memwipe(k1.ptr, k1.len);
return TRUE;
}