This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
return NT_STATUS_BUFFER_TOO_SMALL;
}
- inbuf = smb_xmemdup(buf, buf_len);
+ inbuf = (char *)smb_xmemdup(buf, buf_len);
/* Adjust for the signature. */
data_len = buf_len - 8 - NTLMSSP_SIG_SIZE;
}
memcpy(buf + 8, inbuf + 8 + NTLMSSP_SIG_SIZE, data_len);
- SAFE_FREE(inbuf);
/* Reset the length. */
- smb_setlen(buf, data_len + 4);
+ smb_setlen(inbuf, buf, data_len + 4);
+
+ SAFE_FREE(inbuf);
return NT_STATUS_OK;
}
ADS_STATUS adss = ADS_ERROR_GSS(ret, minor);
DEBUG(0,("common_gss_encrypt_buffer: gss_unwrap failed. Error %s\n",
ads_errstr(adss) ));
- /* Um - no mapping for gss-errs to NTSTATUS yet. */
- return ads_ntstatus(adss);
+ return map_nt_error_from_gss(ret, minor);
}
if (out_buf.length > in_buf.length) {
}
memcpy(buf + 8, out_buf.value, out_buf.length);
- smb_setlen(buf, out_buf.length + 4);
+ smb_setlen((char *)out_buf.value, buf, out_buf.length + 4);
gss_release_buffer(&minor, &out_buf);
return NT_STATUS_OK;
ADS_STATUS adss = ADS_ERROR_GSS(ret, minor);
DEBUG(0,("common_gss_encrypt_buffer: gss_wrap failed. Error %s\n",
ads_errstr(adss) ));
- /* Um - no mapping for gss-errs to NTSTATUS yet. */
- return ads_ntstatus(adss);
+ return map_nt_error_from_gss(ret, minor);
}
if (!flags_got) {
* bother :-*(. JRA.
*/
- *ppbuf_out = SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
+ *ppbuf_out = (char *)SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
if (!*ppbuf_out) {
gss_release_buffer(&minor, &out_buf);
return NT_STATUS_NO_MEMORY;