diff options
author | Jeremy Allison <jra@samba.org> | 2007-03-21 00:25:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:46 -0500 |
commit | 783a7b3085a155d9652cd725bf2960cd272cb554 (patch) | |
tree | 45f677a4914abeb79f4f3e5201a1878bd34872e8 /source/smbd/seal.c | |
parent | 6b5ff7bd591b4f65e2eb767928db50ddf445f09a (diff) | |
download | samba-783a7b3085a155d9652cd725bf2960cd272cb554.tar.gz samba-783a7b3085a155d9652cd725bf2960cd272cb554.tar.xz samba-783a7b3085a155d9652cd725bf2960cd272cb554.zip |
r21897: Add in a basic raw NTLM encrypt request. Now
for testing.
Jeremy.
Diffstat (limited to 'source/smbd/seal.c')
-rw-r--r-- | source/smbd/seal.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/source/smbd/seal.c b/source/smbd/seal.c index 9910a84f4c4..8283346c28d 100644 --- a/source/smbd/seal.c +++ b/source/smbd/seal.c @@ -385,8 +385,36 @@ NTSTATUS srv_request_encryption_setup(unsigned char **ppdata, size_t *p_data_siz Negotiation was successful - turn on server-side encryption. ******************************************************************************/ -void srv_encryption_start(void) +static NTSTATUS check_enc_good(struct smb_srv_trans_enc_ctx *ec) { + if (!ec || !ec->es) { + return NT_STATUS_LOGON_FAILURE; + } + + if (ec->es->smb_enc_type == SMB_TRANS_ENC_NTLM) { + if ((ec->es->ntlmssp_state->neg_flags & (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) != + (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) { + return NT_STATUS_INVALID_PARAMETER; + } + } + /* Todo - check gssapi case. */ + + return NT_STATUS_OK; +} + +/****************************************************************************** + Negotiation was successful - turn on server-side encryption. +******************************************************************************/ + +NTSTATUS srv_encryption_start(void) +{ + NTSTATUS status; + + /* Check that we are really doing sign+seal. */ + status = check_enc_good(partial_srv_trans_enc_ctx); + if (!NT_STATUS_IS_OK(status)) { + return status; + } /* Throw away the context we're using currently (if any). */ srv_free_encryption_context(&srv_trans_enc_ctx); @@ -395,6 +423,7 @@ void srv_encryption_start(void) srv_trans_enc_ctx->es->enc_on = True; partial_srv_trans_enc_ctx = NULL; + return NT_STATUS_OK; } /****************************************************************************** |