summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_ossl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_ossl.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index b3d78e524c..a3ddd7d281 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -136,7 +136,6 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
136 BN_CTX *ctx=NULL; 136 BN_CTX *ctx=NULL;
137 int reason=ERR_R_BN_LIB; 137 int reason=ERR_R_BN_LIB;
138 DSA_SIG *ret=NULL; 138 DSA_SIG *ret=NULL;
139 int noredo = 0;
140 139
141 BN_init(&m); 140 BN_init(&m);
142 BN_init(&xr); 141 BN_init(&xr);
@@ -151,7 +150,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
151 if (s == NULL) goto err; 150 if (s == NULL) goto err;
152 ctx=BN_CTX_new(); 151 ctx=BN_CTX_new();
153 if (ctx == NULL) goto err; 152 if (ctx == NULL) goto err;
154redo: 153
155 if ((dsa->kinv == NULL) || (dsa->r == NULL)) 154 if ((dsa->kinv == NULL) || (dsa->r == NULL))
156 { 155 {
157 if (!DSA_sign_setup(dsa,ctx,&kinv,&r)) goto err; 156 if (!DSA_sign_setup(dsa,ctx,&kinv,&r)) goto err;
@@ -162,7 +161,6 @@ redo:
162 dsa->kinv=NULL; 161 dsa->kinv=NULL;
163 r=dsa->r; 162 r=dsa->r;
164 dsa->r=NULL; 163 dsa->r=NULL;
165 noredo = 1;
166 } 164 }
167 165
168 166
@@ -183,18 +181,6 @@ redo:
183 181
184 ret=DSA_SIG_new(); 182 ret=DSA_SIG_new();
185 if (ret == NULL) goto err; 183 if (ret == NULL) goto err;
186 /* Redo if r or s is zero as required by FIPS 186-3: this is
187 * very unlikely.
188 */
189 if (BN_is_zero(r) || BN_is_zero(s))
190 {
191 if (noredo)
192 {
193 reason = DSA_R_NEED_NEW_SETUP_VALUES;
194 goto err;
195 }
196 goto redo;
197 }
198 ret->r = r; 184 ret->r = r;
199 ret->s = s; 185 ret->s = s;
200 186