OLD | NEW |
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 that outputs the message digest of the contents of a file in a | 5 * Utility that outputs the message digest of the contents of a file in a |
6 * format that can be used as input to OpenSSL for an RSA signature. | 6 * format that can be used as input to OpenSSL for an RSA signature. |
7 * Needed until the stable OpenSSL release supports SHA-256/512 digests for | 7 * Needed until the stable OpenSSL release supports SHA-256/512 digests for |
8 * RSA signatures. | 8 * RSA signatures. |
9 * Outputs DigestInfo || Digest where DigestInfo is the OID depending on the | 9 * Outputs DigestInfo || Digest where DigestInfo is the OID depending on the |
10 * choice of the hash algorithm (see padding.c). | 10 * choice of the hash algorithm (see padding.c). |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 write(1, info_digest, hash_size_map[algorithm] + | 59 write(1, info_digest, hash_size_map[algorithm] + |
60 digestinfo_size_map[algorithm]); | 60 digestinfo_size_map[algorithm]); |
61 | 61 |
62 failure: | 62 failure: |
63 free(digest); | 63 free(digest); |
64 free(info_digest); | 64 free(info_digest); |
65 free(signature); | 65 free(signature); |
66 | 66 |
67 return 0; | 67 return 0; |
68 } | 68 } |
OLD | NEW |