Rather than passing the whole key in for verifying a hash signature,
explicitly pass in the key packet. This opens the way to being able to
verify signatures from subkeys.
remove = true;
if (sigid == keyid) {
- ret = onak_check_hash_sig(key, (*sigs)->packet,
+ ret = onak_check_hash_sig(key->publickey,
+ (*sigs)->packet,
hash, hashtype);
/* We have a valid self signature */
for (curkey = sigkeys; curkey != NULL;
curkey = curkey->next) {
- ret = onak_check_hash_sig(curkey,
+ ret = onak_check_hash_sig(curkey->publickey,
(*sigs)->packet,
hash, hashtype);
return ret;
}
-onak_status_t onak_check_hash_sig(struct openpgp_publickey *sigkey,
+onak_status_t onak_check_hash_sig(struct openpgp_packet *sigkey,
struct openpgp_packet *sig,
uint8_t *hash,
uint8_t hashtype)
int len, ofs;
mpz_t s;
- ret = onak_parse_key_material(sigkey->publickey, &pubkey);
+ ret = onak_parse_key_material(sigkey, &pubkey);
if (ret != ONAK_E_OK) {
return ret;
}
* @hash: Hash digest the signature is over
* @hashtype: Type of hash (OPENPGP_HASH_*)
*/
-onak_status_t onak_check_hash_sig(struct openpgp_publickey *sigkey,
+onak_status_t onak_check_hash_sig(struct openpgp_packet *sigkey,
struct openpgp_packet *sig,
uint8_t *hash,
uint8_t hashtype);