Add a return value to hasher_t.allocate_hash()

This commit is contained in:
Martin Willi
2012-07-16 14:55:06 +02:00
parent e185612dd8
commit 87dd205b61
40 changed files with 269 additions and 149 deletions
+6 -1
View File
@@ -78,7 +78,12 @@ static cert_payload_t *build_cert_payload(private_ike_cert_post_t *this,
hasher->destroy(hasher);
return NULL;
}
hasher->allocate_hash(hasher, encoded, &hash);
if (!hasher->allocate_hash(hasher, encoded, &hash))
{
hasher->destroy(hasher);
chunk_free(&encoded);
return cert_payload_create_from_cert(CERTIFICATE, cert);
}
chunk_free(&encoded);
hasher->destroy(hasher);
id = identification_create_from_encoding(ID_KEY_ID, hash);