Lines Matching refs:vb
280 SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb)); in SRP_VBASE_new() local
282 if (vb == NULL) in SRP_VBASE_new()
284 if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL in SRP_VBASE_new()
285 || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) { in SRP_VBASE_new()
286 sk_SRP_user_pwd_free(vb->users_pwd); in SRP_VBASE_new()
287 OPENSSL_free(vb); in SRP_VBASE_new()
290 vb->default_g = NULL; in SRP_VBASE_new()
291 vb->default_N = NULL; in SRP_VBASE_new()
292 vb->seed_key = NULL; in SRP_VBASE_new()
293 if ((seed_key != NULL) && (vb->seed_key = OPENSSL_strdup(seed_key)) == NULL) { in SRP_VBASE_new()
294 sk_SRP_user_pwd_free(vb->users_pwd); in SRP_VBASE_new()
295 sk_SRP_gN_cache_free(vb->gN_cache); in SRP_VBASE_new()
296 OPENSSL_free(vb); in SRP_VBASE_new()
299 return vb; in SRP_VBASE_new()
302 void SRP_VBASE_free(SRP_VBASE *vb) in SRP_VBASE_free() argument
304 if (!vb) in SRP_VBASE_free()
306 sk_SRP_user_pwd_pop_free(vb->users_pwd, SRP_user_pwd_free); in SRP_VBASE_free()
307 sk_SRP_gN_cache_free(vb->gN_cache); in SRP_VBASE_free()
308 OPENSSL_free(vb->seed_key); in SRP_VBASE_free()
309 OPENSSL_free(vb); in SRP_VBASE_free()
395 int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file) in SRP_VBASE_init() argument
429 if (vb->seed_key) { in SRP_VBASE_init()
443 || (gN->N = SRP_gN_place_bn(vb->gN_cache, pp[DB_srpverifier])) in SRP_VBASE_init()
445 || (gN->g = SRP_gN_place_bn(vb->gN_cache, pp[DB_srpsalt])) in SRP_VBASE_init()
452 if (vb->seed_key != NULL) { in SRP_VBASE_init()
474 if (sk_SRP_user_pwd_insert(vb->users_pwd, user_pwd, 0) == 0) in SRP_VBASE_init()
488 vb->default_g = gN->g; in SRP_VBASE_init()
489 vb->default_N = gN->N; in SRP_VBASE_init()
516 static SRP_user_pwd *find_user(SRP_VBASE *vb, char *username) in find_user() argument
521 if (vb == NULL) in find_user()
524 for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) { in find_user()
525 user = sk_SRP_user_pwd_value(vb->users_pwd, i); in find_user()
533 int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd) in SRP_VBASE_add0_user() argument
535 if (sk_SRP_user_pwd_push(vb->users_pwd, user_pwd) <= 0) in SRP_VBASE_add0_user()
547 SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username) in SRP_VBASE_get_by_user() argument
549 return find_user(vb, username); in SRP_VBASE_get_by_user()
557 SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username) in SRP_VBASE_get1_by_user() argument
565 if (vb == NULL) in SRP_VBASE_get1_by_user()
568 if ((user = find_user(vb, username)) != NULL) in SRP_VBASE_get1_by_user()
571 if ((vb->seed_key == NULL) || in SRP_VBASE_get1_by_user()
572 (vb->default_g == NULL) || (vb->default_N == NULL)) in SRP_VBASE_get1_by_user()
580 SRP_user_pwd_set_gN(user, vb->default_g, vb->default_N); in SRP_VBASE_get1_by_user()
593 || !EVP_DigestUpdate(ctxt, vb->seed_key, strlen(vb->seed_key)) in SRP_VBASE_get1_by_user()