functions such as rand() ).
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) */
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++)
{
}
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;
}
*/
char * SRP_check_known_gN_param(BIGNUM* g, BIGNUM* N)
{
- int i;
+ size_t i;
if ((g == NULL) || (N == NULL))
return 0;
SRP_gN *SRP_get_default_gN(const char * id)
{
- int i;
+ size_t i;
if (id == NULL)
return knowngN;
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;
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;
!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;