From c70103f3f81c45846acc60fa84027247d72913f5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 18 Jul 2011 19:46:59 +0200 Subject: s3:libsmb: add cli_state_encryption_on() metze --- source3/libsmb/clientgen.c | 6 ++++++ source3/libsmb/libsmb_context.c | 2 +- source3/libsmb/proto.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 0ee361f862..ab0079650a 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -257,6 +257,12 @@ struct cli_state *cli_initialise(void) return cli_initialise_ex(Undefined); } +bool cli_state_encryption_on(struct cli_state *cli) +{ + return common_encryption_on(cli->trans_enc_state); +} + + /**************************************************************************** Close all pipes open on this session. ****************************************************************************/ diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index 14f646fef3..789a555400 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -470,7 +470,7 @@ smbc_option_get(SMBCCTX *context, for (s = context->internal->servers; s; s = s->next) { num_servers++; - if (s->cli->trans_enc_state == NULL) { + if (!cli_state_encryption_on(s->cli)) { return (void *)false; } } diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 127983de84..98aabee0a7 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -161,6 +161,7 @@ NTSTATUS cli_set_password(struct cli_state *cli, const char *password); NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password); struct cli_state *cli_initialise(void); struct cli_state *cli_initialise_ex(int signing_state); +bool cli_state_encryption_on(struct cli_state *cli); void cli_nt_pipes_close(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); void cli_sockopt(struct cli_state *cli, const char *options); -- cgit