mirror of
https://github.com/samba-team/samba.git
synced 2025-02-08 05:57:51 +03:00
libcli/smb: move smb_seal.c to the toplevel
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Oct 21 10:22:39 CEST 2011 on sn-devel-104
This commit is contained in:
parent
321204eaeb
commit
75d146d3ed
@ -28,5 +28,6 @@
|
|||||||
#include "libcli/smb/smb_constants.h"
|
#include "libcli/smb/smb_constants.h"
|
||||||
#include "libcli/smb/smb_util.h"
|
#include "libcli/smb/smb_util.h"
|
||||||
#include "libcli/smb/smb_unix_ext.h"
|
#include "libcli/smb/smb_unix_ext.h"
|
||||||
|
#include "libcli/smb/smb_seal.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
Unix SMB/CIFS implementation.
|
Unix SMB/CIFS implementation.
|
||||||
SMB Transport encryption (sealing) code.
|
SMB Transport encryption (sealing) code.
|
||||||
Copyright (C) Jeremy Allison 2007.
|
Copyright (C) Jeremy Allison 2007.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 3 of the License, or
|
the Free Software Foundation; either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "smb_crypt.h"
|
#include "smb_common.h"
|
||||||
#include "libsmb/libsmb.h"
|
|
||||||
#include "libcli/auth/krb5_wrap.h"
|
#include "libcli/auth/krb5_wrap.h"
|
||||||
#include "auth/gensec/gensec.h"
|
#include "auth/gensec/gensec.h"
|
||||||
|
|
||||||
@ -193,7 +192,7 @@ static NTSTATUS common_gss_decrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
|
|||||||
&in_buf,
|
&in_buf,
|
||||||
&out_buf,
|
&out_buf,
|
||||||
&flags_got, /* did we get sign+seal ? */
|
&flags_got, /* did we get sign+seal ? */
|
||||||
(gss_qop_t *) NULL);
|
(gss_qop_t *) NULL);
|
||||||
|
|
||||||
if (ret != GSS_S_COMPLETE) {
|
if (ret != GSS_S_COMPLETE) {
|
||||||
NTSTATUS status = NT_STATUS_ACCESS_DENIED;
|
NTSTATUS status = NT_STATUS_ACCESS_DENIED;
|
||||||
@ -234,7 +233,7 @@ static NTSTATUS common_gss_decrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
|
|||||||
|
|
||||||
static NTSTATUS common_gss_encrypt_buffer(struct smb_tran_enc_state_gss *gss_state,
|
static NTSTATUS common_gss_encrypt_buffer(struct smb_tran_enc_state_gss *gss_state,
|
||||||
uint16_t enc_ctx_num,
|
uint16_t enc_ctx_num,
|
||||||
char *buf,
|
char *buf,
|
||||||
char **ppbuf_out)
|
char **ppbuf_out)
|
||||||
{
|
{
|
||||||
gss_ctx_id_t gss_ctx = gss_state->gss_ctx;
|
gss_ctx_id_t gss_ctx = gss_state->gss_ctx;
|
||||||
@ -283,7 +282,7 @@ static NTSTATUS common_gss_encrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
|
|||||||
return NT_STATUS_NOT_SUPPORTED;
|
return NT_STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ya see - this is why I *hate* gss-api. I don't
|
/* Ya see - this is why I *hate* gss-api. I don't
|
||||||
* want to have to malloc another buffer of the
|
* want to have to malloc another buffer of the
|
||||||
* same size + 8 bytes just to get a continuous
|
* same size + 8 bytes just to get a continuous
|
||||||
* header + buffer, but gss won't let me pass in
|
* header + buffer, but gss won't let me pass in
|
@ -59,7 +59,7 @@ struct smb_trans_enc_state {
|
|||||||
} s;
|
} s;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The following definitions come from libsmb/smb_seal.c */
|
/* The following definitions come from smb_seal.c */
|
||||||
|
|
||||||
NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16_t *p_enc_ctx_num);
|
NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16_t *p_enc_ctx_num);
|
||||||
bool common_encryption_on(struct smb_trans_enc_state *es);
|
bool common_encryption_on(struct smb_trans_enc_state *es);
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
|
|
||||||
bld.SAMBA_LIBRARY('cli_smb_common',
|
bld.SAMBA_LIBRARY('cli_smb_common',
|
||||||
source='smb2_create_blob.c smb2_signing.c util.c',
|
source='smb_seal.c smb2_create_blob.c smb2_signing.c util.c',
|
||||||
autoproto='smb_common_proto.h',
|
autoproto='smb_common_proto.h',
|
||||||
deps='LIBCRYPTO',
|
deps='LIBCRYPTO errors gssapi gensec KRB5_WRAP',
|
||||||
public_deps='talloc samba-util',
|
public_deps='talloc samba-util',
|
||||||
private_library=True,
|
private_library=True,
|
||||||
public_headers='''smb_common.h smb2_constants.h smb_constants.h
|
public_headers='''smb_common.h smb2_constants.h smb_constants.h
|
||||||
|
smb_seal.h
|
||||||
smb2_create_blob.h smb2_signing.h smb_util.h smb_unix_ext.h
|
smb2_create_blob.h smb2_signing.h smb_util.h smb_unix_ext.h
|
||||||
''',
|
''',
|
||||||
)
|
)
|
||||||
|
@ -602,8 +602,9 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
|
|||||||
libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \
|
libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \
|
||||||
libsmb/clistr.o libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \
|
libsmb/clistr.o libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \
|
||||||
libsmb/clioplock.o libsmb/clirap2.o \
|
libsmb/clioplock.o libsmb/clirap2.o \
|
||||||
libsmb/smb_seal.o libsmb/async_smb.o \
|
libsmb/async_smb.o \
|
||||||
libsmb/read_smb.o libsmb/clisigning.o \
|
libsmb/read_smb.o libsmb/clisigning.o \
|
||||||
|
../libcli/smb/smb_seal.o \
|
||||||
libsmb/smb2cli_base.o \
|
libsmb/smb2cli_base.o \
|
||||||
libsmb/smb2cli_negprot.o \
|
libsmb/smb2cli_negprot.o \
|
||||||
libsmb/smb2cli_session.o \
|
libsmb/smb2cli_session.o \
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "../lib/util/tevent_ntstatus.h"
|
#include "../lib/util/tevent_ntstatus.h"
|
||||||
#include "../lib/util/tevent_unix.h"
|
#include "../lib/util/tevent_unix.h"
|
||||||
#include "async_smb.h"
|
#include "async_smb.h"
|
||||||
#include "smb_crypt.h"
|
#include "../libcli/smb/smb_seal.h"
|
||||||
#include "libsmb/nmblib.h"
|
#include "libsmb/nmblib.h"
|
||||||
#include "read_smb.h"
|
#include "read_smb.h"
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "libsmb/libsmb.h"
|
#include "libsmb/libsmb.h"
|
||||||
#include "../lib/util/tevent_ntstatus.h"
|
#include "../lib/util/tevent_ntstatus.h"
|
||||||
#include "smb_signing.h"
|
#include "smb_signing.h"
|
||||||
#include "smb_crypt.h"
|
#include "../libcli/smb/smb_seal.h"
|
||||||
#include "async_smb.h"
|
#include "async_smb.h"
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "../auth/ntlmssp/ntlmssp.h"
|
#include "../auth/ntlmssp/ntlmssp.h"
|
||||||
#include "../lib/util/tevent_ntstatus.h"
|
#include "../lib/util/tevent_ntstatus.h"
|
||||||
#include "async_smb.h"
|
#include "async_smb.h"
|
||||||
#include "smb_crypt.h"
|
#include "../libcli/smb/smb_seal.h"
|
||||||
#include "trans2.h"
|
#include "trans2.h"
|
||||||
#include "ntlmssp_wrap.h"
|
#include "ntlmssp_wrap.h"
|
||||||
#include "auth/gensec/gensec.h"
|
#include "auth/gensec/gensec.h"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "../libcli/auth/spnego.h"
|
#include "../libcli/auth/spnego.h"
|
||||||
#include "../auth/ntlmssp/ntlmssp.h"
|
#include "../auth/ntlmssp/ntlmssp.h"
|
||||||
#include "ntlmssp_wrap.h"
|
#include "ntlmssp_wrap.h"
|
||||||
#include "smb_crypt.h"
|
#include "../libcli/smb/smb_seal.h"
|
||||||
#include "../lib/util/asn1.h"
|
#include "../lib/util/asn1.h"
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "libsmb/libsmb.h"
|
#include "libsmb/libsmb.h"
|
||||||
|
@ -126,7 +126,7 @@ LIBSMB_SRC = '''libsmb/clientgen.c libsmb/cliconnect.c libsmb/clifile.c
|
|||||||
libsmb/clitrans.c libsmb/clisecdesc.c libsmb/clidgram.c
|
libsmb/clitrans.c libsmb/clisecdesc.c libsmb/clidgram.c
|
||||||
libsmb/clistr.c libsmb/cliquota.c libsmb/clifsinfo.c libsmb/clidfs.c
|
libsmb/clistr.c libsmb/cliquota.c libsmb/clifsinfo.c libsmb/clidfs.c
|
||||||
libsmb/clioplock.c libsmb/clirap2.c
|
libsmb/clioplock.c libsmb/clirap2.c
|
||||||
libsmb/smb_seal.c libsmb/async_smb.c
|
libsmb/async_smb.c
|
||||||
libsmb/read_smb.c libsmb/clisigning.c
|
libsmb/read_smb.c libsmb/clisigning.c
|
||||||
libsmb/smb2cli_base.c
|
libsmb/smb2cli_base.c
|
||||||
libsmb/smb2cli_negprot.c
|
libsmb/smb2cli_negprot.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user