summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-10-18 21:27:39 +1100
committerStefan Metzmacher <metze@samba.org>2011-10-21 08:43:23 +0200
commitbd29f79463009ff7383cb17a3f766fddcdb1f302 (patch)
tree5caa60eb360bd3c3819cc03a7f17d02da8c10069 /source3/libsmb
parent487545d48fc0625aab20aa8f46897e2bd622554f (diff)
downloadsamba-bd29f79463009ff7383cb17a3f766fddcdb1f302.tar.gz
samba-bd29f79463009ff7383cb17a3f766fddcdb1f302.tar.bz2
samba-bd29f79463009ff7383cb17a3f766fddcdb1f302.zip
s3-ntlmssp use gensec_{seal,unseal,sign,check}_packet
This avoids the indirection via the auth_ntlmsssp wrapper functions. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/ntlmssp_wrap.c46
-rw-r--r--source3/libsmb/smb_seal.c7
2 files changed, 4 insertions, 49 deletions
diff --git a/source3/libsmb/ntlmssp_wrap.c b/source3/libsmb/ntlmssp_wrap.c
index e18a60b730..a470444054 100644
--- a/source3/libsmb/ntlmssp_wrap.c
+++ b/source3/libsmb/ntlmssp_wrap.c
@@ -26,52 +26,6 @@
#include "librpc/rpc/dcerpc.h"
#include "lib/param/param.h"
-NTSTATUS auth_ntlmssp_sign_packet(struct auth_ntlmssp_state *ans,
- TALLOC_CTX *sig_mem_ctx,
- const uint8_t *data,
- size_t length,
- const uint8_t *whole_pdu,
- size_t pdu_length,
- DATA_BLOB *sig)
-{
- return gensec_sign_packet(ans->gensec_security,
- sig_mem_ctx, data, length, whole_pdu, pdu_length, sig);
-}
-
-NTSTATUS auth_ntlmssp_check_packet(struct auth_ntlmssp_state *ans,
- const uint8_t *data,
- size_t length,
- const uint8_t *whole_pdu,
- size_t pdu_length,
- const DATA_BLOB *sig)
-{
- return gensec_check_packet(ans->gensec_security,
- data, length, whole_pdu, pdu_length, sig);
-}
-
-NTSTATUS auth_ntlmssp_seal_packet(struct auth_ntlmssp_state *ans,
- TALLOC_CTX *sig_mem_ctx,
- uint8_t *data,
- size_t length,
- const uint8_t *whole_pdu,
- size_t pdu_length,
- DATA_BLOB *sig)
-{
- return gensec_seal_packet(ans->gensec_security,
- sig_mem_ctx, data, length, whole_pdu, pdu_length, sig);
-}
-
-NTSTATUS auth_ntlmssp_unseal_packet(struct auth_ntlmssp_state *ans,
- uint8_t *data,
- size_t length,
- const uint8_t *whole_pdu,
- size_t pdu_length,
- const DATA_BLOB *sig)
-{
- return gensec_unseal_packet(ans->gensec_security,
- data, length, whole_pdu, pdu_length, sig);
-}
-
NTSTATUS auth_ntlmssp_set_username(struct auth_ntlmssp_state *ans,
const char *user)
{
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c
index 950f3e3822..f767f16be5 100644
--- a/source3/libsmb/smb_seal.c
+++ b/source3/libsmb/smb_seal.c
@@ -23,6 +23,7 @@
#include "libsmb/libsmb.h"
#include "ntlmssp_wrap.h"
#include "libcli/auth/krb5_wrap.h"
+#include "auth/gensec/gensec.h"
#undef malloc
@@ -99,7 +100,7 @@ static NTSTATUS common_ntlm_decrypt_buffer(struct auth_ntlmssp_state *auth_ntlms
/* Point at the signature. */
sig = data_blob_const(inbuf+8, NTLMSSP_SIG_SIZE);
- status = auth_ntlmssp_unseal_packet(auth_ntlmssp_state,
+ status = gensec_unseal_packet(auth_ntlmssp_state->gensec_security,
(unsigned char *)inbuf + 8 + NTLMSSP_SIG_SIZE, /* 4 byte len + 0xFF 'E' <enc> <ctx> */
data_len,
(unsigned char *)inbuf + 8 + NTLMSSP_SIG_SIZE,
@@ -163,8 +164,8 @@ static NTSTATUS common_ntlm_encrypt_buffer(struct auth_ntlmssp_state *auth_ntlms
ZERO_STRUCT(sig);
- status = auth_ntlmssp_seal_packet(auth_ntlmssp_state,
- frame,
+ status = gensec_seal_packet(auth_ntlmssp_state->gensec_security,
+ frame,
(unsigned char *)buf_out + 8 + NTLMSSP_SIG_SIZE, /* 4 byte len + 0xFF 'S' <enc> <ctx> */
data_len,
(unsigned char *)buf_out + 8 + NTLMSSP_SIG_SIZE,