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

Unified Diff: host/include/signature_digest.h

Issue 3136017: Add additional sanity checks to RSA verification code. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Created 10 years, 4 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 | « host/include/file_keys.h ('k') | host/lib/file_keys.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/include/signature_digest.h
diff --git a/host/include/signature_digest.h b/host/include/signature_digest.h
index 55662b940b24ecd2ee8fc7d45be1c0c4c99ae28e..40c27036463687f830b9a1aa2a7a235f307cd947 100644
--- a/host/include/signature_digest.h
+++ b/host/include/signature_digest.h
@@ -6,12 +6,12 @@
#ifndef VBOOT_REFERENCE_SIGNATURE_DIGEST_H_
#define VBOOT_REFERENCE_SIGNATURE_DIGEST_H_
-#include <inttypes.h>
+#include <stdint.h>
/* Returns a buffer with DigestInfo (which depends on [algorithm])
* prepended to [digest].
*/
-uint8_t* PrependDigestInfo(int algorithm, uint8_t* digest);
+uint8_t* PrependDigestInfo(unsigned 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.
@@ -22,7 +22,8 @@ uint8_t* PrependDigestInfo(int algorithm, uint8_t* digest);
* choice of the hash algorithm (see padding.c). Caller owns the returned
* pointer and must Free() it.
*/
-uint8_t* SignatureDigest(const uint8_t* buf, uint64_t len, int algorithm);
+uint8_t* SignatureDigest(const uint8_t* buf, uint64_t len,
+ unsigned int algorithm);
/* Calculates the signature on a buffer [buf] of length [len] using
* the private RSA key file from [key_file] and signature algorithm
@@ -31,5 +32,5 @@ uint8_t* SignatureDigest(const uint8_t* buf, uint64_t len, int algorithm);
* Returns the signature. Caller owns the buffer and must Free() it.
*/
uint8_t* SignatureBuf(const uint8_t* buf, uint64_t len, const char* key_file,
- int algorithm);
+ unsigned int algorithm);
#endif /* VBOOT_REFERENCE_SIGNATURE_DIGEST_H_ */
« no previous file with comments | « host/include/file_keys.h ('k') | host/lib/file_keys.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698