Add a return value to hasher_t.allocate_hash()
This commit is contained in:
@@ -321,8 +321,12 @@ static bool parse_public_key(private_pgp_cert_t *this, chunk_t packet)
|
||||
DBG1(DBG_ASN, "no SHA-1 hasher available");
|
||||
return FALSE;
|
||||
}
|
||||
hasher->allocate_hash(hasher, pubkey_packet_header, NULL);
|
||||
hasher->allocate_hash(hasher, pubkey_packet, &this->fingerprint);
|
||||
if (!hasher->allocate_hash(hasher, pubkey_packet_header, NULL) ||
|
||||
!hasher->allocate_hash(hasher, pubkey_packet, &this->fingerprint))
|
||||
{
|
||||
hasher->destroy(hasher);
|
||||
return FALSE;
|
||||
}
|
||||
hasher->destroy(hasher);
|
||||
DBG2(DBG_ASN, "L2 - v4 fingerprint %#B", &this->fingerprint);
|
||||
}
|
||||
|
||||
@@ -44,8 +44,12 @@ static bool build_v3_fingerprint(chunk_t *encoding, va_list args)
|
||||
{
|
||||
e = chunk_skip(e, 1);
|
||||
}
|
||||
hasher->allocate_hash(hasher, n, NULL);
|
||||
hasher->allocate_hash(hasher, e, encoding);
|
||||
if (!hasher->allocate_hash(hasher, n, NULL) ||
|
||||
!hasher->allocate_hash(hasher, e, encoding))
|
||||
{
|
||||
hasher->destroy(hasher);
|
||||
return FALSE;
|
||||
}
|
||||
hasher->destroy(hasher);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user