diff options
Diffstat (limited to 'include/vboot.h')
-rw-r--r-- | include/vboot.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/include/vboot.h b/include/vboot.h index ba13328544..14f7a8f13c 100644 --- a/include/vboot.h +++ b/include/vboot.h @@ -3,6 +3,50 @@ * found in the LICENSE file. */ +#include "common.h" +#include "vb21_struct.h" +#include "rsa.h" + +/** + * Validate key contents. + * + * @param key + * @return EC_SUCCESS or EC_ERROR_* + */ +int vb21_is_packed_key_valid(const struct vb21_packed_key *key); + +/** + * Validate signature contents. + * + * @param sig Signature to be validated. + * @param key Key to be used for validating <sig>. + * @return EC_SUCCESS or EC_ERROR_* + */ +int vb21_is_signature_valid(const struct vb21_signature *sig, + const struct vb21_packed_key *key); + +/** + * Check data region is filled with ones + * + * @param data Data to be validated. + * @param start Offset where validation starts. + * @param end Offset where validation ends. data[end] won't be checked. + * @return EC_SUCCESS or EC_ERROR_* + */ +int vboot_is_padding_valid(const uint8_t *data, uint32_t start, uint32_t end); + +/** + * Verify data by RSA signature + * + * @param data Data to be verified. + * @param len Number of bytes in <data>. + * @param key Key to be used for verification. + * @param sig Signature of <data> + * @return EC_SUCCESS or EC_ERROR_* + */ +int vboot_verify(const uint8_t *data, int len, + const struct rsa_public_key *key, const uint8_t *sig); + /** * Verify RW image and jump to it * @@ -12,4 +56,4 @@ * 3. Returns, requesting more power * 4. Returns, requesting recovery */ -void vboot_ec(void); +void vboot_main(void); |