mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 03:05:10 +00:00
Vboot Reference: Refactor Code.
This CL does the following: 1) It adds a SignatureBuf function which uses the OpenSSL library to generate RSA signature. This is more robust than the previous way of invoking the command line "openssl" utility and capturing its output. No more unnecessary temporary files for signature operations. 2) It adds functions that allow direct manipulation of binary verified Firmware and Kernel Image blobs in memory. 3) It changes the structure field members for FirmwareImage to make it consistent with KernelImage. Now it's clearer which key is used when. 4) Minor bug fixes and slightly improved API for dealing verified boot firmware and kernel images. 5) Renames the RSA_verify function to prevent conflicts with OpenSSL since it's linked into the firmware utility binary. Review URL: http://codereview.chromium.org/661353
This commit is contained in:
@@ -74,22 +74,31 @@ void KernelImageFree(KernelImage* image);
|
||||
*/
|
||||
KernelImage* ReadKernelImage(const char* input_file);
|
||||
|
||||
/* Write kernel key header from [image] to an open file pointed by the
|
||||
* file descriptor [fd].
|
||||
/* Get kernel header binary blob from an [image].
|
||||
*
|
||||
* Caller owns the returned pointer and must Free() it.
|
||||
*/
|
||||
void WriteKernelHeader(int fd, KernelImage* image);
|
||||
uint8_t* GetKernelHeaderBlob(const KernelImage* image);
|
||||
|
||||
/* Write kernel config from [image] to an open file pointed by the
|
||||
* file descriptor [fd].
|
||||
/* Get kernel config binary blob from an [image].
|
||||
*
|
||||
* Caller owns the returned pointer and must Free() it.
|
||||
*/
|
||||
void WriteKernelConfig(int fd, KernelImage* image);
|
||||
uint8_t* GetKernelConfigBlob(const KernelImage* image);
|
||||
|
||||
/* Get a verified kernel binary blob from an [image] and fill
|
||||
* its length into blob_len.
|
||||
*
|
||||
* Caller owns the returned pointer and must Free() it.
|
||||
*/
|
||||
uint8_t* GetKernelBlob(const KernelImage* image, int* blob_len);
|
||||
|
||||
/* Write kernel data from [image] to a file named [input_file].
|
||||
*
|
||||
* Return [image] on success, NULL on error.
|
||||
* Return 1 on success, 0 on error.
|
||||
*/
|
||||
KernelImage* WriteKernelImage(const char* input_file,
|
||||
KernelImage* image);
|
||||
int WriteKernelImage(const char* input_file,
|
||||
const KernelImage* image);
|
||||
|
||||
/* Pretty print the contents of [image]. Only headers and metadata information
|
||||
* is printed.
|
||||
@@ -194,7 +203,7 @@ int AddKernelKeySignature(KernelImage* image, const char* firmware_key_file);
|
||||
*
|
||||
* Return 1 on success, 0 on failure.
|
||||
*/
|
||||
int AddKernelSignature(KernelImage* image, const char* kernel_sigining_key_file,
|
||||
int algorithm);
|
||||
int AddKernelSignature(KernelImage* image,
|
||||
const char* kernel_sigining_key_file);
|
||||
|
||||
#endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */
|
||||
|
||||
Reference in New Issue
Block a user