]> git.samba.org - vlendec/samba-autobuild/.git/blobdiff - source3/libsmb/ntlmssp.c
r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[vlendec/samba-autobuild/.git] / source3 / libsmb / ntlmssp.c
index 2bc2183adde4f80be8ab02e246a93eaa14810820..0c0744867dc37a2e0b3e32ffbb84ab972fe0a726 100644 (file)
@@ -9,7 +9,7 @@
 
    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,
@@ -18,8 +18,7 @@
    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"
@@ -299,13 +298,13 @@ NTSTATUS ntlmssp_update(NTLMSSP_STATE *ntlmssp_state,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       *out = data_blob(NULL, 0);
+       *out = data_blob_null;
 
        if (!in.length && ntlmssp_state->stored_response.length) {
                input = ntlmssp_state->stored_response;
                
                /* we only want to read the stored response once - overwrite it */
-               ntlmssp_state->stored_response = data_blob(NULL, 0);
+               ntlmssp_state->stored_response = data_blob_null;
        } else {
                input = in;
        }
@@ -582,7 +581,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
                          NTLMSSP_NAME_TYPE_SERVER_DNS, dnsname,
                          0, "");
        } else {
-               struct_blob = data_blob(NULL, 0);
+               struct_blob = data_blob_null;
        }
 
        {
@@ -623,10 +622,10 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
 static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                                    const DATA_BLOB request, DATA_BLOB *reply) 
 {
-       DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
-       DATA_BLOB user_session_key = data_blob(NULL, 0);
-       DATA_BLOB lm_session_key = data_blob(NULL, 0);
-       DATA_BLOB session_key = data_blob(NULL, 0);
+       DATA_BLOB encrypted_session_key = data_blob_null;
+       DATA_BLOB user_session_key = data_blob_null;
+       DATA_BLOB lm_session_key = data_blob_null;
+       DATA_BLOB session_key = data_blob_null;
        uint32 ntlmssp_command, auth_flags;
        NTSTATUS nt_status = NT_STATUS_OK;
 
@@ -642,7 +641,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
        char *workstation = NULL;
 
        /* parse the NTLMSSP packet */
-       *reply = data_blob(NULL, 0);
+       *reply = data_blob_null;
 
 #if 0
        file_save("ntlmssp_auth.dat", request.data, request.length);
@@ -807,7 +806,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                        
                } else {
                        DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM2 session key.\n"));
-                       session_key = data_blob(NULL, 0);
+                       session_key = data_blob_null;
                }
        } else if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY) {
                if (lm_session_key.data && lm_session_key.length >= 8) {
@@ -834,7 +833,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                                     session_key.length);
                } else {
                        DEBUG(10,("ntlmssp_server_auth: Failed to create NTLM session key.\n"));
-                       session_key = data_blob(NULL, 0);
+                       session_key = data_blob_null;
                }
        } else if (user_session_key.data) {
                session_key = user_session_key;
@@ -846,7 +845,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
        } else {
                DEBUG(10,("ntlmssp_server_auth: Failed to create unmodified session key.\n"));
-               session_key = data_blob(NULL, 0);
+               session_key = data_blob_null;
        }
 
        /* With KEY_EXCH, the client supplies the proposed session key, 
@@ -877,7 +876,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
        }
 
        if (!NT_STATUS_IS_OK(nt_status)) {
-               ntlmssp_state->session_key = data_blob(NULL, 0);
+               ntlmssp_state->session_key = data_blob_null;
        } else if (ntlmssp_state->session_key.length) {
                nt_status = ntlmssp_sign_init(ntlmssp_state);
        }
@@ -992,14 +991,14 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
        uint32 chal_flags, ntlmssp_command, unkn1, unkn2;
        DATA_BLOB server_domain_blob;
        DATA_BLOB challenge_blob;
-       DATA_BLOB struct_blob = data_blob(NULL, 0);
+       DATA_BLOB struct_blob = data_blob_null;
        char *server_domain;
        const char *chal_parse_string;
        const char *auth_gen_string;
-       DATA_BLOB lm_response = data_blob(NULL, 0);
-       DATA_BLOB nt_response = data_blob(NULL, 0);
-       DATA_BLOB session_key = data_blob(NULL, 0);
-       DATA_BLOB encrypted_session_key = data_blob(NULL, 0);
+       DATA_BLOB lm_response = data_blob_null;
+       DATA_BLOB nt_response = data_blob_null;
+       DATA_BLOB session_key = data_blob_null;
+       DATA_BLOB encrypted_session_key = data_blob_null;
        NTSTATUS nt_status = NT_STATUS_OK;
 
        if (!msrpc_parse(&reply, "CdBd",