Daisuke Nojiri | 5d302c7 | 2015-04-09 08:18:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015 The Chromium OS Authors. All rights reserved. |
Daisuke Nojiri | 5d302c7 | 2015-04-09 08:18:22 -0700 | [diff] [blame] | 2 | * |
Martin Roth | 08d808f | 2017-02-09 18:06:16 -0800 | [diff] [blame] | 3 | * 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 Nojiri | 5d302c7 | 2015-04-09 08:18:22 -0700 | [diff] [blame] | 31 | * Functions for querying, manipulating and locking rollback indices |
| 32 | * stored in the TPM NVRAM. |
| 33 | */ |
| 34 | |
| 35 | #include <antirollback.h> |
| 36 | #include <stdlib.h> |
Furquan Shaikh | 00f360e | 2017-04-25 22:32:34 -0700 | [diff] [blame] | 37 | #include <tpm_lite/tlcl.h> |
Daisuke Nojiri | 5d302c7 | 2015-04-09 08:18:22 -0700 | [diff] [blame] | 38 | #include <vb2_api.h> |
| 39 | |
| 40 | uint32_t tpm_extend_pcr(struct vb2_context *ctx, int pcr, |
| 41 | enum vb2_pcr_digest which_digest) |
| 42 | { |
| 43 | return TPM_SUCCESS; |
| 44 | } |
| 45 | |
| 46 | uint32_t tpm_clear_and_reenable(void) |
| 47 | { |
| 48 | return TPM_SUCCESS; |
| 49 | } |
| 50 | |
Daisuke Nojiri | 5d302c7 | 2015-04-09 08:18:22 -0700 | [diff] [blame] | 51 | uint32_t antirollback_read_space_firmware(struct vb2_context *ctx) |
| 52 | { |
| 53 | vb2api_secdata_create(ctx); |
| 54 | return TPM_SUCCESS; |
| 55 | } |
| 56 | |
| 57 | uint32_t antirollback_write_space_firmware(struct vb2_context *ctx) |
| 58 | { |
| 59 | return TPM_SUCCESS; |
| 60 | } |
| 61 | |
| 62 | uint32_t antirollback_lock_space_firmware() |
| 63 | { |
| 64 | return TPM_SUCCESS; |
| 65 | } |
Furquan Shaikh | b038f41 | 2016-11-07 23:47:11 -0800 | [diff] [blame] | 66 | |
| 67 | uint32_t antirollback_lock_space_rec_hash(void) |
| 68 | { |
| 69 | return TPM_SUCCESS; |
| 70 | } |
Furquan Shaikh | 775765e | 2017-01-26 15:33:01 -0800 | [diff] [blame] | 71 | |
| 72 | uint32_t antirollback_read_space_rec_hash(uint8_t *data, uint32_t size) |
| 73 | { |
| 74 | return TPM_SUCCESS; |
| 75 | } |
| 76 | |
| 77 | uint32_t antirollback_write_space_rec_hash(const uint8_t *data, uint32_t size) |
| 78 | { |
| 79 | return TPM_SUCCESS; |
| 80 | } |
Furquan Shaikh | 00f360e | 2017-04-25 22:32:34 -0700 | [diff] [blame] | 81 | |
| 82 | uint32_t tlcl_lib_init(void) |
| 83 | { |
| 84 | return VB2_SUCCESS; |
| 85 | } |