Lines Matching refs:rv

184     int rv;  in validate_transition()  local
185 rv = intf->read(ctx, signature_struct_offset, read_len, buffer); in validate_transition()
186 if (rv != LIBCR51SIGN_SUCCESS) in validate_transition()
234 int rv; in read_and_hash_update() local
239 rv = intf->read_and_hash_update((void*)ctx, offset, size); in read_and_hash_update()
251 rv = intf->read((void*)ctx, offset, read_size, read_buffer); in read_and_hash_update()
252 if (rv != LIBCR51SIGN_SUCCESS) in read_and_hash_update()
256 rv = intf->hash_update((void*)ctx, read_buffer, read_size); in read_and_hash_update()
257 if (rv != LIBCR51SIGN_SUCCESS) in read_and_hash_update()
265 return rv; in read_and_hash_update()
286 int rv; in validate_payload_regions() local
312 rv = intf->read(ctx, d_offset + sizeof(struct image_descriptor), in validate_payload_regions()
318 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
370 rv = get_hash_digest_size(ctx->descriptor.hash_type, &digest_size); in validate_payload_regions()
371 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
373 return rv; in validate_payload_regions()
376 rv = intf->read(ctx, hash_offset, in validate_payload_regions()
379 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
389 rv = intf->hash_init(ctx, ctx->descriptor.hash_type); in validate_payload_regions()
390 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
425 rv = read_and_hash_update(ctx, intf, hash_start, hash_size); in validate_payload_regions()
426 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
428 return rv; in validate_payload_regions()
433 rv = intf->hash_final((void*)ctx, (uint8_t*)dcrypto_digest); in validate_payload_regions()
435 if (rv != LIBCR51SIGN_SUCCESS) in validate_payload_regions()
552 int rv; in validate_signature() local
560 rv = get_hash_type_from_signature(scheme, &hash_type); in validate_signature()
561 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
564 return rv; in validate_signature()
566 rv = intf->hash_init(ctx, hash_type); in validate_signature()
567 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
572 rv = read_and_hash_update(ctx, intf, data_offset, data_size); in validate_signature()
573 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
576 return rv; in validate_signature()
583 rv = intf->hash_final((void*)ctx, dcrypto_digest); in validate_signature()
584 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
586 CPRINTS(ctx, "%s: hash_final failed (status = %d)\n", __FUNCTION__, rv); in validate_signature()
589 rv = get_key_size(scheme, &key_size); in validate_signature()
590 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
592 return rv; in validate_signature()
595 rv = intf->read(ctx, raw_signature_offset, key_size, signature); in validate_signature()
596 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
599 __FUNCTION__, rv); in validate_signature()
607 rv = get_hash_digest_size(hash_type, &digest_size); in validate_signature()
608 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
610 return rv; in validate_signature()
612 rv = intf->verify_signature(ctx, scheme, signature, key_size, in validate_signature()
614 if (rv != LIBCR51SIGN_SUCCESS) in validate_signature()
617 rv); in validate_signature()
644 int rv; in validate_descriptor() local
654 rv = intf->read(ctx, offset, sizeof(ctx->descriptor), in validate_descriptor()
656 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
700 rv = is_signature_scheme_supported(signature_scheme); in validate_descriptor()
701 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
703 return rv; in validate_descriptor()
705 rv = is_hash_type_supported(ctx->descriptor.hash_type); in validate_descriptor()
706 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
709 return rv; in validate_descriptor()
717 rv = get_signature_struct_size(signature_scheme, &signature_struct_size); in validate_descriptor()
718 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
720 return rv; in validate_descriptor()
726 rv = get_hash_struct_size(ctx->descriptor.hash_type, &hash_struct_size); in validate_descriptor()
727 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
729 return rv; in validate_descriptor()
766 rv = get_signature_field_offset(signature_scheme, &signature_offset); in validate_descriptor()
767 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
769 return rv; in validate_descriptor()
774 rv = validate_transition(ctx, intf, offset + signature_struct_offset); in validate_descriptor()
776 if (rv != LIBCR51SIGN_SUCCESS) in validate_descriptor()
778 return rv; in validate_descriptor()
801 int rv; in scan_for_magic_8() local
819 rv = intf->read((void*)ctx, offset, sizeof(read_data), in scan_for_magic_8()
821 if (rv != LIBCR51SIGN_SUCCESS) in scan_for_magic_8()
823 return rv; in scan_for_magic_8()
857 int rv, rv_first_desc = LIBCR51SIGN_SUCCESS; in libcr51sign_validate() local
872 rv = scan_for_magic_8(ctx, intf, DESCRIPTOR_MAGIC, ctx->start_offset, in libcr51sign_validate()
875 while (rv == LIBCR51SIGN_SUCCESS) in libcr51sign_validate()
881 rv = validate_descriptor( in libcr51sign_validate()
884 if (rv != LIBCR51SIGN_SUCCESS) in libcr51sign_validate()
887 __FUNCTION__, rv); in libcr51sign_validate()
891 rv = validate_payload_regions_helper(ctx, intf, descriptor_offset, in libcr51sign_validate()
893 if (rv != LIBCR51SIGN_SUCCESS) in libcr51sign_validate()
896 __FUNCTION__, rv); in libcr51sign_validate()
906 rv = validate_payload_image_mauv(ctx, intf, payload_blob_offset, in libcr51sign_validate()
908 if (rv == LIBCR51SIGN_SUCCESS) in libcr51sign_validate()
913 return rv; in libcr51sign_validate()
915 if (rv == LIBCR51SIGN_ERROR_STORING_NEW_IMAGE_MAUV_DATA) in libcr51sign_validate()
930 return rv; in libcr51sign_validate()
934 return rv; in libcr51sign_validate()
939 if (rv != LIBCR51SIGN_SUCCESS && rv_first_desc == LIBCR51SIGN_SUCCESS) in libcr51sign_validate()
940 rv_first_desc = rv; in libcr51sign_validate()
944 rv = scan_for_magic_8(ctx, intf, DESCRIPTOR_MAGIC, descriptor_offset, in libcr51sign_validate()
948 CPRINTS(ctx, "%s: failed to validate image ec%d\n", __FUNCTION__, rv); in libcr51sign_validate()
953 return rv; in libcr51sign_validate()