mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
r3462: separate out the crypto includes
(This used to be commit 3f75117db9
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
2df2d1b67f
commit
a1d0b97ed4
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_AUTH
|
||||
|
@ -216,14 +216,9 @@ extern int errno;
|
||||
#include "lib/socket/socket.h"
|
||||
#include "libcli/ldap/ldap.h"
|
||||
#include "nameserv.h"
|
||||
#include "secrets.h"
|
||||
|
||||
#include "byteorder.h"
|
||||
|
||||
#include "md5.h"
|
||||
#include "hmacmd5.h"
|
||||
|
||||
|
||||
#include "module.h"
|
||||
|
||||
#include "asn_1.h"
|
||||
|
@ -36,6 +36,13 @@
|
||||
#define MAX_DGRAM_SIZE (576) /* tcp/ip datagram limit is 576 bytes */
|
||||
#define MIN_DGRAM_SIZE 12
|
||||
|
||||
/* A netbios name structure. */
|
||||
struct nmb_name {
|
||||
char name[17];
|
||||
char scope[64];
|
||||
uint_t name_type;
|
||||
};
|
||||
|
||||
/*********************************************************
|
||||
Types of reply packet.
|
||||
**********************************************************/
|
||||
|
@ -86,14 +86,6 @@ typedef int BOOL;
|
||||
|
||||
#include "smb_macros.h"
|
||||
|
||||
/* A netbios name structure. */
|
||||
struct nmb_name {
|
||||
char name[17];
|
||||
char scope[64];
|
||||
uint_t name_type;
|
||||
};
|
||||
|
||||
|
||||
#include "rpc_secdes.h"
|
||||
|
||||
#include "client.h"
|
||||
|
@ -62,5 +62,6 @@ struct ntlmssp_state;
|
||||
struct auth_methods;
|
||||
struct schannel_state;
|
||||
struct spnego_data;
|
||||
struct gensec_security;
|
||||
typedef NTSTATUS (*gensec_password_callback)(struct gensec_security *gensec_security, TALLOC_CTX *mem_ctx,
|
||||
char **password);
|
||||
|
@ -2,4 +2,6 @@ dnl # LIB BASIC subsystem
|
||||
|
||||
SMB_SUBSYSTEM_MK(LIBREPLACE,lib/basic.mk)
|
||||
SMB_SUBSYSTEM_MK(LIBNETIF,lib/basic.mk)
|
||||
SMB_SUBSYSTEM_NOPROTO(LIBCRYPTO)
|
||||
SMB_SUBSYSTEM_MK(LIBCRYPTO,lib/basic.mk)
|
||||
SMB_SUBSYSTEM_MK(LIBBASIC,lib/basic.mk)
|
||||
|
@ -19,6 +19,19 @@ ADD_OBJ_FILES = \
|
||||
# End SUBSYSTEM LIBNETIF
|
||||
##############################
|
||||
|
||||
##############################
|
||||
# Start SUBSYSTEM LIBCRYPTO
|
||||
[SUBSYSTEM::LIBCRYPTO]
|
||||
INIT_OBJ_FILES = \
|
||||
lib/crypto/crc32.o
|
||||
ADD_OBJ_FILES = \
|
||||
lib/crypto/md5.o \
|
||||
lib/crypto/hmacmd5.o \
|
||||
lib/crypto/md4.o
|
||||
# End SUBSYSTEM LIBCRYPTO
|
||||
##############################
|
||||
|
||||
|
||||
##############################
|
||||
# Start SUBSYSTEM LIBBASIC
|
||||
[SUBSYSTEM::LIBBASIC]
|
||||
@ -57,14 +70,10 @@ ADD_OBJ_FILES = \
|
||||
lib/module.o \
|
||||
lib/mutex.o \
|
||||
lib/events.o \
|
||||
lib/crypto/crc32.o \
|
||||
lib/crypto/md5.o \
|
||||
lib/crypto/hmacmd5.o \
|
||||
lib/crypto/md4.o \
|
||||
lib/db_wrap.o \
|
||||
lib/server_mutex.o \
|
||||
lib/idtree.o
|
||||
REQUIRED_SUBSYSTEMS = \
|
||||
LIBTDB CHARSET LIBREPLACE LIBNETIF
|
||||
LIBTDB CHARSET LIBREPLACE LIBNETIF LIBCRYPTO
|
||||
# End SUBSYSTEM LIBBASIC
|
||||
##############################
|
||||
|
2
source4/lib/crypto/crc32.h
Normal file
2
source4/lib/crypto/crc32.h
Normal file
@ -0,0 +1,2 @@
|
||||
uint32_t crc32_calc_buffer( const char *buffer, uint32_t count);
|
||||
|
24
source4/lib/crypto/crypto.h
Normal file
24
source4/lib/crypto/crypto.h
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
|
||||
Copyright (C) Andrew Tridgell 2004
|
||||
|
||||
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
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "lib/crypto/md5.h"
|
||||
#include "lib/crypto/md4.h"
|
||||
#include "lib/crypto/hmacmd5.h"
|
||||
#include "lib/crypto/crc32.h"
|
@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/***********************************************************************
|
||||
the rfc 2104 version of hmac_md5 initialisation.
|
||||
|
@ -29,4 +29,11 @@ typedef struct
|
||||
|
||||
} HMACMD5Context;
|
||||
|
||||
void hmac_md5_init_limK_to_64(const uint8_t *key, int key_len,
|
||||
HMACMD5Context *ctx);
|
||||
void hmac_md5_update(const uint8_t *text, int text_len, HMACMD5Context *ctx);
|
||||
void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx);
|
||||
void hmac_md5(const uint8_t key[16], const uint8_t *data, int data_len, uint8_t *digest);
|
||||
void hmac_md5_init_rfc2104(const uint8_t *key, int key_len, HMACMD5Context *ctx);
|
||||
|
||||
#endif /* _HMAC_MD5_H */
|
1
source4/lib/crypto/md4.h
Normal file
1
source4/lib/crypto/md4.h
Normal file
@ -0,0 +1 @@
|
||||
void mdfour(uint8_t *out, const uint8_t *in, int n);
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "system/iconv.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
static unsigned char hash[258];
|
||||
static uint32 counter;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/time.h"
|
||||
#include "auth/auth.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/*
|
||||
initialise the credentials state for old-style 64 bit session keys
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "auth/auth.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
|
||||
TALLOC_CTX *out_mem_ctx,
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "auth/auth.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
#define CLI_SIGN "session key to client-to-server signing key magic constant"
|
||||
#define CLI_SEAL "session key to client-to-server sealing key magic constant"
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
struct schannel_state {
|
||||
uint8_t session_key[16];
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "libcli/raw/libcliraw.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/***********************************************************
|
||||
SMB signing - Common code before we set a new signing implementation
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/time.h"
|
||||
#include "auth/auth.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/*
|
||||
This implements the X/Open SMB password encryption
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/ndr_samr.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/*
|
||||
* do a password change using DCERPC/SAMR calls
|
||||
|
@ -23,6 +23,7 @@
|
||||
such as the local SID and machine trust password */
|
||||
|
||||
#include "includes.h"
|
||||
#include "secrets.h"
|
||||
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_PASSDB
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "rpc_server/common/common.h"
|
||||
#include "rpc_server/samr/dcesrv_samr.h"
|
||||
#include "system/time.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
/*
|
||||
samr_ChangePasswordUser
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa.h"
|
||||
#include "librpc/gen_ndr/ndr_samr.h"
|
||||
#include "lib/crypto/crypto.h"
|
||||
|
||||
#define TEST_ACCOUNT_NAME "samrtorturetest"
|
||||
#define TEST_ALIASNAME "samrtorturetestalias"
|
||||
|
Reference in New Issue
Block a user