summaryrefslogtreecommitdiffstats
path: root/libstb/status_codes.h
Commit message (Collapse)AuthorAgeFilesLines
* tpm_extendl: don't measure when no tpm is registeredClaudio Carvalho2016-11-021-0/+1
| | | | | | | | | This fixes tpm_extendl() to measure only when the list of registered tpms is not empty. Fixes: 3837c6f0cf4cffb5de874413eed755c0c698b076 Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* tpm_extendl: disable all failed tpms rather than only the firstClaudio Carvalho2016-11-021-2/+1
| | | | | | | | | | | | | | Each tpm_chip structure is associated with one tpm device and one firmware event log. If tpm_extendl() returns when the first tpm_chip operation (pcr extend or event log record) fails, the remaining registered tpm_chips will be in an inconsistent state, i.e, missing one measurement. This walks through all registered tpm_chips and disable all tpm_chips that failed rather than only first one. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: assert(tpm) in disable_tpm] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb: add secure and trusted boot interfaceClaudio Carvalho2016-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | stb.c implements the libstb API, which is an API for secure and trusted boot: - stb_init(): read secure mode and trusted mode from device tree and load drivers accordingly - tb_measure(): measure a resource downloaded from PNOR if trusted mode is on. That is, an EV_ACTION event is recorded in the event log for the mapped PCR and the sha1 and sha256 measurements are extended in the mapped PCR. - sb_verify(): verify the integrity and authenticity of a resource downloaded from PNOR if secure mode is on. The boot process is aborted if the verification fails. - stb_final(): this is called to add marks to TPM and event log before handover to petitboot kernel. Basically, it records an EV_SEPARATOR event in the event log for PCR[0-7], extends the sha1 and sha256 digests of 0xFFFFFFFF in PCR[0-7], and deallocates the memory allocated for secure and trusted boot. For more information please refer to 'doc/stb.rst'. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb/tpm_chip: add tpm_extendl()Claudio Carvalho2016-10-101-0/+4
| | | | | | | | | | | | This adds the tpm_extendl() function to tpm_chip interface For each TPM device, tpm_extendl() extends the sha1 and sha256 digests provided to the indicated PCR and also records an event for the same PCR in the event log. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: remove special char, align comments to 80 cols] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add i2c Nuvoton TPM 2.0 DriverClaudio Carvalho2016-10-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the 1/5 step performed by the TPM I2C Nuvoton driver to transmit a command to the TPM device. In this step the driver checks if the TPM device is ready to receive a new command. This adds the 2/5 step performed by the TPM I2C Nuvoton driver to transmit a command to the TPM device. In this step the driver writes a given command to master I2C FIFO. This adds the 3/5 step performed by the TPM I2C Nuvoton driver to transmit a command to the TPM device. In this step the driver sets the TPMGO bit in the I2C master status register to indicate that the command stored in the FIFO can be sent to the TPM device. This adds the 4/5 step performed by the TPM I2C Nuvoton driver to transmit a command to the TPM device. In this step the driver reads from the I2C master FIFO the result that the TPM device returned for the last command sent. This adds the 5/5 step performed by the TPM I2C Nuvoton driver to transmit a command to the TPM device. In this step the driver sets the COMMAND_READY bit in the status register to indicate that the TPM device is ready to receive a new command. This adds the probe function to the TPM Nuvoton driver and also updates the tpm_init() in tpm_chip.c to call the probe function. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: squash commits into one] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb/drivers: add tpm_i2c interfaceClaudio Carvalho2016-10-101-0/+2
| | | | | | | | This adds the functions that TPM I2C drivers can use to send requests to I2C master. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb/drivers: add romcode driverClaudio Carvalho2016-10-101-0/+3
| | | | | | | | | | | | | This adds a driver for the ROM verification code. The driver is compatible with 'ibm,secureboot-v1'. The presense of a verification code in the platform is indicated by the presence of the ibm,secureboot node in the device tree. The ibm,secureboot node is documented in 'doc/device-tree/ibm,secureboot.rst' Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb: add tpm_chip interfaceClaudio Carvalho2016-10-101-0/+23
This adds the TPM chip interface for libstb: - tpm_init(): call drivers' probe to find TPM devices that are compatible with them. - tpm_register_chip(): register a TPM chip which includes pointers to the TPM device and TPM driver structures. - tpm_add_status_property(): add the status device tree property for each registered TPM device. The TPM chip interface is documented in 'libstb/tpm_chip.h' and the tpm device tree node is documented in 'doc/device-tree/tpm.rst' Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: shuffle unused error path around] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud