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

Unified Diff: host/lib/signature_digest.c

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/lib/host_key.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/lib/signature_digest.c
diff --git a/host/lib/signature_digest.c b/host/lib/signature_digest.c
index eaa60690251b98b7ff99ea2944262f21ec259e18..6bf5c82e2cbb14f5ba4ed45ea75ced5692a31af1 100644
--- a/host/lib/signature_digest.c
+++ b/host/lib/signature_digest.c
@@ -16,7 +16,7 @@
#include "cryptolib.h"
#include "utility.h"
-uint8_t* PrependDigestInfo(int algorithm, uint8_t* digest) {
+uint8_t* PrependDigestInfo(unsigned int algorithm, uint8_t* digest) {
const int digest_size = hash_size_map[algorithm];
const int digestinfo_size = digestinfo_size_map[algorithm];
const uint8_t* digestinfo = hash_digestinfo_map[algorithm];
@@ -26,7 +26,8 @@ uint8_t* PrependDigestInfo(int algorithm, uint8_t* digest) {
return p;
}
-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) {
uint8_t* info_digest = NULL;
uint8_t* digest = NULL;
@@ -40,7 +41,7 @@ uint8_t* SignatureDigest(const uint8_t* buf, uint64_t len, int algorithm) {
}
uint8_t* SignatureBuf(const uint8_t* buf, uint64_t len, const char* key_file,
- int algorithm) {
+ unsigned int algorithm) {
FILE* key_fp = NULL;
RSA* key = NULL;
uint8_t* signature = NULL;
« no previous file with comments | « host/lib/host_key.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698