OLD | NEW |
1 /* | 1 /* |
2 * | 2 * |
3 * This Source Code Form is subject to the terms of the Mozilla Public | 3 * This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | 6 |
7 #ifdef FREEBL_NO_DEPEND | 7 #ifdef FREEBL_NO_DEPEND |
8 #include "stubs.h" | 8 #include "stubs.h" |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 MP_TO_SEC_ERROR(err); | 151 MP_TO_SEC_ERROR(err); |
152 } | 152 } |
153 | 153 |
154 static SECStatus | 154 static SECStatus |
155 dsa_NewKeyExtended(const PQGParams *params, const SECItem * seed, | 155 dsa_NewKeyExtended(const PQGParams *params, const SECItem * seed, |
156 DSAPrivateKey **privKey) | 156 DSAPrivateKey **privKey) |
157 { | 157 { |
158 mp_int p, g; | 158 mp_int p, g; |
159 mp_int x, y; | 159 mp_int x, y; |
160 mp_err err; | 160 mp_err err; |
161 PRArenaPool *arena; | 161 PLArenaPool *arena; |
162 DSAPrivateKey *key; | 162 DSAPrivateKey *key; |
163 /* Check args. */ | 163 /* Check args. */ |
164 if (!params || !privKey || !seed || !seed->data) { | 164 if (!params || !privKey || !seed || !seed->data) { |
165 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 165 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
166 return SECFailure; | 166 return SECFailure; |
167 } | 167 } |
168 /* Initialize an arena for the DSA key. */ | 168 /* Initialize an arena for the DSA key. */ |
169 arena = PORT_NewArena(NSS_FREEBL_DSA_DEFAULT_CHUNKSIZE); | 169 arena = PORT_NewArena(NSS_FREEBL_DSA_DEFAULT_CHUNKSIZE); |
170 if (!arena) { | 170 if (!arena) { |
171 PORT_SetError(SEC_ERROR_NO_MEMORY); | 171 PORT_SetError(SEC_ERROR_NO_MEMORY); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 mp_clear(&s_); | 622 mp_clear(&s_); |
623 mp_clear(&u1); | 623 mp_clear(&u1); |
624 mp_clear(&u2); | 624 mp_clear(&u2); |
625 mp_clear(&v); | 625 mp_clear(&v); |
626 mp_clear(&w); | 626 mp_clear(&w); |
627 if (err) { | 627 if (err) { |
628 translate_mpi_error(err); | 628 translate_mpi_error(err); |
629 } | 629 } |
630 return verified; | 630 return verified; |
631 } | 631 } |
OLD | NEW |