Fix warnings: signed/unisgned comparison, shadowing (in some cases global functions such as rand() ).
diff --git a/apps/s_client.c b/apps/s_client.c index 5e2a5ef..8a57dcf 100644 --- a/apps/s_client.c +++ b/apps/s_client.c
@@ -403,11 +403,11 @@ BIGNUM *r = BN_new(); int ret = g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && - BN_is_prime(N,SRP_NUMBER_ITERATIONS_FOR_PRIME,NULL,bn_ctx,NULL) && + BN_is_prime_ex(N,SRP_NUMBER_ITERATIONS_FOR_PRIME,bn_ctx,NULL) && p != NULL && BN_rshift1(p, N) && /* p = (N-1)/2 */ - BN_is_prime(p,SRP_NUMBER_ITERATIONS_FOR_PRIME,NULL,bn_ctx,NULL) && + BN_is_prime_ex(p,SRP_NUMBER_ITERATIONS_FOR_PRIME,bn_ctx,NULL) && r != NULL && /* verify g^((N-1)/2) == -1 (mod N) */
diff --git a/apps/srp.c b/apps/srp.c index 5e1b23c..e397011 100644 --- a/apps/srp.c +++ b/apps/srp.c
@@ -140,12 +140,12 @@ return -1 ; } -static void print_entry(CA_DB *db, BIO * bio, int index, int verbose, char * s) +static void print_entry(CA_DB *db, BIO * bio, int indx, int verbose, char * s) { - if (index >= 0 && verbose) + if (indx >= 0 && verbose) { int j; - char **pp=sk_OPENSSL_PSTRING_value(db->db->data,index); + char **pp=sk_OPENSSL_PSTRING_value(db->db->data,indx); BIO_printf(bio,"%s \"%s\"\n",s,pp[DB_srpid]); for (j = 0; j < DB_NUMBER; j++) { @@ -696,10 +696,10 @@ } else { - char ** pp = sk_OPENSSL_PSTRING_value(db->db->data,userindex); + char ** xpp = sk_OPENSSL_PSTRING_value(db->db->data,userindex); BIO_printf(bio_err,"user \"%s\" revoked. t\n",user); - pp[DB_srptype][0] = 'R' ; + xpp[DB_srptype][0] = 'R' ; doupdatedb = 1; }
diff --git a/crypto/srp/srp_lib.c b/crypto/srp/srp_lib.c index dbf464b..9f63182 100644 --- a/crypto/srp/srp_lib.c +++ b/crypto/srp/srp_lib.c
@@ -326,7 +326,7 @@ */ char * SRP_check_known_gN_param(BIGNUM* g, BIGNUM* N) { - int i; + size_t i; if ((g == NULL) || (N == NULL)) return 0; @@ -343,7 +343,7 @@ SRP_gN *SRP_get_default_gN(const char * id) { - int i; + size_t i; if (id == NULL) return knowngN;
diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index 8b96a20..ba3dca0 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c
@@ -414,14 +414,14 @@ else if (pp[DB_srptype][0] == DB_SRP_VALID) { /* it is a user .... */ - SRP_gN *gN; - if ((gN = SRP_get_gN_by_id(pp[DB_srpgN],SRP_gN_tab))!=NULL) + SRP_gN *lgN; + if ((lgN = SRP_get_gN_by_id(pp[DB_srpgN],SRP_gN_tab))!=NULL) { error_code = SRP_ERR_MEMORY; if ((user_pwd = SRP_user_pwd_new()) == NULL) goto err; - SRP_user_pwd_set_gN(user_pwd,gN->g,gN->N); + SRP_user_pwd_set_gN(user_pwd,lgN->g,lgN->N); if (!SRP_user_pwd_set_ids(user_pwd, pp[DB_srpid], pp[DB_srpinfo])) goto err;
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c index de5ee99..e6c109b 100644 --- a/ssl/tls_srp.c +++ b/ssl/tls_srp.c
@@ -414,7 +414,7 @@ int SRP_Calc_A_param(SSL *s) { - unsigned char rand[SSL_MAX_MASTER_KEY_LENGTH]; + unsigned char rnd[SSL_MAX_MASTER_KEY_LENGTH]; if (BN_num_bits(s->srp_ctx.N) < s->srp_ctx.strength) return 0; @@ -423,10 +423,10 @@ !SRP_check_known_gN_param(s->srp_ctx.g,s->srp_ctx.N)) return 0; - if (RAND_bytes(rand, sizeof(rand)) <= 0) + if (RAND_bytes(rnd, sizeof(rnd)) <= 0) return 0; - s->srp_ctx.a = BN_bin2bn(rand,sizeof(rand), s->srp_ctx.a); - OPENSSL_cleanse(rand,sizeof(rand)); + s->srp_ctx.a = BN_bin2bn(rnd,sizeof(rnd), s->srp_ctx.a); + OPENSSL_cleanse(rnd,sizeof(rnd)); if (!(s->srp_ctx.A = SRP_Calc_A(s->srp_ctx.a,s->srp_ctx.N,s->srp_ctx.g))) return 0;