r11830: patch from Rashid N. Achilov <shelton@granch.ru> to add descriptions for...
[Samba.git] / source / libsmb / clitrans.c
blob5d3710b92e260f055c87e66e95ae9546d37b3134
1 /*
2 Unix SMB/CIFS implementation.
3 client transaction calls
4 Copyright (C) Andrew Tridgell 1994-1998
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "includes.h"
24 /****************************************************************************
25 Send a SMB trans or trans2 request.
26 ****************************************************************************/
28 BOOL cli_send_trans(struct cli_state *cli, int trans,
29 const char *pipe_name,
30 int fid, int flags,
31 uint16 *setup, unsigned int lsetup, unsigned int msetup,
32 const char *param, unsigned int lparam, unsigned int mparam,
33 const char *data, unsigned int ldata, unsigned int mdata)
35 unsigned int i;
36 unsigned int this_ldata,this_lparam;
37 unsigned int tot_data=0,tot_param=0;
38 char *outdata,*outparam;
39 char *p;
40 int pipe_name_len=0;
41 uint16 mid;
43 this_lparam = MIN(lparam,cli->max_xmit - (500+lsetup*2)); /* hack */
44 this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
46 memset(cli->outbuf,'\0',smb_size);
47 set_message(cli->outbuf,14+lsetup,0,True);
48 SCVAL(cli->outbuf,smb_com,trans);
49 SSVAL(cli->outbuf,smb_tid, cli->cnum);
50 cli_setup_packet(cli);
53 * Save the mid we're using. We need this for finding
54 * signing replies.
57 mid = cli->mid;
59 if (pipe_name) {
60 pipe_name_len = clistr_push(cli, smb_buf(cli->outbuf), pipe_name, -1, STR_TERMINATE);
63 outparam = smb_buf(cli->outbuf)+(trans==SMBtrans ? pipe_name_len : 3);
64 outdata = outparam+this_lparam;
66 /* primary request */
67 SSVAL(cli->outbuf,smb_tpscnt,lparam); /* tpscnt */
68 SSVAL(cli->outbuf,smb_tdscnt,ldata); /* tdscnt */
69 SSVAL(cli->outbuf,smb_mprcnt,mparam); /* mprcnt */
70 SSVAL(cli->outbuf,smb_mdrcnt,mdata); /* mdrcnt */
71 SCVAL(cli->outbuf,smb_msrcnt,msetup); /* msrcnt */
72 SSVAL(cli->outbuf,smb_flags,flags); /* flags */
73 SIVAL(cli->outbuf,smb_timeout,0); /* timeout */
74 SSVAL(cli->outbuf,smb_pscnt,this_lparam); /* pscnt */
75 SSVAL(cli->outbuf,smb_psoff,smb_offset(outparam,cli->outbuf)); /* psoff */
76 SSVAL(cli->outbuf,smb_dscnt,this_ldata); /* dscnt */
77 SSVAL(cli->outbuf,smb_dsoff,smb_offset(outdata,cli->outbuf)); /* dsoff */
78 SCVAL(cli->outbuf,smb_suwcnt,lsetup); /* suwcnt */
79 for (i=0;i<lsetup;i++) /* setup[] */
80 SSVAL(cli->outbuf,smb_setup+i*2,setup[i]);
81 p = smb_buf(cli->outbuf);
82 if (trans != SMBtrans) {
83 *p++ = 0; /* put in a null smb_name */
84 *p++ = 'D'; *p++ = ' '; /* observed in OS/2 */
86 if (this_lparam) /* param[] */
87 memcpy(outparam,param,this_lparam);
88 if (this_ldata) /* data[] */
89 memcpy(outdata,data,this_ldata);
90 cli_setup_bcc(cli, outdata+this_ldata);
92 show_msg(cli->outbuf);
94 if (!cli_send_smb(cli)) {
95 return False;
98 if (this_ldata < ldata || this_lparam < lparam) {
99 /* receive interim response */
100 if (!cli_receive_smb(cli) || cli_is_error(cli)) {
101 return(False);
104 tot_data = this_ldata;
105 tot_param = this_lparam;
107 while (tot_data < ldata || tot_param < lparam) {
108 this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
109 this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
111 set_message(cli->outbuf,trans==SMBtrans?8:9,0,True);
112 SCVAL(cli->outbuf,smb_com,(trans==SMBtrans ? SMBtranss : SMBtranss2));
114 outparam = smb_buf(cli->outbuf);
115 outdata = outparam+this_lparam;
117 /* secondary request */
118 SSVAL(cli->outbuf,smb_tpscnt,lparam); /* tpscnt */
119 SSVAL(cli->outbuf,smb_tdscnt,ldata); /* tdscnt */
120 SSVAL(cli->outbuf,smb_spscnt,this_lparam); /* pscnt */
121 SSVAL(cli->outbuf,smb_spsoff,smb_offset(outparam,cli->outbuf)); /* psoff */
122 SSVAL(cli->outbuf,smb_spsdisp,tot_param); /* psdisp */
123 SSVAL(cli->outbuf,smb_sdscnt,this_ldata); /* dscnt */
124 SSVAL(cli->outbuf,smb_sdsoff,smb_offset(outdata,cli->outbuf)); /* dsoff */
125 SSVAL(cli->outbuf,smb_sdsdisp,tot_data); /* dsdisp */
126 if (trans==SMBtrans2)
127 SSVALS(cli->outbuf,smb_sfid,fid); /* fid */
128 if (this_lparam) /* param[] */
129 memcpy(outparam,param+tot_param,this_lparam);
130 if (this_ldata) /* data[] */
131 memcpy(outdata,data+tot_data,this_ldata);
132 cli_setup_bcc(cli, outdata+this_ldata);
135 * Save the mid we're using. We need this for finding
136 * signing replies.
138 mid = cli->mid;
140 show_msg(cli->outbuf);
141 if (!cli_send_smb(cli)) {
142 return False;
145 /* Ensure we use the same mid for the secondaries. */
146 cli->mid = mid;
148 tot_data += this_ldata;
149 tot_param += this_lparam;
153 /* Note we're in a trans state. Save the sequence
154 * numbers for replies. */
156 cli_signing_trans_start(cli, mid);
157 return(True);
160 /****************************************************************************
161 Receive a SMB trans or trans2 response allocating the necessary memory.
162 ****************************************************************************/
164 BOOL cli_receive_trans(struct cli_state *cli,int trans,
165 char **param, unsigned int *param_len,
166 char **data, unsigned int *data_len)
168 unsigned int total_data=0;
169 unsigned int total_param=0;
170 unsigned int this_data,this_param;
171 NTSTATUS status;
172 char *tdata;
173 char *tparam;
175 *data_len = *param_len = 0;
177 if (!cli_receive_smb(cli)) {
178 cli_signing_trans_stop(cli);
179 return False;
182 show_msg(cli->inbuf);
184 /* sanity check */
185 if (CVAL(cli->inbuf,smb_com) != trans) {
186 DEBUG(0,("Expected %s response, got command 0x%02x\n",
187 trans==SMBtrans?"SMBtrans":"SMBtrans2",
188 CVAL(cli->inbuf,smb_com)));
189 cli_signing_trans_stop(cli);
190 return(False);
194 * An NT RPC pipe call can return ERRDOS, ERRmoredata
195 * to a trans call. This is not an error and should not
196 * be treated as such. Note that STATUS_NO_MORE_FILES is
197 * returned when a trans2 findfirst/next finishes.
199 status = cli_nt_error(cli);
201 if (NT_STATUS_IS_ERR(status) || NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES)) {
202 cli_signing_trans_stop(cli);
203 return False;
206 /* parse out the lengths */
207 total_data = SVAL(cli->inbuf,smb_tdrcnt);
208 total_param = SVAL(cli->inbuf,smb_tprcnt);
210 /* allocate it */
211 if (total_data!=0) {
212 tdata = SMB_REALLOC(*data,total_data);
213 if (!tdata) {
214 DEBUG(0,("cli_receive_trans: failed to enlarge data buffer\n"));
215 cli_signing_trans_stop(cli);
216 return False;
218 else
219 *data = tdata;
222 if (total_param!=0) {
223 tparam = SMB_REALLOC(*param,total_param);
224 if (!tparam) {
225 DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
226 cli_signing_trans_stop(cli);
227 return False;
229 else
230 *param = tparam;
233 for (;;) {
234 this_data = SVAL(cli->inbuf,smb_drcnt);
235 this_param = SVAL(cli->inbuf,smb_prcnt);
237 if (this_data + *data_len > total_data ||
238 this_param + *param_len > total_param) {
239 DEBUG(1,("Data overflow in cli_receive_trans\n"));
240 cli_signing_trans_stop(cli);
241 return False;
244 if (this_data + *data_len < this_data ||
245 this_data + *data_len < *data_len ||
246 this_param + *param_len < this_param ||
247 this_param + *param_len < *param_len) {
248 DEBUG(1,("Data overflow in cli_receive_trans\n"));
249 cli_signing_trans_stop(cli);
250 return False;
253 if (this_data) {
254 unsigned int data_offset_out = SVAL(cli->inbuf,smb_drdisp);
255 unsigned int data_offset_in = SVAL(cli->inbuf,smb_droff);
257 if (data_offset_out > total_data ||
258 data_offset_out + this_data > total_data ||
259 data_offset_out + this_data < data_offset_out ||
260 data_offset_out + this_data < this_data) {
261 DEBUG(1,("Data overflow in cli_receive_trans\n"));
262 cli_signing_trans_stop(cli);
263 return False;
265 if (data_offset_in > cli->bufsize ||
266 data_offset_in + this_data > cli->bufsize ||
267 data_offset_in + this_data < data_offset_in ||
268 data_offset_in + this_data < this_data) {
269 DEBUG(1,("Data overflow in cli_receive_trans\n"));
270 cli_signing_trans_stop(cli);
271 return False;
274 memcpy(*data + data_offset_out, smb_base(cli->inbuf) + data_offset_in, this_data);
276 if (this_param) {
277 unsigned int param_offset_out = SVAL(cli->inbuf,smb_prdisp);
278 unsigned int param_offset_in = SVAL(cli->inbuf,smb_proff);
280 if (param_offset_out > total_param ||
281 param_offset_out + this_param > total_param ||
282 param_offset_out + this_param < param_offset_out ||
283 param_offset_out + this_param < this_param) {
284 DEBUG(1,("Param overflow in cli_receive_trans\n"));
285 cli_signing_trans_stop(cli);
286 return False;
288 if (param_offset_in > cli->bufsize ||
289 param_offset_in + this_param > cli->bufsize ||
290 param_offset_in + this_param < param_offset_in ||
291 param_offset_in + this_param < this_param) {
292 DEBUG(1,("Param overflow in cli_receive_trans\n"));
293 cli_signing_trans_stop(cli);
294 return False;
297 memcpy(*param + param_offset_out, smb_base(cli->inbuf) + param_offset_in, this_param);
299 *data_len += this_data;
300 *param_len += this_param;
302 if (total_data <= *data_len && total_param <= *param_len)
303 break;
305 if (!cli_receive_smb(cli)) {
306 cli_signing_trans_stop(cli);
307 return False;
310 show_msg(cli->inbuf);
312 /* sanity check */
313 if (CVAL(cli->inbuf,smb_com) != trans) {
314 DEBUG(0,("Expected %s response, got command 0x%02x\n",
315 trans==SMBtrans?"SMBtrans":"SMBtrans2",
316 CVAL(cli->inbuf,smb_com)));
317 cli_signing_trans_stop(cli);
318 return(False);
320 if (NT_STATUS_IS_ERR(cli_nt_error(cli))) {
321 cli_signing_trans_stop(cli);
322 return(False);
325 /* parse out the total lengths again - they can shrink! */
326 if (SVAL(cli->inbuf,smb_tdrcnt) < total_data)
327 total_data = SVAL(cli->inbuf,smb_tdrcnt);
328 if (SVAL(cli->inbuf,smb_tprcnt) < total_param)
329 total_param = SVAL(cli->inbuf,smb_tprcnt);
331 if (total_data <= *data_len && total_param <= *param_len)
332 break;
336 cli_signing_trans_stop(cli);
337 return(True);
340 /****************************************************************************
341 Send a SMB nttrans request.
342 ****************************************************************************/
344 BOOL cli_send_nt_trans(struct cli_state *cli,
345 int function,
346 int flags,
347 uint16 *setup, unsigned int lsetup, unsigned int msetup,
348 char *param, unsigned int lparam, unsigned int mparam,
349 char *data, unsigned int ldata, unsigned int mdata)
351 unsigned int i;
352 unsigned int this_ldata,this_lparam;
353 unsigned int tot_data=0,tot_param=0;
354 uint16 mid;
355 char *outdata,*outparam;
357 this_lparam = MIN(lparam,cli->max_xmit - (500+lsetup*2)); /* hack */
358 this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
360 memset(cli->outbuf,'\0',smb_size);
361 set_message(cli->outbuf,19+lsetup,0,True);
362 SCVAL(cli->outbuf,smb_com,SMBnttrans);
363 SSVAL(cli->outbuf,smb_tid, cli->cnum);
364 cli_setup_packet(cli);
367 * Save the mid we're using. We need this for finding
368 * signing replies.
371 mid = cli->mid;
373 outparam = smb_buf(cli->outbuf)+3;
374 outdata = outparam+this_lparam;
376 /* primary request */
377 SCVAL(cli->outbuf,smb_nt_MaxSetupCount,msetup);
378 SCVAL(cli->outbuf,smb_nt_Flags,flags);
379 SIVAL(cli->outbuf,smb_nt_TotalParameterCount, lparam);
380 SIVAL(cli->outbuf,smb_nt_TotalDataCount, ldata);
381 SIVAL(cli->outbuf,smb_nt_MaxParameterCount, mparam);
382 SIVAL(cli->outbuf,smb_nt_MaxDataCount, mdata);
383 SIVAL(cli->outbuf,smb_nt_ParameterCount, this_lparam);
384 SIVAL(cli->outbuf,smb_nt_ParameterOffset, smb_offset(outparam,cli->outbuf));
385 SIVAL(cli->outbuf,smb_nt_DataCount, this_ldata);
386 SIVAL(cli->outbuf,smb_nt_DataOffset, smb_offset(outdata,cli->outbuf));
387 SIVAL(cli->outbuf,smb_nt_SetupCount, lsetup);
388 SIVAL(cli->outbuf,smb_nt_Function, function);
389 for (i=0;i<lsetup;i++) /* setup[] */
390 SSVAL(cli->outbuf,smb_nt_SetupStart+i*2,setup[i]);
392 if (this_lparam) /* param[] */
393 memcpy(outparam,param,this_lparam);
394 if (this_ldata) /* data[] */
395 memcpy(outdata,data,this_ldata);
397 cli_setup_bcc(cli, outdata+this_ldata);
399 show_msg(cli->outbuf);
400 if (!cli_send_smb(cli)) {
401 return False;
404 if (this_ldata < ldata || this_lparam < lparam) {
405 /* receive interim response */
406 if (!cli_receive_smb(cli) || cli_is_error(cli)) {
407 return(False);
410 tot_data = this_ldata;
411 tot_param = this_lparam;
413 while (tot_data < ldata || tot_param < lparam) {
414 this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
415 this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
417 set_message(cli->outbuf,18,0,True);
418 SCVAL(cli->outbuf,smb_com,SMBnttranss);
420 /* XXX - these should probably be aligned */
421 outparam = smb_buf(cli->outbuf);
422 outdata = outparam+this_lparam;
424 /* secondary request */
425 SIVAL(cli->outbuf,smb_nts_TotalParameterCount,lparam);
426 SIVAL(cli->outbuf,smb_nts_TotalDataCount,ldata);
427 SIVAL(cli->outbuf,smb_nts_ParameterCount,this_lparam);
428 SIVAL(cli->outbuf,smb_nts_ParameterOffset,smb_offset(outparam,cli->outbuf));
429 SIVAL(cli->outbuf,smb_nts_ParameterDisplacement,tot_param);
430 SIVAL(cli->outbuf,smb_nts_DataCount,this_ldata);
431 SIVAL(cli->outbuf,smb_nts_DataOffset,smb_offset(outdata,cli->outbuf));
432 SIVAL(cli->outbuf,smb_nts_DataDisplacement,tot_data);
433 if (this_lparam) /* param[] */
434 memcpy(outparam,param+tot_param,this_lparam);
435 if (this_ldata) /* data[] */
436 memcpy(outdata,data+tot_data,this_ldata);
437 cli_setup_bcc(cli, outdata+this_ldata);
440 * Save the mid we're using. We need this for finding
441 * signing replies.
443 mid = cli->mid;
445 show_msg(cli->outbuf);
447 if (!cli_send_smb(cli)) {
448 return False;
451 /* Ensure we use the same mid for the secondaries. */
452 cli->mid = mid;
454 tot_data += this_ldata;
455 tot_param += this_lparam;
459 /* Note we're in a trans state. Save the sequence
460 * numbers for replies. */
462 cli_signing_trans_start(cli, mid);
463 return(True);
466 /****************************************************************************
467 Receive a SMB nttrans response allocating the necessary memory.
468 ****************************************************************************/
470 BOOL cli_receive_nt_trans(struct cli_state *cli,
471 char **param, unsigned int *param_len,
472 char **data, unsigned int *data_len)
474 unsigned int total_data=0;
475 unsigned int total_param=0;
476 unsigned int this_data,this_param;
477 uint8 eclass;
478 uint32 ecode;
479 char *tdata;
480 char *tparam;
482 *data_len = *param_len = 0;
484 if (!cli_receive_smb(cli)) {
485 cli_signing_trans_stop(cli);
486 return False;
489 show_msg(cli->inbuf);
491 /* sanity check */
492 if (CVAL(cli->inbuf,smb_com) != SMBnttrans) {
493 DEBUG(0,("Expected SMBnttrans response, got command 0x%02x\n",
494 CVAL(cli->inbuf,smb_com)));
495 cli_signing_trans_stop(cli);
496 return(False);
500 * An NT RPC pipe call can return ERRDOS, ERRmoredata
501 * to a trans call. This is not an error and should not
502 * be treated as such.
504 if (cli_is_dos_error(cli)) {
505 cli_dos_error(cli, &eclass, &ecode);
506 if (!(eclass == ERRDOS && ecode == ERRmoredata)) {
507 cli_signing_trans_stop(cli);
508 return(False);
513 * Likewise for NT_STATUS_BUFFER_TOO_SMALL
515 if (cli_is_nt_error(cli)) {
516 if (!NT_STATUS_EQUAL(cli_nt_error(cli),
517 NT_STATUS_BUFFER_TOO_SMALL)) {
518 cli_signing_trans_stop(cli);
519 return(False);
523 /* parse out the lengths */
524 total_data = SVAL(cli->inbuf,smb_ntr_TotalDataCount);
525 total_param = SVAL(cli->inbuf,smb_ntr_TotalParameterCount);
527 /* allocate it */
528 if (total_data) {
529 tdata = SMB_REALLOC(*data,total_data);
530 if (!tdata) {
531 DEBUG(0,("cli_receive_nt_trans: failed to enlarge data buffer to %d\n",total_data));
532 cli_signing_trans_stop(cli);
533 return False;
534 } else {
535 *data = tdata;
539 if (total_param) {
540 tparam = SMB_REALLOC(*param,total_param);
541 if (!tparam) {
542 DEBUG(0,("cli_receive_nt_trans: failed to enlarge param buffer to %d\n", total_param));
543 cli_signing_trans_stop(cli);
544 return False;
545 } else {
546 *param = tparam;
550 while (1) {
551 this_data = SVAL(cli->inbuf,smb_ntr_DataCount);
552 this_param = SVAL(cli->inbuf,smb_ntr_ParameterCount);
554 if (this_data + *data_len > total_data ||
555 this_param + *param_len > total_param) {
556 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
557 cli_signing_trans_stop(cli);
558 return False;
561 if (this_data + *data_len < this_data ||
562 this_data + *data_len < *data_len ||
563 this_param + *param_len < this_param ||
564 this_param + *param_len < *param_len) {
565 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
566 cli_signing_trans_stop(cli);
567 return False;
570 if (this_data) {
571 unsigned int data_offset_out = SVAL(cli->inbuf,smb_ntr_DataDisplacement);
572 unsigned int data_offset_in = SVAL(cli->inbuf,smb_ntr_DataOffset);
574 if (data_offset_out > total_data ||
575 data_offset_out + this_data > total_data ||
576 data_offset_out + this_data < data_offset_out ||
577 data_offset_out + this_data < this_data) {
578 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
579 cli_signing_trans_stop(cli);
580 return False;
582 if (data_offset_in > cli->bufsize ||
583 data_offset_in + this_data > cli->bufsize ||
584 data_offset_in + this_data < data_offset_in ||
585 data_offset_in + this_data < this_data) {
586 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
587 cli_signing_trans_stop(cli);
588 return False;
591 memcpy(*data + data_offset_out, smb_base(cli->inbuf) + data_offset_in, this_data);
594 if (this_param) {
595 unsigned int param_offset_out = SVAL(cli->inbuf,smb_ntr_ParameterDisplacement);
596 unsigned int param_offset_in = SVAL(cli->inbuf,smb_ntr_ParameterOffset);
598 if (param_offset_out > total_param ||
599 param_offset_out + this_param > total_param ||
600 param_offset_out + this_param < param_offset_out ||
601 param_offset_out + this_param < this_param) {
602 DEBUG(1,("Param overflow in cli_receive_nt_trans\n"));
603 cli_signing_trans_stop(cli);
604 return False;
606 if (param_offset_in > cli->bufsize ||
607 param_offset_in + this_param > cli->bufsize ||
608 param_offset_in + this_param < param_offset_in ||
609 param_offset_in + this_param < this_param) {
610 DEBUG(1,("Param overflow in cli_receive_nt_trans\n"));
611 cli_signing_trans_stop(cli);
612 return False;
615 memcpy(*param + param_offset_out, smb_base(cli->inbuf) + param_offset_in, this_param);
618 *data_len += this_data;
619 *param_len += this_param;
621 if (total_data <= *data_len && total_param <= *param_len)
622 break;
624 if (!cli_receive_smb(cli)) {
625 cli_signing_trans_stop(cli);
626 return False;
629 show_msg(cli->inbuf);
631 /* sanity check */
632 if (CVAL(cli->inbuf,smb_com) != SMBnttrans) {
633 DEBUG(0,("Expected SMBnttrans response, got command 0x%02x\n",
634 CVAL(cli->inbuf,smb_com)));
635 cli_signing_trans_stop(cli);
636 return(False);
638 if (cli_is_dos_error(cli)) {
639 cli_dos_error(cli, &eclass, &ecode);
640 if(!(eclass == ERRDOS && ecode == ERRmoredata)) {
641 cli_signing_trans_stop(cli);
642 return(False);
646 * Likewise for NT_STATUS_BUFFER_TOO_SMALL
648 if (cli_is_nt_error(cli)) {
649 if (!NT_STATUS_EQUAL(cli_nt_error(cli),
650 NT_STATUS_BUFFER_TOO_SMALL)) {
651 cli_signing_trans_stop(cli);
652 return(False);
656 /* parse out the total lengths again - they can shrink! */
657 if (SVAL(cli->inbuf,smb_ntr_TotalDataCount) < total_data)
658 total_data = SVAL(cli->inbuf,smb_ntr_TotalDataCount);
659 if (SVAL(cli->inbuf,smb_ntr_TotalParameterCount) < total_param)
660 total_param = SVAL(cli->inbuf,smb_ntr_TotalParameterCount);
662 if (total_data <= *data_len && total_param <= *param_len)
663 break;
666 cli_signing_trans_stop(cli);
667 return(True);