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 | 5 |
6 #include "rsa_padding_test.h" | 6 #include "rsa_padding_test.h" |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include "file_keys.h" | 10 #include "file_keys.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 for (i = 1; i < sizeof(signatures) / sizeof(signatures[0]); i++) { | 34 for (i = 1; i < sizeof(signatures) / sizeof(signatures[0]); i++) { |
35 if (RSAVerify(key, signatures[i], RSA1024NUMBYTES, 0, | 35 if (RSAVerify(key, signatures[i], RSA1024NUMBYTES, 0, |
36 test_message_sha1_hash)) { | 36 test_message_sha1_hash)) { |
37 fprintf(stderr, "RSA Padding Test vector %d FAILED!\n", i); | 37 fprintf(stderr, "RSA Padding Test vector %d FAILED!\n", i); |
38 error = 255; /* Test failure. */ | 38 error = 255; /* Test failure. */ |
39 } | 39 } |
40 } | 40 } |
41 if (!error) | 41 if (!error) |
42 fprintf(stderr, "RSA Padding Test PASSED for all test vectors."); | 42 fprintf(stderr, "RSA Padding Test PASSED for all test vectors."); |
43 | 43 |
| 44 RSAPublicKeyFree(key); |
44 return error; | 45 return error; |
45 } | 46 } |
OLD | NEW |