Lines Matching refs:vce
127 struct vce { struct
178 static void pr_dbf_vce(const struct vce *e) in pr_dbf_vce()
259 static int check_certificate_hash(const struct vce *vce) in check_certificate_hash() argument
265 vce_hash = (u8 *)vce + vce->vce_hdr.vc_hash_offset; in check_certificate_hash()
266 vc_hash_length = vce->vce_hdr.vc_hash_length; in check_certificate_hash()
267 sha256((u8 *)vce + vce->vce_hdr.vc_offset, vce->vce_hdr.vc_length, hash); in check_certificate_hash()
280 static int check_certificate_valid(const struct vce *vce) in check_certificate_valid() argument
282 if (!(vce->vce_hdr.flags & VCE_FLAGS_VALID_MASK)) { in check_certificate_valid()
286 if (vce->vce_hdr.vc_format != 1) { in check_certificate_valid()
290 if (vce->vce_hdr.vc_hash_type != 1) { in check_certificate_valid()
295 return check_certificate_hash(vce); in check_certificate_valid()
428 static char *get_key_description(struct vcssb *vcssb, const struct vce *vce) in get_key_description() argument
436 name_len = sizeof(vce->vce_hdr.vc_name); in get_key_description()
442 memcpy(desc, vce->vce_hdr.vc_name, name_len); in get_key_description()
444 vce->vce_hdr.vc_index, cs_token); in get_key_description()
453 static int create_key_from_vce(struct vcssb *vcssb, struct vce *vce, in create_key_from_vce() argument
460 desc = get_key_description(vcssb, vce); in create_key_from_vce()
466 desc, (u8 *)vce + vce->vce_hdr.vc_offset, in create_key_from_vce()
467 vce->vce_hdr.vc_length, in create_key_from_vce()
523 static void extract_vce_from_sevcb(struct vcb *vcb, struct vce *vce) in extract_vce_from_sevcb() argument
525 struct vce *extracted_vce; in extract_vce_from_sevcb()
527 extracted_vce = (struct vce *)vcb->vcb_buf; in extract_vce_from_sevcb()
528 memcpy(vce, vcb->vcb_buf, extracted_vce->vce_hdr.vce_length); in extract_vce_from_sevcb()
529 pr_dbf_vce(vce); in extract_vce_from_sevcb()
575 struct vce *vce; in create_key_from_sevcb() local
580 vce = vmalloc(vcssb->max_single_vcb_length - sizeof(vcb->vcb_hdr)); in create_key_from_sevcb()
581 if (!vcb || !vce) in create_key_from_sevcb()
588 extract_vce_from_sevcb(vcb, vce); in create_key_from_sevcb()
589 rc = check_certificate_valid(vce); in create_key_from_sevcb()
593 rc = create_key_from_vce(vcssb, vce, keyring); in create_key_from_sevcb()
599 vfree(vce); in create_key_from_sevcb()