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

Side by Side Diff: host/lib/host_signature.c

Issue 4251006: Fix the maximum output size in the call to the external signer. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Host functions for signature generation. 5 * Host functions for signature generation.
6 */ 6 */
7 7
8 /* TODO: change all 'return 0', 'return 1' into meaningful return codes */ 8 /* TODO: change all 'return 0', 'return 1' into meaningful return codes */
9 9
10 #define OPENSSL_NO_SHA 10 #define OPENSSL_NO_SHA
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 sig = SignatureAlloc(siglen_map[key_algorithm], size); 259 sig = SignatureAlloc(siglen_map[key_algorithm], size);
260 if (!sig) { 260 if (!sig) {
261 Free(signature_digest); 261 Free(signature_digest);
262 return NULL; 262 return NULL;
263 } 263 }
264 264
265 /* Sign the signature_digest into our output buffer */ 265 /* Sign the signature_digest into our output buffer */
266 rv = InvokeExternalSigner(signature_digest_len, /* Input length */ 266 rv = InvokeExternalSigner(signature_digest_len, /* Input length */
267 signature_digest, /* Input data */ 267 signature_digest, /* Input data */
268 GetSignatureData(sig), /* Output sig */ 268 GetSignatureData(sig), /* Output sig */
269 (sizeof(VbSignature) + /* Max Output sig size. */ 269 siglen_map[key_algorithm], /* Max Output sig size */
270 siglen_map[key_algorithm]) ,
271 key_file, /* Key file to use */ 270 key_file, /* Key file to use */
272 external_signer); /* External cmd to invoke */ 271 external_signer); /* External cmd to invoke */
273 Free(signature_digest); 272 Free(signature_digest);
274 273
275 if (-1 == rv) { 274 if (-1 == rv) {
276 VBDEBUG(("SignatureBuf(): RSA_private_encrypt() failed.\n")); 275 VBDEBUG(("SignatureBuf(): RSA_private_encrypt() failed.\n"));
277 Free(sig); 276 Free(sig);
278 return NULL; 277 return NULL;
279 } 278 }
280 279
281 /* Return the signature */ 280 /* Return the signature */
282 return sig; 281 return sig;
283 } 282 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698