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

Side by Side Diff: src/platform/vboot_reference/include/rsa_utility.h

Issue 858008: VBoot Reference: Fix many memory leaks. (Closed)
Patch Set: 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 * Some utility functions for use with RSA signature verification. 5 * Some utility functions for use with RSA signature verification.
6 */ 6 */
7 7
8 #ifndef VBOOT_REFERENCE_RSA_UTILITY_H_ 8 #ifndef VBOOT_REFERENCE_RSA_UTILITY_H_
9 #define VBOOT_REFERENCE_RSA_UTILITY_H_ 9 #define VBOOT_REFERENCE_RSA_UTILITY_H_
10 10
11 #include "rsa.h" 11 #include "rsa.h"
12 12
13 /* Returns the size of a pre-processed RSA public key in bytes with algorithm 13 /* Returns the size of a pre-processed RSA public key in bytes with algorithm
14 * [algorithm]. */ 14 * [algorithm]. */
15 int RSAProcessedKeySize(int algorithm); 15 int RSAProcessedKeySize(int algorithm);
16 16
17 /* Allocate a new RSAPublicKey structure and initialize its pointer fields to
18 * NULL */
19 RSAPublicKey* RSAPublicKeyNew(void);
20
17 /* Deep free the contents of [key]. */ 21 /* Deep free the contents of [key]. */
18 void RSAPublicKeyFree(RSAPublicKey* key); 22 void RSAPublicKeyFree(RSAPublicKey* key);
19 23
20 /* Create a RSAPublic key structure from binary blob [buf] of length 24 /* Create a RSAPublic key structure from binary blob [buf] of length
21 * [len]. 25 * [len].
22 * 26 *
23 * Caller owns the returned key and must free it. 27 * Caller owns the returned key and must free it.
24 */ 28 */
25 RSAPublicKey* RSAPublicKeyFromBuf(const uint8_t* buf, int len); 29 RSAPublicKey* RSAPublicKeyFromBuf(const uint8_t* buf, int len);
26 30
(...skipping 11 matching lines...) Expand all
38 * 42 *
39 */ 43 */
40 int RSAVerifyBinary_f(const uint8_t* key_blob, 44 int RSAVerifyBinary_f(const uint8_t* key_blob,
41 const RSAPublicKey* key, 45 const RSAPublicKey* key,
42 const uint8_t* buf, 46 const uint8_t* buf,
43 int len, 47 int len,
44 const uint8_t* sig, 48 const uint8_t* sig,
45 int algorithm); 49 int algorithm);
46 50
47 #endif /* VBOOT_REFERENCE_RSA_UTILITY_H_ */ 51 #endif /* VBOOT_REFERENCE_RSA_UTILITY_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698