diff options
| author | Simon L. B. Nielsen <simon@FreeBSD.org> | 2010-11-21 22:45:18 +0000 | 
|---|---|---|
| committer | Simon L. B. Nielsen <simon@FreeBSD.org> | 2010-11-21 22:45:18 +0000 | 
| commit | f2c43d19b91f8847c1dfd87721254b44f963d9a2 (patch) | |
| tree | 4710d37952455e247de95eedf55ea05ee4df9f69 /crypto/dsa | |
| parent | 0cedaa6c89235ed396068f2ebf546c9a909439e1 (diff) | |
Diffstat (limited to 'crypto/dsa')
| -rw-r--r-- | crypto/dsa/dsa_gen.c | 3 | ||||
| -rw-r--r-- | crypto/dsa/dsa_ossl.c | 3 | 
2 files changed, 3 insertions, 3 deletions
| diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 6f1728e3cf00..7a9d1881cc48 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -110,7 +110,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,  	BIGNUM *r0,*W,*X,*c,*test;  	BIGNUM *g=NULL,*q=NULL,*p=NULL;  	BN_MONT_CTX *mont=NULL; -	int k,n=0,i,b,m=0; +	int k,n=0,i,m=0;  	int counter=0;  	int r=0;  	BN_CTX *ctx=NULL; @@ -211,7 +211,6 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,  		/* "offset = 2" */  		n=(bits-1)/160; -		b=(bits-1)-n*160;  		for (;;)  			{ diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index 412cf1d88b69..172776080669 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -178,7 +178,8 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)  	if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */  	if (!BN_add(s, &xr, &m)) goto err;		/* s = m + xr */  	if (BN_cmp(s,dsa->q) > 0) -		BN_sub(s,s,dsa->q); +		if (!BN_sub(s,s,dsa->q)) +			goto err;  	if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err;  	ret=DSA_SIG_new(); | 
