return 0;
}
if (NT_STATUS_IS_ERR(status)) {
- EVENT_FD_NOT_READABLE(tls->fde);
- EVENT_FD_NOT_WRITEABLE(tls->fde);
+ TEVENT_FD_NOT_READABLE(tls->fde);
+ TEVENT_FD_NOT_WRITEABLE(tls->fde);
errno = EBADF;
return -1;
}
if (!NT_STATUS_IS_OK(status)) {
- EVENT_FD_READABLE(tls->fde);
+ TEVENT_FD_READABLE(tls->fde);
errno = EAGAIN;
return -1;
}
if (tls->output_pending) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
}
if (size != nread) {
- EVENT_FD_READABLE(tls->fde);
+ TEVENT_FD_READABLE(tls->fde);
}
return nread;
}
return -1;
}
if (!NT_STATUS_IS_OK(status)) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
return -1;
}
if (size != nwritten) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
}
return nwritten;
}
ret = gnutls_handshake(tls->session);
if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
if (gnutls_record_get_direction(tls->session) == 1) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
}
return STATUS_MORE_ENTRIES;
}
ret = gnutls_record_recv(tls->session, buf, wantlen);
if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
if (gnutls_record_get_direction(tls->session) == 1) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
}
tls->interrupted = true;
return STATUS_MORE_ENTRIES;
ret = gnutls_record_send(tls->session, blob->data, blob->length);
if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
if (gnutls_record_get_direction(tls->session) == 1) {
- EVENT_FD_WRITEABLE(tls->fde);
+ TEVENT_FD_WRITEABLE(tls->fde);
}
tls->interrupted = true;
return STATUS_MORE_ENTRIES;
struct tls_params *params;
int ret;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
- const char *keyfile = lp_tls_keyfile(tmp_ctx, lp_ctx);
- const char *certfile = lp_tls_certfile(tmp_ctx, lp_ctx);
- const char *cafile = lp_tls_cafile(tmp_ctx, lp_ctx);
- const char *crlfile = lp_tls_crlfile(tmp_ctx, lp_ctx);
- const char *dhpfile = lp_tls_dhpfile(tmp_ctx, lp_ctx);
+ const char *keyfile = lpcfg_tls_keyfile(tmp_ctx, lp_ctx);
+ const char *certfile = lpcfg_tls_certfile(tmp_ctx, lp_ctx);
+ const char *cafile = lpcfg_tls_cafile(tmp_ctx, lp_ctx);
+ const char *crlfile = lpcfg_tls_crlfile(tmp_ctx, lp_ctx);
+ const char *dhpfile = lpcfg_tls_dhpfile(tmp_ctx, lp_ctx);
void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *);
params = talloc(mem_ctx, struct tls_params);
if (params == NULL) {
return NULL;
}
- if (!lp_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
+ if (!lpcfg_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
params->tls_enabled = false;
talloc_free(tmp_ctx);
return params;
if (!file_exist(cafile)) {
char *hostname = talloc_asprintf(mem_ctx, "%s.%s",
- lp_netbios_name(lp_ctx), lp_realm(lp_ctx));
+ lpcfg_netbios_name(lp_ctx),
+ lpcfg_dnsdomain(lp_ctx));
if (hostname == NULL) {
goto init_failed;
}
gnutls_transport_set_ptr(tls->session, (gnutls_transport_ptr)tls);
gnutls_transport_set_pull_function(tls->session, (gnutls_pull_func)tls_pull);
gnutls_transport_set_push_function(tls->session, (gnutls_push_func)tls_push);
+#if GNUTLS_VERSION_MAJOR < 3
gnutls_transport_set_lowat(tls->session, 0);
+#endif
tls->plain_chars = plain_chars;
if (plain_chars) {
gnutls_transport_set_ptr(tls->session, (gnutls_transport_ptr)tls);
gnutls_transport_set_pull_function(tls->session, (gnutls_pull_func)tls_pull);
gnutls_transport_set_push_function(tls->session, (gnutls_push_func)tls_push);
+#if GNUTLS_VERSION_MAJOR < 3
gnutls_transport_set_lowat(tls->session, 0);
+#endif
tls->tls_detect = false;
tls->output_pending = false;