blob: de58bf5909dc92982b9e695561f8b5603a682b15 [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
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070035#include <stdlib.h>
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010036#include <security/tpm/tspi.h>
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070037#include <vb2_api.h>
38
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010039#include "antirollback.h"
40
Joel Kitching220ac042019-07-31 14:19:00 +080041vb2_error_t vb2ex_tpm_clear_owner(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070042{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010043 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070044}
45
Joel Kitching220ac042019-07-31 14:19:00 +080046vb2_error_t antirollback_read_space_firmware(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070047{
48 vb2api_secdata_create(ctx);
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010049 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070050}
51
Joel Kitching220ac042019-07-31 14:19:00 +080052vb2_error_t antirollback_write_space_firmware(struct vb2_context *ctx)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070053{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010054 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070055}
56
Joel Kitching220ac042019-07-31 14:19:00 +080057vb2_error_t antirollback_lock_space_firmware(void)
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070058{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010059 return VB2_SUCCESS;
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070060}
Furquan Shaikhb038f412016-11-07 23:47:11 -080061
Joel Kitching220ac042019-07-31 14:19:00 +080062vb2_error_t antirollback_lock_space_rec_hash(void)
Furquan Shaikhb038f412016-11-07 23:47:11 -080063{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010064 return VB2_SUCCESS;
Furquan Shaikhb038f412016-11-07 23:47:11 -080065}
Furquan Shaikh775765e2017-01-26 15:33:01 -080066
Joel Kitching220ac042019-07-31 14:19:00 +080067vb2_error_t antirollback_read_space_rec_hash(uint8_t *data, uint32_t size)
Furquan Shaikh775765e2017-01-26 15:33:01 -080068{
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010069 return VB2_SUCCESS;
Furquan Shaikh775765e2017-01-26 15:33:01 -080070}
71
Joel Kitching220ac042019-07-31 14:19:00 +080072vb2_error_t antirollback_write_space_rec_hash(const uint8_t *data,
73 uint32_t size)
Furquan Shaikh775765e2017-01-26 15:33:01 -080074{
Furquan Shaikh00f360e2017-04-25 22:32:34 -070075 return VB2_SUCCESS;
76}