summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/auth/pac.c34
-rw-r--r--source4/torture/rap/rap.c29
-rw-r--r--source4/torture/rpc/samba3rpc.c7
3 files changed, 47 insertions, 23 deletions
diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c
index efb36e3ef8..68bbd3483a 100644
--- a/source4/torture/auth/pac.c
+++ b/source4/torture/auth/pac.c
@@ -112,7 +112,9 @@ static bool torture_pac_self_check(struct torture_context *tctx)
}
/* OK, go ahead and make a PAC */
- ret = kerberos_create_pac(mem_ctx, server_info,
+ ret = kerberos_create_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ server_info,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
&server_keyblock,
@@ -137,7 +139,9 @@ static bool torture_pac_self_check(struct torture_context *tctx)
dump_data(10,tmp_blob.data,tmp_blob.length);
/* Now check that we can read it back */
- nt_status = kerberos_decode_pac(mem_ctx, &pac_data,
+ nt_status = kerberos_decode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &pac_data,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -159,7 +163,9 @@ static bool torture_pac_self_check(struct torture_context *tctx)
}
/* Now check that we can read it back */
- nt_status = kerberos_pac_logon_info(mem_ctx, &logon_info,
+ nt_status = kerberos_pac_logon_info(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &logon_info,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -367,7 +373,9 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
}
/* Decode and verify the signaure on the PAC */
- nt_status = kerberos_decode_pac(mem_ctx, &pac_data,
+ nt_status = kerberos_decode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &pac_data,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -386,7 +394,9 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
}
/* Parse the PAC again, for the logon info this time */
- nt_status = kerberos_pac_logon_info(mem_ctx, &logon_info,
+ nt_status = kerberos_pac_logon_info(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &logon_info,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -442,6 +452,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
}
ret = kerberos_encode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
pac_data,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -493,6 +504,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
}
ret = kerberos_create_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
server_info_out,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -565,7 +577,9 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
}
/* Break the auth time, to ensure we check this vital detail (not setting this caused all the pain in the first place... */
- nt_status = kerberos_decode_pac(mem_ctx, &pac_data,
+ nt_status = kerberos_decode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &pac_data,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -601,7 +615,9 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
smb_get_krb5_error_message(smb_krb5_context->krb5_context, ret, mem_ctx)));
}
- nt_status = kerberos_decode_pac(mem_ctx, &pac_data,
+ nt_status = kerberos_decode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &pac_data,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
@@ -619,7 +635,9 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
/* Finally... Bugger up the signature, and check we fail the checksum */
tmp_blob.data[tmp_blob.length - 2]++;
- nt_status = kerberos_decode_pac(mem_ctx, &pac_data,
+ nt_status = kerberos_decode_pac(mem_ctx,
+ lp_iconv_convenience(tctx->lp_ctx),
+ &pac_data,
tmp_blob,
smb_krb5_context->krb5_context,
&krbtgt_keyblock,
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 71689786e8..8bdd6a8ddd 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -189,14 +189,16 @@ static NTSTATUS rap_pull_string(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr,
return NT_STATUS_OK;
}
-static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, struct rap_call *call)
+static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ struct rap_call *call)
{
NTSTATUS result;
DATA_BLOB param_blob;
struct ndr_push *params;
struct smb_trans2 trans;
- params = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm));
+ params = ndr_push_init_ctx(call, iconv_convenience);
if (params == NULL)
return NT_STATUS_NO_MEMORY;
@@ -231,11 +233,11 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, struct rap_call *call)
return result;
call->ndr_pull_param = ndr_pull_init_blob(&trans.out.params, call,
- lp_iconv_convenience(global_loadparm));
+ iconv_convenience);
call->ndr_pull_param->flags = RAPNDR_FLAGS;
call->ndr_pull_data = ndr_pull_init_blob(&trans.out.data, call,
- lp_iconv_convenience(global_loadparm));
+ iconv_convenience);
call->ndr_pull_data->flags = RAPNDR_FLAGS;
return result;
@@ -243,6 +245,7 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, struct rap_call *call)
static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
TALLOC_CTX *mem_ctx,
struct rap_NetShareEnum *r)
{
@@ -268,7 +271,7 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree,
break;
}
- result = rap_cli_do_call(tree, call);
+ result = rap_cli_do_call(tree, iconv_convenience, call);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -322,7 +325,7 @@ static bool test_netshareenum(struct torture_context *tctx,
r.in.bufsize = 8192;
torture_assert_ntstatus_ok(tctx,
- smbcli_rap_netshareenum(cli->tree, tctx, &r), "");
+ smbcli_rap_netshareenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), "");
for (i=0; i<r.out.count; i++) {
printf("%s %d %s\n", r.out.info[i].info1.name,
@@ -334,6 +337,7 @@ static bool test_netshareenum(struct torture_context *tctx,
}
static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
TALLOC_CTX *mem_ctx,
struct rap_NetServerEnum2 *r)
{
@@ -361,7 +365,7 @@ static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree,
break;
}
- result = rap_cli_do_call(tree, call);
+ result = rap_cli_do_call(tree, iconv_convenience, call);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -421,7 +425,7 @@ static bool test_netserverenum(struct torture_context *tctx,
r.in.domain = NULL;
torture_assert_ntstatus_ok(tctx,
- smbcli_rap_netserverenum2(cli->tree, tctx, &r), "");
+ smbcli_rap_netserverenum2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), "");
for (i=0; i<r.out.count; i++) {
switch (r.in.level) {
@@ -440,6 +444,7 @@ static bool test_netserverenum(struct torture_context *tctx,
}
_PUBLIC_ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
TALLOC_CTX *mem_ctx,
struct rap_WserverGetInfo *r)
{
@@ -466,7 +471,7 @@ _PUBLIC_ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
goto done;
}
- result = rap_cli_do_call(tree, call);
+ result = rap_cli_do_call(tree, iconv_convenience, call);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -507,9 +512,9 @@ static bool test_netservergetinfo(struct torture_context *tctx,
r.in.bufsize = 0xffff;
r.in.level = 0;
- torture_assert_ntstatus_ok(tctx, smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "");
+ torture_assert_ntstatus_ok(tctx, smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), "");
r.in.level = 1;
- torture_assert_ntstatus_ok(tctx, smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "");
+ torture_assert_ntstatus_ok(tctx, smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), "");
return res;
}
@@ -522,7 +527,7 @@ bool torture_rap_scan(struct torture_context *torture, struct smbcli_state *cli)
struct rap_call *call = new_rap_cli_call(torture, callno);
NTSTATUS result;
- result = rap_cli_do_call(cli->tree, call);
+ result = rap_cli_do_call(cli->tree, lp_iconv_convenience(torture->lp_ctx), call);
if (!NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER))
continue;
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 779a28e126..f62fa8742b 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2337,6 +2337,7 @@ bool torture_samba3_rpc_lsa(struct torture_context *torture)
}
static NTSTATUS get_servername(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
char **name)
{
struct rap_WserverGetInfo r;
@@ -2346,7 +2347,7 @@ static NTSTATUS get_servername(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
r.in.level = 0;
r.in.bufsize = 0xffff;
- status = smbcli_rap_netservergetinfo(tree, mem_ctx, &r);
+ status = smbcli_rap_netservergetinfo(tree, iconv_convenience, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -2561,7 +2562,7 @@ bool torture_samba3_rpc_spoolss(struct torture_context *torture)
return false;
}
- status = get_servername(mem_ctx, cli->tree, &servername);
+ status = get_servername(mem_ctx, cli->tree, lp_iconv_convenience(torture->lp_ctx), &servername);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "(%s) get_servername returned %s\n",
__location__, nt_errstr(status));
@@ -2747,7 +2748,7 @@ bool torture_samba3_rpc_wkssvc(struct torture_context *torture)
return false;
}
- status = get_servername(mem_ctx, cli->tree, &servername);
+ status = get_servername(mem_ctx, cli->tree, lp_iconv_convenience(torture->lp_ctx), &servername);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "(%s) get_servername returned %s\n",
__location__, nt_errstr(status));