Lines Matching refs:sig
176 int vb2_verify_signature(const struct vb2_signature *sig, uint32_t size) in vb2_verify_signature() argument
183 if (sig->c.magic != VB2_MAGIC_SIGNATURE) in vb2_verify_signature()
187 rv = vb2_verify_common_header(sig, size); in vb2_verify_signature()
196 if (sig->c.struct_version_major != VB2_SIGNATURE_VERSION_MAJOR) in vb2_verify_signature()
200 if (sig->c.fixed_size < sizeof(*sig)) in vb2_verify_signature()
204 rv = vb2_verify_common_member(sig, &min_offset, in vb2_verify_signature()
205 sig->sig_offset, sig->sig_size); in vb2_verify_signature()
210 expect_sig_size = vb2_sig_size(sig->sig_alg, sig->hash_alg); in vb2_verify_signature()
213 if (sig->sig_size != expect_sig_size) in vb2_verify_signature()
222 static uint8_t *vb2_signature_data(struct vb2_signature *sig) in vb2_signature_data() argument
224 return (uint8_t *)sig + sig->sig_offset; in vb2_signature_data()
228 struct vb2_signature *sig, in vb2_verify_digest() argument
239 if (key->sig_alg != sig->sig_alg || key->hash_alg != sig->hash_alg) in vb2_verify_digest()
242 if (sig->sig_size != key_sig_size) in vb2_verify_digest()
247 if (vb2_safe_memcmp(vb2_signature_data(sig), in vb2_verify_digest()
255 vb2_signature_data(sig), in vb2_verify_digest()
262 struct vb2_signature *sig, in vb2_verify_data() argument
272 if (sig->data_size != size) { in vb2_verify_data()
305 return vb2_verify_digest(key, sig, digest, &wblocal); in vb2_verify_data()
345 struct vb2_signature *sig; in vb2_verify_keyblock() local
353 sig = (struct vb2_signature *)((uint8_t *)block + sig_offset); in vb2_verify_keyblock()
356 rv = vb2_verify_signature(sig, in vb2_verify_keyblock()
362 if (memcmp(&sig->guid, key->guid, GUID_SIZE)) in vb2_verify_keyblock()
366 if (sig->data_size != block->sig_offset) in vb2_verify_keyblock()
369 return vb2_verify_data(block, block->sig_offset, sig, key, wb); in vb2_verify_keyblock()
381 struct vb2_signature *sig; in vb2_verify_fw_preamble() local
415 sig = (struct vb2_signature *) in vb2_verify_fw_preamble()
420 sig, preamble->c.total_size - hash_offset); in vb2_verify_fw_preamble()
425 if (sig->sig_alg != VB2_SIG_NONE) in vb2_verify_fw_preamble()
436 sig = (struct vb2_signature *)((uint8_t *)preamble + in vb2_verify_fw_preamble()
439 rv = vb2_verify_data(preamble, preamble->sig_offset, sig, key, wb); in vb2_verify_fw_preamble()