PK_MAX_RETRIES

This commit is contained in:
Karel Miko 2017-06-21 13:38:39 +02:00
parent 0c115a162d
commit b8f22157b3
2 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,9 @@ enum {
/* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */
#define PK_STD 0x1000
/* iterations limit for retry-loops */
#define PK_MAX_RETRIES 20
int rand_prime(void *N, long len, prng_state *prng, int wprng);
int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng);
int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng);

View File

@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen,
{
ecc_key pubkey;
void *r, *s, *e, *p;
int err, max_iterations = 20;
int err, max_iterations = PK_MAX_RETRIES;
unsigned long pbits, pbytes, i, shift_right;
unsigned char ch, buf[MAXBLOCKSIZE];