mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s4-gensec: Replace gensec_set_my_addr() with new tsocket based fn.
This commit is contained in:
parent
743e6363d5
commit
226a9db2d9
@ -1280,15 +1280,6 @@ _PUBLIC_ const struct tsocket_address *gensec_get_remote_address(struct gensec_s
|
||||
return gensec_security->remote_addr;
|
||||
}
|
||||
|
||||
_PUBLIC_ NTSTATUS gensec_set_my_addr(struct gensec_security *gensec_security, struct socket_address *my_addr)
|
||||
{
|
||||
gensec_security->my_addr = my_addr;
|
||||
if (my_addr && !talloc_reference(gensec_security, my_addr)) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
_PUBLIC_ NTSTATUS gensec_set_peer_addr(struct gensec_security *gensec_security, struct socket_address *peer_addr)
|
||||
{
|
||||
gensec_security->peer_addr = peer_addr;
|
||||
|
@ -299,7 +299,6 @@ const struct tsocket_address *gensec_get_local_address(struct gensec_security *g
|
||||
const struct tsocket_address *gensec_get_remote_address(struct gensec_security *gensec_security);
|
||||
|
||||
NTSTATUS gensec_set_peer_addr(struct gensec_security *gensec_security, struct socket_address *peer_addr);
|
||||
NTSTATUS gensec_set_my_addr(struct gensec_security *gensec_security, struct socket_address *my_addr);
|
||||
|
||||
NTSTATUS gensec_start_mech_by_name(struct gensec_security *gensec_security,
|
||||
const char *name);
|
||||
|
@ -436,9 +436,6 @@ bool kpasswdd_process(struct kdc_server *kdc,
|
||||
DATA_BLOB kpasswd_req, kpasswd_rep;
|
||||
struct cli_credentials *server_credentials;
|
||||
struct gensec_security *gensec_security;
|
||||
struct sockaddr_storage ss;
|
||||
ssize_t socklen;
|
||||
struct socket_address *socket_address;
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||
|
||||
char *keytab_name;
|
||||
@ -534,20 +531,7 @@ bool kpasswdd_process(struct kdc_server *kdc,
|
||||
}
|
||||
#endif
|
||||
|
||||
socklen = tsocket_address_bsd_sockaddr(my_addr, (struct sockaddr *) &ss,
|
||||
sizeof(struct sockaddr_storage));
|
||||
if (socklen < 0) {
|
||||
talloc_free(tmp_ctx);
|
||||
return false;
|
||||
}
|
||||
socket_address = socket_address_from_sockaddr(tmp_ctx,
|
||||
(struct sockaddr *) &ss, socklen);
|
||||
if (socket_address == NULL) {
|
||||
talloc_free(tmp_ctx);
|
||||
return false;
|
||||
}
|
||||
|
||||
nt_status = gensec_set_my_addr(gensec_security, socket_address);
|
||||
nt_status = gensec_set_local_address(gensec_security, my_addr);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
talloc_free(tmp_ctx);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user