OLD | NEW |
1 /* | 1 /* |
2 * PKCS#1 encoding and decoding functions. | 2 * PKCS#1 encoding and decoding functions. |
3 * This file is believed to contain no code licensed from other parties. | 3 * This file is believed to contain no code licensed from other parties. |
4 * | 4 * |
5 * This Source Code Form is subject to the terms of the Mozilla Public | 5 * This Source Code Form is subject to the terms of the Mozilla Public |
6 * License, v. 2.0. If a copy of the MPL was not distributed with this | 6 * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
8 /* $Id: rsawrapr.c,v 1.20 2012/04/25 14:50:10 gerv%gerv.net Exp $ */ | 8 /* $Id: rsawrapr.c,v 1.21 2012/06/26 22:27:31 rrelyea%redhat.com Exp $ */ |
9 | 9 |
10 #include "blapi.h" | 10 #include "blapi.h" |
11 #include "softoken.h" | 11 #include "softoken.h" |
12 #include "sechash.h" | |
13 | 12 |
14 #include "lowkeyi.h" | 13 #include "lowkeyi.h" |
15 #include "secerr.h" | 14 #include "secerr.h" |
16 | 15 |
17 #define RSA_BLOCK_MIN_PAD_LEN 8 | 16 #define RSA_BLOCK_MIN_PAD_LEN 8 |
18 #define RSA_BLOCK_FIRST_OCTET 0x00 | 17 #define RSA_BLOCK_FIRST_OCTET 0x00 |
19 #define RSA_BLOCK_PRIVATE0_PAD_OCTET 0x00 | 18 #define RSA_BLOCK_PRIVATE0_PAD_OCTET 0x00 |
20 #define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff | 19 #define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff |
21 #define RSA_BLOCK_AFTER_PAD_OCTET 0x00 | 20 #define RSA_BLOCK_AFTER_PAD_OCTET 0x00 |
22 | 21 |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output, pss_encoded); | 1244 rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output, pss_encoded); |
1246 if (rv != SECSuccess && PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) { | 1245 if (rv != SECSuccess && PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) { |
1247 sftk_fatalError = PR_TRUE; | 1246 sftk_fatalError = PR_TRUE; |
1248 } | 1247 } |
1249 *output_len = modulus_len; | 1248 *output_len = modulus_len; |
1250 | 1249 |
1251 done: | 1250 done: |
1252 PORT_Free(pss_encoded); | 1251 PORT_Free(pss_encoded); |
1253 return rv; | 1252 return rv; |
1254 } | 1253 } |
OLD | NEW |