Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/platform/vboot_reference/include/signature_digest.h

Issue 661353: Vboot Reference: Refactor Code. (Closed)
Patch Set: Review Fixes. Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/vboot_reference/include/rsa.h ('k') | src/platform/vboot_reference/include/utility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/include/signature_digest.h
diff --git a/src/platform/vboot_reference/include/signature_digest.h b/src/platform/vboot_reference/include/signature_digest.h
index fcd72753a39f1bcfd57098642cd770b9b5fff3c8..291c5994ab2a9e69e01dc2e4f4a08308bf743c13 100644
--- a/src/platform/vboot_reference/include/signature_digest.h
+++ b/src/platform/vboot_reference/include/signature_digest.h
@@ -13,4 +13,23 @@
*/
uint8_t* prepend_digestinfo(int algorithm, uint8_t* digest);
+/* Function that outputs the message digest of the contents of a buffer in a
+ * format that can be used as input to OpenSSL for an RSA signature.
+ * Needed until the stable OpenSSL release supports SHA-256/512 digests for
+ * RSA signatures.
+ *
+ * Returns DigestInfo || Digest where DigestInfo is the OID depending on the
+ * choice of the hash algorithm (see padding.c). Caller owns the returned
+ * pointer and must Free() it.
+ */
+uint8_t* SignatureDigest(const uint8_t* buf, int len, int algorithm);
+
+/* Calculates the signature on a buffer [buf] of length [len] using
+ * the private RSA key file from [key_file] and signature algorithm
+ * [algorithm].
+ *
+ * Returns the signature. Caller owns the buffer and must Free() it.
+ */
+uint8_t* SignatureBuf(const uint8_t* buf, int len, const char* key_file,
+ int algorithm);
#endif /* VBOOT_REFERENCE_SIGNATURE_DIGEST_H_ */
« no previous file with comments | « src/platform/vboot_reference/include/rsa.h ('k') | src/platform/vboot_reference/include/utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698