SSL_CTX_set_srp_username_callback(server_ctx, server_srp_cb);
server_ctx_data->srp_user = OPENSSL_strdup(extra->server.srp_user);
server_ctx_data->srp_password = OPENSSL_strdup(extra->server.srp_password);
+ if (server_ctx_data->srp_user == NULL || server_ctx_data->srp_password == NULL) {
+ OPENSSL_free(server_ctx_data->srp_user);
+ OPENSSL_free(server_ctx_data->srp_password);
+ server_ctx_data->srp_user = NULL;
+ server_ctx_data->srp_password = NULL;
+ return 0;
+ }
SSL_CTX_set_srp_cb_arg(server_ctx, server_ctx_data);
}
if (extra->server2.srp_user != NULL) {
SSL_CTX_set_srp_username_callback(server2_ctx, server_srp_cb);
server2_ctx_data->srp_user = OPENSSL_strdup(extra->server2.srp_user);
server2_ctx_data->srp_password = OPENSSL_strdup(extra->server2.srp_password);
+ if (server2_ctx_data->srp_user == NULL || server2_ctx_data->srp_password == NULL) {
+ OPENSSL_free(server2_ctx_data->srp_user);
+ OPENSSL_free(server2_ctx_data->srp_password);
+ server2_ctx_data->srp_user = NULL;
+ server2_ctx_data->srp_password = NULL;
+ return 0;
+ }
SSL_CTX_set_srp_cb_arg(server2_ctx, server2_ctx_data);
}
if (extra->client.srp_user != NULL) {
return 0;
SSL_CTX_set_srp_client_pwd_callback(client_ctx, client_srp_cb);
client_ctx_data->srp_password = OPENSSL_strdup(extra->client.srp_password);
+ if (client_ctx_data->srp_password == NULL)
+ return 0;
SSL_CTX_set_srp_cb_arg(client_ctx, client_ctx_data);
}
return 1;