static onak_status_t onak_parse_key_material(struct openpgp_packet *pk,
struct onak_key_material *key)
{
- int i, len, ofs;
+ int len, ofs;
enum onak_oid oid;
mpz_t x, y;
onak_status_t ret = ONAK_E_OK;
return ONAK_E_UNSUPPORTED_FEATURE;
}
+ /*
+ * Keep scan-build happy; we bump this in MPI_TO_MPZ and then don't use
+ * it again the last time we do so.
+ */
+ (void)ofs;
+
key->type = pk->data[5];
if (ret != ONAK_E_OK) {
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)
struct dsa_signature dsasig;
uint8_t sigkeytype;
uint8_t edsig[64];
- uint64_t keyid;
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;
}
}
/* Skip to the signature material */
- ofs += 19;
+ ofs = 19;
sigkeytype = sig->data[15];
} else if (sig->data[0] >= 4) {
/* Skip the hashed data */
uint8_t keyheader[5];
uint8_t packetheader[5];
uint8_t trailer[10];
- int i;
uint64_t keyid;
onak_status_t res;