summaryrefslogtreecommitdiff
path: root/firmware/lib/mocked_rollback_index.c
blob: d20ca23ab4c323b0140993e916e781d432b944e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * Functions for querying, manipulating and locking rollback indices
 * stored in the TPM NVRAM.
 */

#include "sysincludes.h"
#include "utility.h"

#include "rollback_index.h"

#include "tss_constants.h"


uint32_t SetVirtualDevMode(int val) {
  return TPM_SUCCESS;
}


uint32_t TPMClearAndReenable(void) {
  return TPM_SUCCESS;
}


uint32_t SetupTPM(int developer_mode, int disable_dev_request,
                  int clear_tpm_owner_request, RollbackSpaceFirmware* rsf) {
  return TPM_SUCCESS;
}


uint32_t RollbackS3Resume(void) {
  return TPM_SUCCESS;
}


uint32_t RollbackFirmwareSetup(int is_hw_dev,
                               int disable_dev_request,
                               int clear_tpm_owner_request,
                               int *is_virt_dev, uint32_t *version) {
  *version = 0;
  return TPM_SUCCESS;
}


uint32_t RollbackFirmwareWrite(uint32_t version) {
  return TPM_SUCCESS;
}


uint32_t RollbackFirmwareLock(void) {
  return TPM_SUCCESS;
}


uint32_t RollbackKernelRead(uint32_t* version) {
  *version = 0;
  return TPM_SUCCESS;
}


uint32_t RollbackKernelWrite(uint32_t version) {
  return TPM_SUCCESS;
}


uint32_t RollbackKernelLock(int recovery_mode) {
  return TPM_SUCCESS;
}

static uint8_t rollback_backup[BACKUP_NV_SIZE];

uint32_t RollbackBackupRead(uint8_t *raw)
{
	Memcpy(raw, rollback_backup, BACKUP_NV_SIZE);
	return TPM_SUCCESS;
}

uint32_t RollbackBackupWrite(uint8_t *raw)
{
	Memcpy(rollback_backup, raw, BACKUP_NV_SIZE);
	return TPM_SUCCESS;
}

uint32_t RollbackFwmpRead(struct RollbackSpaceFwmp *fwmp)
{
	Memset(fwmp, 0, sizeof(*fwmp));
	return TPM_SUCCESS;
}