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

Side by Side Diff: src/platform/vboot_reference/crypto/rsa_utility.c

Issue 661353: Vboot Reference: Refactor Code. (Closed)
Patch Set: Review Fixes. Created 10 years, 9 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 unified diff | Download patch
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 * 4 *
5 * Utility functions for message digest functions. 5 * Utility functions for message digest functions.
6 */ 6 */
7 7
8 #include "padding.h" 8 #include "padding.h"
9 #include "rsa_utility.h" 9 #include "rsa_utility.h"
10 #include "sha_utility.h" 10 #include "sha_utility.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 sig_size = siglen_map[algorithm]; 72 sig_size = siglen_map[algorithm];
73 73
74 if (key_blob && !key) 74 if (key_blob && !key)
75 verification_key = RSAPublicKeyFromBuf(key_blob, key_size); 75 verification_key = RSAPublicKeyFromBuf(key_blob, key_size);
76 else if (!key_blob && key) 76 else if (!key_blob && key)
77 verification_key = (RSAPublicKey*) key; /* Supress const warning. */ 77 verification_key = (RSAPublicKey*) key; /* Supress const warning. */
78 else 78 else
79 return 0; /* Both can't be NULL or non-NULL. */ 79 return 0; /* Both can't be NULL or non-NULL. */
80 80
81 digest = DigestBuf(buf, len, algorithm); 81 digest = DigestBuf(buf, len, algorithm);
82 success = RSA_verify(verification_key, sig, sig_size, algorithm, digest); 82 success = RSAVerify(verification_key, sig, sig_size, algorithm, digest);
83 83
84 Free(digest); 84 Free(digest);
85 if (!key) 85 if (!key)
86 RSAPublicKeyFree(verification_key); /* Only free if we allocated it. */ 86 RSAPublicKeyFree(verification_key); /* Only free if we allocated it. */
87 return success; 87 return success;
88 } 88 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/crypto/rsa.c ('k') | src/platform/vboot_reference/include/firmware_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698