mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 04:35:33 +00:00
Changed the PR_GetError() call to PORT_GetError() because we use
PORT_SetError() to set error codes. Modified files: dsa.c, rsa.c
This commit is contained in:
parent
68540e7f02
commit
9aeb25aa0d
@ -31,15 +31,13 @@
|
||||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
*
|
||||
* $Id: dsa.c,v 1.1 2000/08/18 18:32:32 mcgreer%netscape.com Exp $
|
||||
* $Id: dsa.c,v 1.2 2000/09/11 04:17:01 wtc%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "prerr.h"
|
||||
#include "secerr.h"
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "prinit.h"
|
||||
#include "prerror.h"
|
||||
#include "blapi.h"
|
||||
#include "prlock.h"
|
||||
#include "secitem.h"
|
||||
@ -276,14 +274,14 @@ SECStatus
|
||||
DSA_SignDigest(DSAPrivateKey *key, SECItem *signature, SECItem *digest)
|
||||
{
|
||||
SECStatus rv;
|
||||
PRErrorCode prerr = PR_SUCCESS;
|
||||
int prerr = 0;
|
||||
unsigned char KSEED[DSA_SUBPRIME_LEN];
|
||||
rv = DSA_GenerateGlobalRandomBytes(KSEED, DSA_SUBPRIME_LEN,
|
||||
key->params.subPrime.data);
|
||||
if (rv) return rv;
|
||||
do {
|
||||
rv = dsa_SignDigest(key, signature, digest, KSEED);
|
||||
if (rv) prerr = PR_GetError();
|
||||
if (rv) prerr = PORT_GetError();
|
||||
} while (prerr == SEC_ERROR_NEED_RANDOM);
|
||||
/*memset(KSEED, 0, DSA_SUBPRIME_LEN);*/
|
||||
return rv;
|
||||
|
@ -30,11 +30,9 @@
|
||||
* may use your version of this file under either the MPL or the
|
||||
* GPL.
|
||||
*
|
||||
* $Id: rsa.c,v 1.9 2000/09/08 22:41:51 mcgreer%netscape.com Exp $
|
||||
* $Id: rsa.c,v 1.10 2000/09/11 04:17:02 wtc%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "prerr.h"
|
||||
#include "prerror.h"
|
||||
#include "secerr.h"
|
||||
|
||||
#include "blapi.h"
|
||||
@ -126,7 +124,7 @@ RSA_NewKey(int keySizeInBits, SECItem *publicExponent)
|
||||
mp_int p, q, e;
|
||||
mp_err err = MP_OKAY;
|
||||
SECStatus rv = SECSuccess;
|
||||
PRErrorCode prerr = PR_SUCCESS;
|
||||
int prerr = 0;
|
||||
RSAPrivateKey *key = NULL;
|
||||
PRArenaPool *arena = NULL;
|
||||
if (!publicExponent) {
|
||||
@ -179,7 +177,7 @@ RSA_NewKey(int keySizeInBits, SECItem *publicExponent)
|
||||
rv = rsa_keygen_from_primes(&p, &q, &e, key);
|
||||
if (rv == SECSuccess)
|
||||
break; /* generated two good primes */
|
||||
prerr = PR_GetError();
|
||||
prerr = PORT_GetError();
|
||||
} while (prerr == SEC_ERROR_NEED_RANDOM); /* loop until have primes */
|
||||
cleanup:
|
||||
mp_clear(&p);
|
||||
|
Loading…
Reference in New Issue
Block a user