summaryrefslogtreecommitdiff
path: root/source3/libsmb/smb_seal.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-07-21 19:13:59 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 18:48:02 +1000
commita942401c1f6ee614080cee76c4364afbd729a446 (patch)
treee1cc944765753be2b19529bf64eece16069f9873 /source3/libsmb/smb_seal.c
parent9edb9763df07fbceee49d54fd6972c5ffb83d133 (diff)
downloadsamba-a942401c1f6ee614080cee76c4364afbd729a446.tar.gz
samba-a942401c1f6ee614080cee76c4364afbd729a446.tar.bz2
samba-a942401c1f6ee614080cee76c4364afbd729a446.zip
s3-ntlmssp Use auth_ntlmssp_*() functions in more places
This allows auth_ntlmssp_get_ntlmssp_state() to be removed. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/libsmb/smb_seal.c')
-rw-r--r--source3/libsmb/smb_seal.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c
index 73786ac54a..fd9de1de8e 100644
--- a/source3/libsmb/smb_seal.c
+++ b/source3/libsmb/smb_seal.c
@@ -21,6 +21,8 @@
#include "../libcli/auth/ntlmssp.h"
#include "smb_crypt.h"
#include "libsmb/libsmb.h"
+#include "ntlmssp_wrap.h"
+
/******************************************************************************
Pull out the encryption context for this packet. 0 means global context.
@@ -62,7 +64,7 @@ bool common_encryption_on(struct smb_trans_enc_state *es)
output, so cope with the same for compatibility.
******************************************************************************/
-NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf)
+NTSTATUS common_ntlm_decrypt_buffer(struct auth_ntlmssp_state *auth_ntlmssp_state, char *buf)
{
NTSTATUS status;
size_t buf_len = smb_len(buf) + 4; /* Don't forget the 4 length bytes. */
@@ -82,7 +84,7 @@ NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *b
/* Point at the signature. */
sig = data_blob_const(inbuf+8, NTLMSSP_SIG_SIZE);
- status = ntlmssp_unseal_packet(ntlmssp_state,
+ status = auth_ntlmssp_unseal_packet(auth_ntlmssp_state,
(unsigned char *)inbuf + 8 + NTLMSSP_SIG_SIZE, /* 4 byte len + 0xFF 'E' <enc> <ctx> */
data_len,
(unsigned char *)inbuf + 8 + NTLMSSP_SIG_SIZE,
@@ -110,7 +112,7 @@ NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *b
output, so do the same for compatibility.
******************************************************************************/
-NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
+NTSTATUS common_ntlm_encrypt_buffer(struct auth_ntlmssp_state *auth_ntlmssp_state,
uint16 enc_ctx_num,
char *buf,
char **ppbuf_out)
@@ -142,7 +144,7 @@ NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
ZERO_STRUCT(sig);
- status = ntlmssp_seal_packet(ntlmssp_state,
+ status = auth_ntlmssp_seal_packet(auth_ntlmssp_state,
frame,
(unsigned char *)buf_out + 8 + NTLMSSP_SIG_SIZE, /* 4 byte len + 0xFF 'S' <enc> <ctx> */
data_len,
@@ -304,7 +306,7 @@ NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, cha
switch (es->smb_enc_type) {
case SMB_TRANS_ENC_NTLM:
- return common_ntlm_encrypt_buffer(es->s.ntlmssp_state, es->enc_ctx_num, buffer, buf_out);
+ return common_ntlm_encrypt_buffer(es->s.auth_ntlmssp_state, es->enc_ctx_num, buffer, buf_out);
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
case SMB_TRANS_ENC_GSS:
return common_gss_encrypt_buffer(es->s.gss_state, es->enc_ctx_num, buffer, buf_out);
@@ -329,7 +331,7 @@ NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf)
switch (es->smb_enc_type) {
case SMB_TRANS_ENC_NTLM:
- return common_ntlm_decrypt_buffer(es->s.ntlmssp_state, buf);
+ return common_ntlm_decrypt_buffer(es->s.auth_ntlmssp_state, buf);
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
case SMB_TRANS_ENC_GSS:
return common_gss_decrypt_buffer(es->s.gss_state, buf);
@@ -372,8 +374,8 @@ void common_free_encryption_state(struct smb_trans_enc_state **pp_es)
}
if (es->smb_enc_type == SMB_TRANS_ENC_NTLM) {
- if (es->s.ntlmssp_state) {
- TALLOC_FREE(es->s.ntlmssp_state);
+ if (es->s.auth_ntlmssp_state) {
+ TALLOC_FREE(es->s.auth_ntlmssp_state);
}
}
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)