Lines Matching refs:rv
30 int rv; in vb2_load_fw_keyblock() local
40 rv = vb2ex_read_resource(ctx, VB2_RES_GBB, sd->gbb_rootkey_offset, in vb2_load_fw_keyblock()
42 if (rv) in vb2_load_fw_keyblock()
43 return rv; in vb2_load_fw_keyblock()
46 rv = vb2_unpack_key(&root_key, key_data, key_size); in vb2_load_fw_keyblock()
47 if (rv) in vb2_load_fw_keyblock()
48 return rv; in vb2_load_fw_keyblock()
55 rv = vb2ex_read_resource(ctx, VB2_RES_FW_VBLOCK, 0, kb, sizeof(*kb)); in vb2_load_fw_keyblock()
56 if (rv) in vb2_load_fw_keyblock()
57 return rv; in vb2_load_fw_keyblock()
71 rv = vb2ex_read_resource(ctx, VB2_RES_FW_VBLOCK, 0, kb, block_size); in vb2_load_fw_keyblock()
72 if (rv) in vb2_load_fw_keyblock()
73 return rv; in vb2_load_fw_keyblock()
76 rv = vb2_verify_keyblock(kb, block_size, &root_key, &wb); in vb2_load_fw_keyblock()
77 if (rv) { in vb2_load_fw_keyblock()
78 vb2_fail(ctx, VB2_RECOVERY_FW_KEYBLOCK, rv); in vb2_load_fw_keyblock()
79 return rv; in vb2_load_fw_keyblock()
84 rv = VB2_ERROR_FW_KEYBLOCK_VERSION_RANGE; in vb2_load_fw_keyblock()
85 if (!rv && kb->data_key.key_version < (sd->fw_version_secdata >> 16)) in vb2_load_fw_keyblock()
86 rv = VB2_ERROR_FW_KEYBLOCK_VERSION_ROLLBACK; in vb2_load_fw_keyblock()
87 if (rv) { in vb2_load_fw_keyblock()
88 vb2_fail(ctx, VB2_RECOVERY_FW_KEY_ROLLBACK, rv); in vb2_load_fw_keyblock()
89 return rv; in vb2_load_fw_keyblock()
143 int rv; in vb2_load_fw_preamble() local
151 rv = vb2_unpack_key(&data_key, key_data, key_size); in vb2_load_fw_preamble()
152 if (rv) in vb2_load_fw_preamble()
153 return rv; in vb2_load_fw_preamble()
160 rv = vb2ex_read_resource(ctx, VB2_RES_FW_VBLOCK, in vb2_load_fw_preamble()
163 if (rv) in vb2_load_fw_preamble()
164 return rv; in vb2_load_fw_preamble()
173 rv = vb2ex_read_resource(ctx, VB2_RES_FW_VBLOCK, in vb2_load_fw_preamble()
176 if (rv) in vb2_load_fw_preamble()
177 return rv; in vb2_load_fw_preamble()
182 rv = vb2_verify_fw_preamble(pre, pre_size, &data_key, &wb); in vb2_load_fw_preamble()
183 if (rv) { in vb2_load_fw_preamble()
184 vb2_fail(ctx, VB2_RECOVERY_FW_PREAMBLE, rv); in vb2_load_fw_preamble()
185 return rv; in vb2_load_fw_preamble()
193 rv = VB2_ERROR_FW_PREAMBLE_VERSION_RANGE; in vb2_load_fw_preamble()
196 if (!rv && sd->fw_version < sd->fw_version_secdata) in vb2_load_fw_preamble()
197 rv = VB2_ERROR_FW_PREAMBLE_VERSION_ROLLBACK; in vb2_load_fw_preamble()
198 if (rv) { in vb2_load_fw_preamble()
199 vb2_fail(ctx, VB2_RECOVERY_FW_ROLLBACK, rv); in vb2_load_fw_preamble()
200 return rv; in vb2_load_fw_preamble()
213 rv = vb2_secdata_set(ctx, VB2_SECDATA_VERSIONS, sd->fw_version); in vb2_load_fw_preamble()
214 if (rv) in vb2_load_fw_preamble()
215 return rv; in vb2_load_fw_preamble()