Lines Matching refs:srp_ctx
36 OPENSSL_free(ctx->srp_ctx.login); in ssl_ctx_srp_ctx_free_intern()
37 OPENSSL_free(ctx->srp_ctx.info); in ssl_ctx_srp_ctx_free_intern()
38 BN_free(ctx->srp_ctx.N); in ssl_ctx_srp_ctx_free_intern()
39 BN_free(ctx->srp_ctx.g); in ssl_ctx_srp_ctx_free_intern()
40 BN_free(ctx->srp_ctx.s); in ssl_ctx_srp_ctx_free_intern()
41 BN_free(ctx->srp_ctx.B); in ssl_ctx_srp_ctx_free_intern()
42 BN_free(ctx->srp_ctx.A); in ssl_ctx_srp_ctx_free_intern()
43 BN_free(ctx->srp_ctx.a); in ssl_ctx_srp_ctx_free_intern()
44 BN_free(ctx->srp_ctx.b); in ssl_ctx_srp_ctx_free_intern()
45 BN_free(ctx->srp_ctx.v); in ssl_ctx_srp_ctx_free_intern()
46 memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx)); in ssl_ctx_srp_ctx_free_intern()
47 ctx->srp_ctx.strength = SRP_MINIMAL_N; in ssl_ctx_srp_ctx_free_intern()
64 OPENSSL_free(s->srp_ctx.login); in ssl_srp_ctx_free_intern()
65 OPENSSL_free(s->srp_ctx.info); in ssl_srp_ctx_free_intern()
66 BN_free(s->srp_ctx.N); in ssl_srp_ctx_free_intern()
67 BN_free(s->srp_ctx.g); in ssl_srp_ctx_free_intern()
68 BN_free(s->srp_ctx.s); in ssl_srp_ctx_free_intern()
69 BN_free(s->srp_ctx.B); in ssl_srp_ctx_free_intern()
70 BN_free(s->srp_ctx.A); in ssl_srp_ctx_free_intern()
71 BN_free(s->srp_ctx.a); in ssl_srp_ctx_free_intern()
72 BN_free(s->srp_ctx.b); in ssl_srp_ctx_free_intern()
73 BN_free(s->srp_ctx.v); in ssl_srp_ctx_free_intern()
74 memset(&s->srp_ctx, 0, sizeof(s->srp_ctx)); in ssl_srp_ctx_free_intern()
75 s->srp_ctx.strength = SRP_MINIMAL_N; in ssl_srp_ctx_free_intern()
98 memset(&s->srp_ctx, 0, sizeof(s->srp_ctx)); in ssl_srp_ctx_init_intern()
100 s->srp_ctx.SRP_cb_arg = ctx->srp_ctx.SRP_cb_arg; in ssl_srp_ctx_init_intern()
102 s->srp_ctx.TLS_ext_srp_username_callback = in ssl_srp_ctx_init_intern()
103 ctx->srp_ctx.TLS_ext_srp_username_callback; in ssl_srp_ctx_init_intern()
105 s->srp_ctx.SRP_verify_param_callback = in ssl_srp_ctx_init_intern()
106 ctx->srp_ctx.SRP_verify_param_callback; in ssl_srp_ctx_init_intern()
108 s->srp_ctx.SRP_give_srp_client_pwd_callback = in ssl_srp_ctx_init_intern()
109 ctx->srp_ctx.SRP_give_srp_client_pwd_callback; in ssl_srp_ctx_init_intern()
111 s->srp_ctx.strength = ctx->srp_ctx.strength; in ssl_srp_ctx_init_intern()
113 if (((ctx->srp_ctx.N != NULL) && in ssl_srp_ctx_init_intern()
114 ((s->srp_ctx.N = BN_dup(ctx->srp_ctx.N)) == NULL)) || in ssl_srp_ctx_init_intern()
115 ((ctx->srp_ctx.g != NULL) && in ssl_srp_ctx_init_intern()
116 ((s->srp_ctx.g = BN_dup(ctx->srp_ctx.g)) == NULL)) || in ssl_srp_ctx_init_intern()
117 ((ctx->srp_ctx.s != NULL) && in ssl_srp_ctx_init_intern()
118 ((s->srp_ctx.s = BN_dup(ctx->srp_ctx.s)) == NULL)) || in ssl_srp_ctx_init_intern()
119 ((ctx->srp_ctx.B != NULL) && in ssl_srp_ctx_init_intern()
120 ((s->srp_ctx.B = BN_dup(ctx->srp_ctx.B)) == NULL)) || in ssl_srp_ctx_init_intern()
121 ((ctx->srp_ctx.A != NULL) && in ssl_srp_ctx_init_intern()
122 ((s->srp_ctx.A = BN_dup(ctx->srp_ctx.A)) == NULL)) || in ssl_srp_ctx_init_intern()
123 ((ctx->srp_ctx.a != NULL) && in ssl_srp_ctx_init_intern()
124 ((s->srp_ctx.a = BN_dup(ctx->srp_ctx.a)) == NULL)) || in ssl_srp_ctx_init_intern()
125 ((ctx->srp_ctx.v != NULL) && in ssl_srp_ctx_init_intern()
126 ((s->srp_ctx.v = BN_dup(ctx->srp_ctx.v)) == NULL)) || in ssl_srp_ctx_init_intern()
127 ((ctx->srp_ctx.b != NULL) && in ssl_srp_ctx_init_intern()
128 ((s->srp_ctx.b = BN_dup(ctx->srp_ctx.b)) == NULL))) { in ssl_srp_ctx_init_intern()
132 if ((ctx->srp_ctx.login != NULL) && in ssl_srp_ctx_init_intern()
133 ((s->srp_ctx.login = OPENSSL_strdup(ctx->srp_ctx.login)) == NULL)) { in ssl_srp_ctx_init_intern()
137 if ((ctx->srp_ctx.info != NULL) && in ssl_srp_ctx_init_intern()
138 ((s->srp_ctx.info = OPENSSL_strdup(ctx->srp_ctx.info)) == NULL)) { in ssl_srp_ctx_init_intern()
142 s->srp_ctx.srp_Mask = ctx->srp_ctx.srp_Mask; in ssl_srp_ctx_init_intern()
146 OPENSSL_free(s->srp_ctx.login); in ssl_srp_ctx_init_intern()
147 OPENSSL_free(s->srp_ctx.info); in ssl_srp_ctx_init_intern()
148 BN_free(s->srp_ctx.N); in ssl_srp_ctx_init_intern()
149 BN_free(s->srp_ctx.g); in ssl_srp_ctx_init_intern()
150 BN_free(s->srp_ctx.s); in ssl_srp_ctx_init_intern()
151 BN_free(s->srp_ctx.B); in ssl_srp_ctx_init_intern()
152 BN_free(s->srp_ctx.A); in ssl_srp_ctx_init_intern()
153 BN_free(s->srp_ctx.a); in ssl_srp_ctx_init_intern()
154 BN_free(s->srp_ctx.b); in ssl_srp_ctx_init_intern()
155 BN_free(s->srp_ctx.v); in ssl_srp_ctx_init_intern()
156 memset(&s->srp_ctx, 0, sizeof(s->srp_ctx)); in ssl_srp_ctx_init_intern()
177 memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx)); in ssl_ctx_srp_ctx_init_intern()
178 ctx->srp_ctx.strength = SRP_MINIMAL_N; in ssl_ctx_srp_ctx_init_intern()
200 if ((s->srp_ctx.TLS_ext_srp_username_callback != NULL) && in ssl_srp_server_param_with_username_intern()
202 s->srp_ctx.TLS_ext_srp_username_callback(SSL_CONNECTION_GET_USER_SSL(s), in ssl_srp_server_param_with_username_intern()
204 s->srp_ctx.SRP_cb_arg)) != in ssl_srp_server_param_with_username_intern()
209 if ((s->srp_ctx.N == NULL) || in ssl_srp_server_param_with_username_intern()
210 (s->srp_ctx.g == NULL) || in ssl_srp_server_param_with_username_intern()
211 (s->srp_ctx.s == NULL) || (s->srp_ctx.v == NULL)) in ssl_srp_server_param_with_username_intern()
217 s->srp_ctx.b = BN_bin2bn(b, sizeof(b), NULL); in ssl_srp_server_param_with_username_intern()
222 return ((s->srp_ctx.B = in ssl_srp_server_param_with_username_intern()
223 SRP_Calc_B_ex(s->srp_ctx.b, s->srp_ctx.N, s->srp_ctx.g, in ssl_srp_server_param_with_username_intern()
224 s->srp_ctx.v, sctx->libctx, sctx->propq)) != in ssl_srp_server_param_with_username_intern()
254 sc->srp_ctx.N = BN_dup(GN->N); in SSL_set_srp_server_param_pw()
255 sc->srp_ctx.g = BN_dup(GN->g); in SSL_set_srp_server_param_pw()
256 BN_clear_free(sc->srp_ctx.v); in SSL_set_srp_server_param_pw()
257 sc->srp_ctx.v = NULL; in SSL_set_srp_server_param_pw()
258 BN_clear_free(sc->srp_ctx.s); in SSL_set_srp_server_param_pw()
259 sc->srp_ctx.s = NULL; in SSL_set_srp_server_param_pw()
260 if (!SRP_create_verifier_BN_ex(user, pass, &sc->srp_ctx.s, &sc->srp_ctx.v, in SSL_set_srp_server_param_pw()
261 sc->srp_ctx.N, sc->srp_ctx.g, s->ctx->libctx, in SSL_set_srp_server_param_pw()
277 if (sc->srp_ctx.N != NULL) { in SSL_set_srp_server_param()
278 if (!BN_copy(sc->srp_ctx.N, N)) { in SSL_set_srp_server_param()
279 BN_free(sc->srp_ctx.N); in SSL_set_srp_server_param()
280 sc->srp_ctx.N = NULL; in SSL_set_srp_server_param()
283 sc->srp_ctx.N = BN_dup(N); in SSL_set_srp_server_param()
286 if (sc->srp_ctx.g != NULL) { in SSL_set_srp_server_param()
287 if (!BN_copy(sc->srp_ctx.g, g)) { in SSL_set_srp_server_param()
288 BN_free(sc->srp_ctx.g); in SSL_set_srp_server_param()
289 sc->srp_ctx.g = NULL; in SSL_set_srp_server_param()
292 sc->srp_ctx.g = BN_dup(g); in SSL_set_srp_server_param()
295 if (sc->srp_ctx.s != NULL) { in SSL_set_srp_server_param()
296 if (!BN_copy(sc->srp_ctx.s, sa)) { in SSL_set_srp_server_param()
297 BN_free(sc->srp_ctx.s); in SSL_set_srp_server_param()
298 sc->srp_ctx.s = NULL; in SSL_set_srp_server_param()
301 sc->srp_ctx.s = BN_dup(sa); in SSL_set_srp_server_param()
304 if (sc->srp_ctx.v != NULL) { in SSL_set_srp_server_param()
305 if (!BN_copy(sc->srp_ctx.v, v)) { in SSL_set_srp_server_param()
306 BN_free(sc->srp_ctx.v); in SSL_set_srp_server_param()
307 sc->srp_ctx.v = NULL; in SSL_set_srp_server_param()
310 sc->srp_ctx.v = BN_dup(v); in SSL_set_srp_server_param()
313 if (sc->srp_ctx.info) in SSL_set_srp_server_param()
314 OPENSSL_free(sc->srp_ctx.info); in SSL_set_srp_server_param()
315 if ((sc->srp_ctx.info = OPENSSL_strdup(info)) == NULL) in SSL_set_srp_server_param()
319 if (!(sc->srp_ctx.N) || in SSL_set_srp_server_param()
320 !(sc->srp_ctx.g) || !(sc->srp_ctx.s) || !(sc->srp_ctx.v)) in SSL_set_srp_server_param()
333 if (!SRP_Verify_A_mod_N(s->srp_ctx.A, s->srp_ctx.N)) in srp_generate_server_master_secret()
335 if ((u = SRP_Calc_u_ex(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N, in srp_generate_server_master_secret()
338 if ((K = SRP_Calc_server_key(s->srp_ctx.A, s->srp_ctx.v, u, s->srp_ctx.b, in srp_generate_server_master_secret()
339 s->srp_ctx.N)) == NULL) in srp_generate_server_master_secret()
368 if (SRP_Verify_B_mod_N(s->srp_ctx.B, s->srp_ctx.N) == 0 in srp_generate_client_master_secret()
369 || (u = SRP_Calc_u_ex(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N, in srp_generate_client_master_secret()
372 || s->srp_ctx.SRP_give_srp_client_pwd_callback == NULL) { in srp_generate_client_master_secret()
376 if ((passwd = s->srp_ctx.SRP_give_srp_client_pwd_callback(SSL_CONNECTION_GET_USER_SSL(s), in srp_generate_client_master_secret()
377 s->srp_ctx.SRP_cb_arg)) in srp_generate_client_master_secret()
382 if ((x = SRP_Calc_x_ex(s->srp_ctx.s, s->srp_ctx.login, passwd, in srp_generate_client_master_secret()
384 || (K = SRP_Calc_client_key_ex(s->srp_ctx.N, s->srp_ctx.B, in srp_generate_client_master_secret()
385 s->srp_ctx.g, x, in srp_generate_client_master_secret()
386 s->srp_ctx.a, u, in srp_generate_client_master_secret()
412 SRP_CTX *srp = &s->srp_ctx; in srp_verify_server_param()
454 s->srp_ctx.a = BN_bin2bn(rnd, sizeof(rnd), s->srp_ctx.a); in ssl_srp_calc_a_param_intern()
457 if (!(s->srp_ctx.A = SRP_Calc_A(s->srp_ctx.a, s->srp_ctx.N, s->srp_ctx.g))) in ssl_srp_calc_a_param_intern()
480 if (sc->srp_ctx.g != NULL) in SSL_get_srp_g()
481 return sc->srp_ctx.g; in SSL_get_srp_g()
482 return s->ctx->srp_ctx.g; in SSL_get_srp_g()
492 if (sc->srp_ctx.N != NULL) in SSL_get_srp_N()
493 return sc->srp_ctx.N; in SSL_get_srp_N()
494 return s->ctx->srp_ctx.N; in SSL_get_srp_N()
504 if (sc->srp_ctx.login != NULL) in SSL_get_srp_username()
505 return sc->srp_ctx.login; in SSL_get_srp_username()
506 return s->ctx->srp_ctx.login; in SSL_get_srp_username()
516 if (sc->srp_ctx.info != NULL) in SSL_get_srp_userinfo()
517 return sc->srp_ctx.info; in SSL_get_srp_userinfo()
518 return s->ctx->srp_ctx.info; in SSL_get_srp_userinfo()