Changeset 745 for trunk/server/source3/smbd/seal.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/smbd/seal.c
r414 r745 19 19 20 20 #include "includes.h" 21 #include "smbd/smbd.h" 21 22 #include "smbd/globals.h" 22 23 #include "../libcli/auth/spnego.h" 24 #include "../libcli/auth/ntlmssp.h" 25 #include "ntlmssp_wrap.h" 26 #include "smb_crypt.h" 27 #include "../lib/util/asn1.h" 28 #include "auth.h" 29 #include "libsmb/libsmb.h" 23 30 24 31 /****************************************************************************** … … 32 39 struct smb_srv_trans_enc_ctx { 33 40 struct smb_trans_enc_state *es; 34 AUTH_NTLMSSP_STATE*auth_ntlmssp_state; /* Must be kept in sync with pointer in ec->ntlmssp_state. */41 struct auth_ntlmssp_state *auth_ntlmssp_state; /* Must be kept in sync with pointer in ec->ntlmssp_state. */ 35 42 }; 36 43 … … 54 61 55 62 /* Ignore non-session messages or non 0xFF'E' messages. */ 56 if(CVAL(inbuf,0) || !(inbuf[4] == 0xFF && inbuf[5] == 'E')) { 63 if(CVAL(inbuf,0) 64 || (smb_len(inbuf) < 8) 65 || !(inbuf[4] == 0xFF && inbuf[5] == 'E')) { 57 66 return false; 58 67 } … … 85 94 * functions after any auth_ntlmssp_start/auth_ntlmssp_end. 86 95 */ 87 ec->es->s.ntlmssp_state = ec->auth_ntlmssp_state->ntlmssp_state;96 ec->es->s.ntlmssp_state = auth_ntlmssp_get_ntlmssp_state(ec->auth_ntlmssp_state); 88 97 return status; 89 98 } … … 101 110 102 111 if (ec->auth_ntlmssp_state) { 103 auth_ntlmssp_end(&ec->auth_ntlmssp_state);112 TALLOC_FREE(ec->auth_ntlmssp_state); 104 113 /* The auth_ntlmssp_end killed this already. */ 105 114 ec->es->s.ntlmssp_state = NULL; … … 421 430 422 431 /* Wrap in SPNEGO. */ 423 response = spnego_gen_auth_response( &auth_reply, status, OID_KERBEROS5);432 response = spnego_gen_auth_response(talloc_tos(), &auth_reply, status, OID_KERBEROS5); 424 433 data_blob_free(&auth_reply); 425 434 … … 459 468 460 469 if (spnego_wrap) { 461 response = spnego_gen_auth_response( &chal, status, OID_NTLMSSP);470 response = spnego_gen_auth_response(talloc_tos(), &chal, status, OID_NTLMSSP); 462 471 data_blob_free(&chal); 463 472 } else { … … 496 505 blob = data_blob_const(*ppdata, *p_data_size); 497 506 498 status = parse_spnego_mechanisms( blob, &secblob, &kerb_mech);507 status = parse_spnego_mechanisms(talloc_tos(), blob, &secblob, &kerb_mech); 499 508 if (!NT_STATUS_IS_OK(status)) { 500 509 return nt_status_squash(status); … … 506 515 507 516 if (kerb_mech) { 508 SAFE_FREE(kerb_mech);517 TALLOC_FREE(kerb_mech); 509 518 510 519 #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) … … 564 573 565 574 blob = data_blob_const(*ppdata, *p_data_size); 566 if (!spnego_parse_auth( blob, &auth)) {575 if (!spnego_parse_auth(talloc_tos(), blob, &auth)) { 567 576 srv_free_encryption_context(&partial_srv_trans_enc_ctx); 568 577 return NT_STATUS_INVALID_PARAMETER; … … 581 590 */ 582 591 583 response = spnego_gen_auth_response( &auth_reply, status, NULL);592 response = spnego_gen_auth_response(talloc_tos(), &auth_reply, status, NULL); 584 593 data_blob_free(&auth_reply); 585 594 … … 710 719 711 720 if (ec->es->smb_enc_type == SMB_TRANS_ENC_NTLM) { 712 if ((ec->es->s.ntlmssp_state->neg_flags & (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) != 713 (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) { 721 if (!auth_ntlmssp_negotiated_sign((ec->auth_ntlmssp_state))) { 722 return NT_STATUS_INVALID_PARAMETER; 723 } 724 725 if (!auth_ntlmssp_negotiated_seal((ec->auth_ntlmssp_state))) { 714 726 return NT_STATUS_INVALID_PARAMETER; 715 727 }
Note:
See TracChangeset
for help on using the changeset viewer.