blob: a4957f957550f166ade29f449fee83673aaa35f3 [file] [log] [blame]
Daisuke Nojiri5d302c72015-04-09 08:18:22 -07001/* Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
Daisuke Nojiri5d302c72015-04-09 08:18:22 -07002 *
Martin Roth08d808f2017-02-09 18:06:16 -08003 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following disclaimer
11 * in the documentation and/or other materials provided with the
12 * distribution.
13 * * Neither the name of Google Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/*
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070031 * Functions for querying, manipulating and locking rollback indices
32 * stored in the TPM NVRAM.
33 */
34
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010035#include <security/tpm/tspi.h>
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070036#include <vb2_api.h>
37
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010038#include "antirollback.h"
39
Joel Kitching220ac042019-07-31 14:19:00 +080040vb2_error_t vb2ex_tpm_clear_owner(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070041{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010042 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070043}
44
Joel Kitching220ac042019-07-31 14:19:00 +080045vb2_error_t antirollback_read_space_firmware(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070046{
Julius Werner413a7422019-12-16 10:13:34 -080047 vb2api_secdata_firmware_create(ctx);
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010048 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070049}
50
Joel Kitching220ac042019-07-31 14:19:00 +080051vb2_error_t antirollback_write_space_firmware(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070052{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010053 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070054}
55
Joel Kitching220ac042019-07-31 14:19:00 +080056vb2_error_t antirollback_lock_space_firmware(void)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070057{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010058 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070059}
Furquan Shaikhb038f412016-11-07 23:47:11 -080060
Joel Kitching220ac042019-07-31 14:19:00 +080061vb2_error_t antirollback_lock_space_rec_hash(void)
Furquan Shaikhb038f412016-11-07 23:47:11 -080062{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010063 return VB2_SUCCESS;
Furquan Shaikhb038f412016-11-07 23:47:11 -080064}
Furquan Shaikh775765e2017-01-26 15:33:01 -080065
Joel Kitching220ac042019-07-31 14:19:00 +080066vb2_error_t antirollback_read_space_rec_hash(uint8_t *data, uint32_t size)
Furquan Shaikh775765e2017-01-26 15:33:01 -080067{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010068 return VB2_SUCCESS;
Furquan Shaikh775765e2017-01-26 15:33:01 -080069}
70
Joel Kitching220ac042019-07-31 14:19:00 +080071vb2_error_t antirollback_write_space_rec_hash(const uint8_t *data,
72 uint32_t size)
Furquan Shaikh775765e2017-01-26 15:33:01 -080073{
Furquan Shaikh00f360e2017-04-25 22:32:34 -070074 return VB2_SUCCESS;
75}