1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r890: convert samba4 to use [u]int8_t instead of [u]int8

metze
(This used to be commit 2986c5f08c)
This commit is contained in:
Stefan Metzmacher 2004-05-25 17:50:17 +00:00 committed by Gerald (Jerry) Carter
parent f88bf54c7f
commit fcd718c7d8
65 changed files with 186 additions and 180 deletions

View File

@ -28,7 +28,7 @@
Returns a const char of length 8 bytes.
****************************************************************************/
static const uint8 *get_ntlm_challenge(struct auth_context *auth_context)
static const uint8_t *get_ntlm_challenge(struct auth_context *auth_context)
{
DATA_BLOB challenge = data_blob(NULL, 0);
const char *challenge_set_by = NULL;

View File

@ -90,7 +90,7 @@ struct auth_context {
struct auth_methods *auth_method_list;
TALLOC_CTX *mem_ctx;
const uint8 *(*get_ntlm_challenge)(struct auth_context *auth_context);
const uint8_t *(*get_ntlm_challenge)(struct auth_context *auth_context);
NTSTATUS (*check_ntlm_password)(const struct auth_context *auth_context,
const struct auth_usersupplied_info *user_info,
struct auth_serversupplied_info **server_info);

View File

@ -28,7 +28,7 @@
* @return an 8 byte random challenge
*/
static const uint8 *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state)
static const uint8_t *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state)
{
AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
return auth_ntlmssp_state->auth_context->get_ntlm_challenge(auth_ntlmssp_state->auth_context);

View File

@ -33,7 +33,7 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context,
TALLOC_CTX *mem_ctx,
const char *username,
uint16_t acct_flags,
const uint8 lm_pw[16], const uint8 nt_pw[16],
const uint8_t lm_pw[16], const uint8_t nt_pw[16],
const auth_usersupplied_info *user_info,
DATA_BLOB *user_sess_key,
DATA_BLOB *lm_sess_key)
@ -188,7 +188,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
NTSTATUS nt_status;
DATA_BLOB user_sess_key = data_blob(NULL, 0);
DATA_BLOB lm_sess_key = data_blob(NULL, 0);
uint8 *lm_pwd, *nt_pwd;
uint8_t *lm_pwd, *nt_pwd;
const char *attrs[] = {"unicodePwd", "lmPwdHash", "ntPwdHash",
"userAccountControl",

View File

@ -299,7 +299,7 @@ BOOL make_user_info_netlogon_interactive(auth_usersupplied_info **user_info,
BOOL make_user_info_for_reply(auth_usersupplied_info **user_info,
const char *smb_name,
const char *client_domain,
const uint8 chal[8],
const uint8_t chal[8],
DATA_BLOB plaintext_password)
{

View File

@ -28,7 +28,7 @@
static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
{
uint8 *info3_ndr;
uint8_t *info3_ndr;
size_t len = response->length - sizeof(response);
prs_struct ps;
if (len > 0) {

View File

@ -364,6 +364,8 @@ AC_CHECK_TYPE(offset_t,loff_t)
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(wchar_t, unsigned short)
AC_CHECK_TYPE(uint_t, unsigned int)
AC_CHECK_TYPE(int8_t, signed char)
AC_CHECK_TYPE(uint8_t, unsigned char)
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(uint16_t, unsigned short)
AC_CHECK_TYPE(int32_t, long)

View File

@ -28,7 +28,7 @@ struct nesting {
};
typedef struct {
uint8 *data;
uint8_t *data;
size_t length;
off_t ofs;
struct nesting *nesting;

View File

@ -142,7 +142,7 @@ struct cli_transport {
enum {ETYPE_NONE, ETYPE_DOS, ETYPE_NT, ETYPE_SOCKET, ETYPE_NBT} etype;
union {
struct {
uint8 eclass;
uint8_t eclass;
uint16_t ecode;
} dos;
NTSTATUS nt_status;
@ -154,7 +154,7 @@ struct cli_transport {
struct {
/* a oplock break request handler */
BOOL (*handler)(struct cli_transport *transport,
uint16_t tid, uint16_t fnum, uint8 level, void *private);
uint16_t tid, uint16_t fnum, uint8_t level, void *private);
/* private data passed to the oplock handler */
void *private;
} oplock;

View File

@ -453,8 +453,12 @@ typedef int socklen_t;
as signed and unsigned int will work.
*/
#ifndef uint8
#define uint8 unsigned char
#if !defined(int8)
#define int8 int8_t
#endif
#if !defined(uint8)
#define uint8 uint8_t
#endif
#if !defined(int16)

View File

@ -50,7 +50,7 @@
/* structure for storing machine account password
(ie. when samba server is member of a domain */
struct machine_acct_pass {
uint8 hash[16];
uint8_t hash[16];
time_t mod_time;
};

View File

@ -269,7 +269,7 @@ typedef struct time_info
/* used to hold an arbitrary blob of data */
typedef struct data_blob {
uint8 *data;
uint8_t *data;
size_t length;
void (*free)(struct data_blob *data_blob);
} DATA_BLOB;

View File

@ -357,7 +357,7 @@ union smb_fileinfo {
uint32_t ea_size;
uint_t num_eas;
struct ea_struct {
uint8 flags;
uint8_t flags;
WIRE_STRING name;
DATA_BLOB value;
} *eas;
@ -371,13 +371,13 @@ union smb_fileinfo {
uint32_t nlink;
WIRE_STRING fname;
WIRE_STRING alt_fname;
uint8 delete_pending;
uint8 directory;
uint8_t delete_pending;
uint8_t directory;
uint64_t compressed_size;
uint16_t format;
uint8 unit_shift;
uint8 chunk_shift;
uint8 cluster_shift;
uint8_t unit_shift;
uint8_t chunk_shift;
uint8_t cluster_shift;
uint64_t file_id;
uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
uint64_t position;
@ -535,8 +535,8 @@ union smb_fileinfo {
uint64_t alloc_size;
uint64_t size;
uint32_t nlink;
uint8 delete_pending;
uint8 directory;
uint8_t delete_pending;
uint8_t directory;
uint32_t ea_size;
WIRE_STRING fname;
} out;
@ -571,9 +571,9 @@ union smb_fileinfo {
struct {
uint64_t compressed_size;
uint16_t format;
uint8 unit_shift;
uint8 chunk_shift;
uint8 cluster_shift;
uint8_t unit_shift;
uint8_t chunk_shift;
uint8_t cluster_shift;
} out;
} compression_info;
@ -831,7 +831,7 @@ union smb_setfileinfo {
union setfileinfo_file file;
struct {
uint8 overwrite;
uint8_t overwrite;
uint32_t root_fid;
const char *new_name;
} in;
@ -1092,12 +1092,12 @@ union smb_open {
uint32_t open_disposition;
uint32_t create_options;
uint32_t impersonation;
uint8 security_flags;
uint8_t security_flags;
const char *fname;
} in;
struct {
uint8 oplock_level;
uint8_t oplock_level;
uint16_t fnum;
uint32_t create_action;
NTTIME create_time;
@ -1109,7 +1109,7 @@ union smb_open {
uint64_t size;
uint16_t file_type;
uint16_t ipc_state;
uint8 is_directory;
uint8_t is_directory;
} out;
} ntcreatex, generic;
@ -1551,7 +1551,7 @@ union smb_lpq {
uint16_t restart_idx;
struct {
time_t time;
uint8 status;
uint8_t status;
uint16_t job;
uint32_t size;
char *user;
@ -1592,7 +1592,7 @@ union smb_ioctl {
uint32_t function;
uint16_t fnum;
BOOL fsctl;
uint8 filter;
uint8_t filter;
} in;
struct {
DATA_BLOB blob;
@ -1628,10 +1628,10 @@ struct smb_trans2 {
struct {
uint16_t max_param;
uint16_t max_data;
uint8 max_setup;
uint8_t max_setup;
uint16_t flags;
uint32_t timeout;
uint8 setup_count;
uint8_t setup_count;
uint16_t *setup;
const char *trans_name; /* SMBtrans only */
DATA_BLOB params;
@ -1639,7 +1639,7 @@ struct smb_trans2 {
} in;
struct {
uint8 setup_count;
uint8_t setup_count;
uint16_t *setup;
DATA_BLOB params;
DATA_BLOB data;
@ -1649,7 +1649,7 @@ struct smb_trans2 {
/* struct for nttransact2 call */
struct smb_nttrans {
struct {
uint8 max_setup;
uint8_t max_setup;
uint32_t max_param;
uint32_t max_data;
uint32_t setup_count;
@ -1660,7 +1660,7 @@ struct smb_nttrans {
} in;
struct {
uint8 setup_count;
uint8_t setup_count;
uint16_t *setup;
DATA_BLOB params;
DATA_BLOB data;

View File

@ -105,7 +105,7 @@ WERROR reg_key_get_subkey_val(REG_KEY *key, const char *subname, const char *val
return reg_key_get_value_by_name(k, valname, val);
}
WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32_t type, uint8 *data, int real_len)
WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32_t type, uint8_t *data, int real_len)
{
REG_KEY *k;
REG_VAL *v;

View File

@ -427,7 +427,7 @@ BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32_t *ol
size_t tdb_pack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
{
va_list ap;
uint8 bt;
uint8_t bt;
uint16_t w;
uint32_t d;
int i;
@ -445,7 +445,7 @@ size_t tdb_pack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
switch ((c = *fmt++)) {
case 'b': /* unsigned 8-bit integer */
len = 1;
bt = (uint8)va_arg(ap, int);
bt = (uint8_t)va_arg(ap, int);
if (bufsize && bufsize >= len)
SSVAL(buf, 0, bt);
break;
@ -521,7 +521,7 @@ size_t tdb_pack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
{
va_list ap;
uint8 *bt;
uint8_t *bt;
uint16_t *w;
uint32_t *d;
int len;
@ -539,7 +539,7 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
switch ((c=*fmt++)) {
case 'b':
len = 1;
bt = va_arg(ap, uint8 *);
bt = va_arg(ap, uint8_t *);
if (bufsize < len)
goto no_space;
*bt = SVAL(buf, 0);

View File

@ -243,7 +243,7 @@ static void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *
create a unix date (int GMT) from a dos date (which is actually in
localtime)
********************************************************************/
time_t pull_dos_date(const uint8 *date_ptr, int zone_offset)
time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset)
{
uint32_t dos_date=0;
struct tm t;
@ -267,7 +267,7 @@ time_t pull_dos_date(const uint8 *date_ptr, int zone_offset)
/*******************************************************************
like make_unix_date() but the words are reversed
********************************************************************/
time_t pull_dos_date2(const uint8 *date_ptr, int zone_offset)
time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset)
{
uint32_t x,x2;
@ -282,7 +282,7 @@ time_t pull_dos_date2(const uint8 *date_ptr, int zone_offset)
create a unix GMT date from a dos date in 32 bit "unix like" format
these generally arrive as localtimes, with corresponding DST
******************************************************************/
time_t pull_dos_date3(const uint8 *date_ptr, int zone_offset)
time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset)
{
time_t t = (time_t)IVAL(date_ptr,0);
if (!null_mtime(t)) {

View File

@ -309,7 +309,7 @@ char *sid_binstring(const struct dom_sid *sid)
/*******************************************************************
Check if ACE has OBJECT type.
********************************************************************/
BOOL sec_ace_object(uint8 type)
BOOL sec_ace_object(uint8_t type)
{
if (type == SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ||
type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||

View File

@ -25,7 +25,7 @@
at startup either via mmap() or read() from the lib directory */
static smb_ucs2_t *upcase_table;
static smb_ucs2_t *lowcase_table;
static uint8 *valid_table;
static uint8_t *valid_table;
/*******************************************************************
@ -116,7 +116,7 @@ void init_valid_table(void)
static int mapped_file;
int i;
const char *allowed = ".!#$%&'()_-@^`~";
uint8 *valid_file;
uint8_t *valid_file;
TALLOC_CTX *mem_ctx;
if (mapped_file) {

View File

@ -1110,7 +1110,7 @@ struct uuid {
uint32_t i1;
uint16_t i2;
uint16_t i3;
uint8 s[8];
uint8_t s[8];
};
static void dump_guid(const char *field, struct berval **values)

View File

@ -31,8 +31,8 @@ static ADS_STATUS ads_sasl_spnego_ntlmssp_bind(ADS_STRUCT *ads)
const char *mechs[] = {OID_NTLMSSP, NULL};
DATA_BLOB msg1;
DATA_BLOB blob, chal1, chal2, auth;
uint8 challenge[8];
uint8 nthash[24], lmhash[24], sess_key[16];
uint8_t challenge[8];
uint8_t nthash[24], lmhash[24], sess_key[16];
uint32_t neg_flags;
struct berval cred, *scred;
ADS_STATUS status;
@ -245,7 +245,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
struct berval *scred;
int i=0;
int gss_rc, rc;
uint8 *p;
uint8_t *p;
uint32_t max_msg_size;
char *sname;
unsigned sec_layer;
@ -343,7 +343,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
gss_release_buffer(&minor_status, &input_token);
p = (uint8 *)output_token.value;
p = (uint8_t *)output_token.value;
file_save("sasl_gssapi.dat", output_token.value, output_token.length);

View File

@ -31,11 +31,11 @@
static void creds_init(struct creds_CredentialState *creds,
const struct netr_Credential *client_challenge,
const struct netr_Credential *server_challenge,
const uint8 machine_password[16])
const uint8_t machine_password[16])
{
struct netr_Credential time_cred;
uint32_t sum[2];
uint8 sum2[8];
uint8_t sum2[8];
dump_data_pw("Client chall", client_challenge->data, sizeof(client_challenge->data));
dump_data_pw("Server chall", server_challenge->data, sizeof(server_challenge->data));
@ -144,7 +144,7 @@ next comes the client specific functions
void creds_client_init(struct creds_CredentialState *creds,
const struct netr_Credential *client_challenge,
const struct netr_Credential *server_challenge,
const uint8 machine_password[16],
const uint8_t machine_password[16],
struct netr_Credential *initial_credential)
{
creds->sequence = time(NULL);
@ -197,7 +197,7 @@ next comes the server specific functions
void creds_server_init(struct creds_CredentialState *creds,
const struct netr_Credential *client_challenge,
const struct netr_Credential *server_challenge,
const uint8 machine_password[16],
const uint8_t machine_password[16],
struct netr_Credential *initial_credential)
{
creds_init(creds, client_challenge, server_challenge, machine_password);

View File

@ -21,7 +21,7 @@
*/
struct creds_CredentialState {
uint8 session_key[8];
uint8_t session_key[8];
uint32_t sequence;
struct netr_Credential seed;
struct netr_Credential client;

View File

@ -174,7 +174,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
const char *username,
const char *client_username,
const char *client_domain,
const uint8 *lm_pw, const uint8 *nt_pw,
const uint8_t *lm_pw, const uint8_t *nt_pw,
DATA_BLOB *user_sess_key,
DATA_BLOB *lm_sess_key)
{
@ -326,7 +326,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
so use it only if we otherwise allow LM authentication */
if (lp_lanman_auth() && lm_pw) {
uint8 first_8_lm_hash[16];
uint8_t first_8_lm_hash[16];
memcpy(first_8_lm_hash, lm_pw, 8);
memset(first_8_lm_hash + 8, '\0', 8);
*lm_sess_key = data_blob(first_8_lm_hash, 16);
@ -367,7 +367,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
if (smb_pwd_check_ntlmv1(lm_response,
lm_pw, challenge,
NULL)) {
uint8 first_8_lm_hash[16];
uint8_t first_8_lm_hash[16];
memcpy(first_8_lm_hash, lm_pw, 8);
memset(first_8_lm_hash + 8, '\0', 8);
*user_sess_key = data_blob(first_8_lm_hash, 16);
@ -427,7 +427,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
allow LM authentication */
if (lp_lanman_auth() && lm_pw) {
uint8 first_8_lm_hash[16];
uint8_t first_8_lm_hash[16];
memcpy(first_8_lm_hash, lm_pw, 8);
memset(first_8_lm_hash + 8, '\0', 8);
*user_sess_key = data_blob(first_8_lm_hash, 16);

View File

@ -105,7 +105,7 @@ void debug_ntlmssp_flags(uint32_t neg_flags)
*
*/
static const uint8 *get_challenge(const struct ntlmssp_state *ntlmssp_state)
static const uint8_t *get_challenge(const struct ntlmssp_state *ntlmssp_state)
{
static uchar chal[8];
generate_random_buffer(chal, sizeof(chal), False);
@ -430,7 +430,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
uint32_t neg_flags = 0;
uint32_t ntlmssp_command, chal_flags;
char *cliname=NULL, *domname=NULL;
const uint8 *cryptkey;
const uint8_t *cryptkey;
const char *target_name;
/* parse the NTLMSSP packet */
@ -1184,7 +1184,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
the password-derived key */
if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCH) {
/* Make up a new session key */
uint8 client_session_key[16];
uint8_t client_session_key[16];
generate_random_buffer(client_session_key, sizeof(client_session_key), False);
/* Encrypt the new session key with the old one */

View File

@ -121,7 +121,7 @@ typedef struct ntlmssp_state
* @return 8 bytes of challnege data, determined by the server to be the challenge for NTLM authentication
*
*/
const uint8 *(*get_challenge)(const struct ntlmssp_state *ntlmssp_state);
const uint8_t *(*get_challenge)(const struct ntlmssp_state *ntlmssp_state);
/**
* Callback to find if the challenge used by NTLM authentication may be modified

View File

@ -46,7 +46,7 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
int i, n;
va_list ap;
char *s;
uint8 *b;
uint8_t *b;
int head_size=0, data_size=0;
int head_ofs, data_ofs;
@ -70,12 +70,12 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
data_size += (str_charnum(s) * 2) + 4;
break;
case 'B':
b = va_arg(ap, uint8 *);
b = va_arg(ap, uint8_t *);
head_size += 8;
data_size += va_arg(ap, int);
break;
case 'b':
b = va_arg(ap, uint8 *);
b = va_arg(ap, uint8_t *);
head_size += va_arg(ap, int);
break;
case 'd':
@ -131,7 +131,7 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
break;
case 'B':
b = va_arg(ap, uint8 *);
b = va_arg(ap, uint8_t *);
n = va_arg(ap, int);
SSVAL(blob->data, head_ofs, n); head_ofs += 2;
SSVAL(blob->data, head_ofs, n); head_ofs += 2;
@ -145,7 +145,7 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
SIVAL(blob->data, head_ofs, n); head_ofs += 4;
break;
case 'b':
b = va_arg(ap, uint8 *);
b = va_arg(ap, uint8_t *);
n = va_arg(ap, int);
memcpy(blob->data + head_ofs, b, n);
head_ofs += n;
@ -216,7 +216,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
/* if odd length and unicode */
return False;
}
if (blob->data + ptr < (uint8 *)ptr || blob->data + ptr < blob->data)
if (blob->data + ptr < (uint8_t *)ptr || blob->data + ptr < blob->data)
return False;
if (0 < len1) {
@ -247,7 +247,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
return False;
}
if (blob->data + ptr < (uint8 *)ptr || blob->data + ptr < blob->data)
if (blob->data + ptr < (uint8_t *)ptr || blob->data + ptr < blob->data)
return False;
if (0 < len1) {
@ -278,7 +278,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
return False;
}
if (blob->data + ptr < (uint8 *)ptr || blob->data + ptr < blob->data)
if (blob->data + ptr < (uint8_t *)ptr || blob->data + ptr < blob->data)
return False;
*b = data_blob_talloc(mem_ctx, blob->data + ptr, len1);
@ -289,7 +289,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
len1 = va_arg(ap, unsigned);
/* make sure its in the right format - be strict */
NEED_DATA(len1);
if (blob->data + head_ofs < (uint8 *)head_ofs || blob->data + head_ofs < blob->data)
if (blob->data + head_ofs < (uint8_t *)head_ofs || blob->data + head_ofs < blob->data)
return False;
*b = data_blob_talloc(mem_ctx, blob->data + head_ofs, len1);
@ -303,7 +303,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
case 'C':
s = va_arg(ap, char *);
if (blob->data + head_ofs < (uint8 *)head_ofs || blob->data + head_ofs < blob->data)
if (blob->data + head_ofs < (uint8_t *)head_ofs || blob->data + head_ofs < blob->data)
return False;
head_ofs += pull_string(NULL, p, blob->data+head_ofs, sizeof(p),

View File

@ -286,7 +286,7 @@ void schannel_end(struct schannel_state **state)
create an schannel context state
*/
NTSTATUS schannel_start(struct schannel_state **state,
uint8 session_key[16],
uint8_t session_key[16],
BOOL initiator)
{
TALLOC_CTX *mem_ctx;

View File

@ -24,7 +24,7 @@
struct schannel_state {
TALLOC_CTX *mem_ctx;
uint8 session_key[16];
uint8_t session_key[16];
uint32_t seq_num;
BOOL initiator;
DATA_BLOB signature;

View File

@ -37,7 +37,7 @@ void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const DATA_BLOB *sessi
for (i=0,k=0;
i<in->length;
i += 8, k += 7) {
uint8 bin[8], bout[8], key[7];
uint8_t bin[8], bout[8], key[7];
memset(bin, 0, 8);
memcpy(bin, &in->data[i], MIN(8, in->length-i));

View File

@ -227,7 +227,7 @@ int cli_nt_create_full(struct cli_tree *tree, const char *fname,
uint32_t CreatFlags, uint32_t DesiredAccess,
uint32_t FileAttributes, uint32_t ShareAccess,
uint32_t CreateDisposition, uint32_t CreateOptions,
uint8 SecurityFlags)
uint8_t SecurityFlags)
{
union smb_open open_parms;
TALLOC_CTX *mem_ctx;

View File

@ -26,7 +26,7 @@
generate a negTokenInit packet given a GUID, a list of supported
OIDs (the mechanisms) and a principal name string
*/
DATA_BLOB spnego_gen_negTokenInit(uint8 guid[16],
DATA_BLOB spnego_gen_negTokenInit(uint8_t guid[16],
const char *OIDs[],
const char *principal)
{
@ -260,7 +260,7 @@ BOOL parse_negTokenTarg(DATA_BLOB blob, char *OIDs[ASN1_MAX_OIDS], DATA_BLOB *se
/*
generate a krb5 GSS-API wrapper packet given a ticket
*/
DATA_BLOB spnego_gen_krb5_wrap(DATA_BLOB ticket, const uint8 tok_id[2])
DATA_BLOB spnego_gen_krb5_wrap(DATA_BLOB ticket, const uint8_t tok_id[2])
{
ASN1_DATA data;
DATA_BLOB ret;
@ -288,7 +288,7 @@ DATA_BLOB spnego_gen_krb5_wrap(DATA_BLOB ticket, const uint8 tok_id[2])
/*
parse a krb5 GSS-API wrapper packet giving a ticket
*/
BOOL spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket, uint8 tok_id[2])
BOOL spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket, uint8_t tok_id[2])
{
BOOL ret;
ASN1_DATA data;
@ -453,7 +453,7 @@ DATA_BLOB spnego_gen_auth_response(DATA_BLOB *reply, NTSTATUS nt_status,
{
ASN1_DATA data;
DATA_BLOB ret;
uint8 negResult;
uint8_t negResult;
if (NT_STATUS_IS_OK(nt_status)) {
negResult = SPNEGO_NEG_RESULT_ACCEPT;
@ -496,7 +496,7 @@ BOOL spnego_parse_auth_response(DATA_BLOB blob, NTSTATUS nt_status,
DATA_BLOB *auth)
{
ASN1_DATA data;
uint8 negResult;
uint8_t negResult;
if (NT_STATUS_IS_OK(nt_status)) {
negResult = SPNEGO_NEG_RESULT_ACCEPT;

View File

@ -27,7 +27,7 @@ struct cli_request *smb_raw_query_secdesc_send(struct cli_tree *tree,
struct smb_query_secdesc *query)
{
struct smb_nttrans nt;
uint8 params[8];
uint8_t params[8];
nt.in.max_setup = 0;
nt.in.max_param = 4;
@ -108,7 +108,7 @@ struct cli_request *smb_raw_set_secdesc_send(struct cli_tree *tree,
struct smb_set_secdesc *set)
{
struct smb_nttrans nt;
uint8 params[8];
uint8_t params[8];
struct ndr_push *ndr;
struct cli_request *req;
NTSTATUS status;

View File

@ -27,7 +27,7 @@ put a dos date into a buffer (time/date format)
This takes GMT time and puts local time for zone_offset in the buffer
********************************************************************/
void raw_push_dos_date(struct cli_transport *transport,
uint8 *buf, int offset, time_t unixdate)
uint8_t *buf, int offset, time_t unixdate)
{
push_dos_date(buf, offset, unixdate, transport->negotiate.server_zone);
}
@ -56,7 +56,7 @@ void raw_push_dos_date3(struct cli_transport *transport,
convert a dos date
********************************************************************/
time_t raw_pull_dos_date(struct cli_transport *transport,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date(date_ptr, transport->negotiate.server_zone);
}
@ -65,7 +65,7 @@ time_t raw_pull_dos_date(struct cli_transport *transport,
like raw_pull_dos_date() but the words are reversed
********************************************************************/
time_t raw_pull_dos_date2(struct cli_transport *transport,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date2(date_ptr, transport->negotiate.server_zone);
}
@ -75,7 +75,7 @@ time_t raw_pull_dos_date2(struct cli_transport *transport,
these arrive in server zone, with corresponding DST
******************************************************************/
time_t raw_pull_dos_date3(struct cli_transport *transport,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date3(date_ptr, transport->negotiate.server_zone);
}

View File

@ -68,7 +68,7 @@ uint_t ea_pull_struct(const DATA_BLOB *blob,
TALLOC_CTX *mem_ctx,
struct ea_struct *ea)
{
uint8 nlen;
uint8_t nlen;
uint16_t vlen;
if (blob->length < 6) {

View File

@ -103,7 +103,7 @@ struct cli_request *cli_request_setup_nonsmb(struct cli_transport *transport, ui
setup a SMB packet at transport level
*/
struct cli_request *cli_request_setup_transport(struct cli_transport *transport,
uint8 command, unsigned wct, unsigned buflen)
uint8_t command, unsigned wct, unsigned buflen)
{
struct cli_request *req;
@ -149,7 +149,7 @@ struct cli_request *cli_request_setup_transport(struct cli_transport *transport,
way. This interface is used before a session is setup.
*/
struct cli_request *cli_request_setup_session(struct cli_session *session,
uint8 command, unsigned wct, unsigned buflen)
uint8_t command, unsigned wct, unsigned buflen)
{
struct cli_request *req;
uint16_t flags2;
@ -189,7 +189,7 @@ struct cli_request *cli_request_setup_session(struct cli_session *session,
setup a request for tree based commands
*/
struct cli_request *cli_request_setup(struct cli_tree *tree,
uint8 command,
uint8_t command,
unsigned wct, unsigned buflen)
{
struct cli_request *req;
@ -343,7 +343,7 @@ static BOOL handle_oplock_break(struct cli_transport *transport, uint_t len, con
if (transport->oplock.handler) {
uint16_t tid = SVAL(hdr, HDR_TID);
uint16_t fnum = SVAL(vwv,VWV(2));
uint8 level = CVAL(vwv,VWV(3)+1);
uint8_t level = CVAL(vwv,VWV(3)+1);
transport->oplock.handler(transport, tid, fnum, level, transport->oplock.private);
}
@ -599,7 +599,7 @@ size_t cli_req_append_string_len(struct cli_request *req, const char *str, unsig
size_t cli_req_append_ascii4(struct cli_request *req, const char *str, unsigned flags)
{
size_t size;
cli_req_append_bytes(req, (const uint8 *)"\4", 1);
cli_req_append_bytes(req, (const uint8_t *)"\4", 1);
size = cli_req_append_string(req, str, flags);
return size + 1;
}
@ -623,7 +623,7 @@ size_t cli_req_append_blob(struct cli_request *req, const DATA_BLOB *blob)
append raw bytes into the data portion of the request packet
return the number of bytes added
*/
size_t cli_req_append_bytes(struct cli_request *req, const uint8 *bytes, size_t byte_len)
size_t cli_req_append_bytes(struct cli_request *req, const uint8_t *bytes, size_t byte_len)
{
cli_req_grow_allocation(req, byte_len + req->out.data_size);
memcpy(req->out.data + req->out.data_size, bytes, byte_len);
@ -635,7 +635,7 @@ size_t cli_req_append_bytes(struct cli_request *req, const uint8 *bytes, size_t
append variable block (type 5 buffer) into the data portion of the request packet
return the number of bytes added
*/
size_t cli_req_append_var_block(struct cli_request *req, const uint8 *bytes, uint16_t byte_len)
size_t cli_req_append_var_block(struct cli_request *req, const uint8_t *bytes, uint16_t byte_len)
{
cli_req_grow_allocation(req, byte_len + 3 + req->out.data_size);
SCVAL(req->out.data + req->out.data_size, 0, 5);

View File

@ -206,7 +206,7 @@ NTSTATUS smb_raw_trans_recv(struct cli_request *req,
****************************************************************************/
struct cli_request *smb_raw_trans_send_backend(struct cli_tree *tree,
struct smb_trans2 *parms,
uint8 command)
uint8_t command)
{
int wct = 14 + parms->in.setup_count;
struct cli_request *req;

View File

@ -31,7 +31,7 @@ BOOL asn1_write(ASN1_DATA *data, const void *p, int len)
{
if (data->has_error) return False;
if (data->length < data->ofs+len) {
uint8 *newp;
uint8_t *newp;
newp = Realloc(data->data, data->ofs+len);
if (!newp) {
SAFE_FREE(data->data);
@ -46,14 +46,14 @@ BOOL asn1_write(ASN1_DATA *data, const void *p, int len)
return True;
}
/* useful fn for writing a uint8 */
BOOL asn1_write_uint8(ASN1_DATA *data, uint8 v)
/* useful fn for writing a uint8_t */
BOOL asn1_write_uint8(ASN1_DATA *data, uint8_t v)
{
return asn1_write(data, &v, 1);
}
/* push a tag onto the asn1 data buffer. Used for nested structures */
BOOL asn1_push_tag(ASN1_DATA *data, uint8 tag)
BOOL asn1_push_tag(ASN1_DATA *data, uint8_t tag)
{
struct nesting *nesting;
@ -187,7 +187,7 @@ BOOL asn1_write_BOOLEAN2(ASN1_DATA *data, BOOL v)
/* check a BOOLEAN */
BOOL asn1_check_BOOLEAN(ASN1_DATA *data, BOOL v)
{
uint8 b = 0;
uint8_t b = 0;
asn1_read_uint8(data, &b);
if (b != ASN1_BOOLEAN) {
@ -228,16 +228,16 @@ BOOL asn1_read(ASN1_DATA *data, void *p, int len)
return True;
}
/* read a uint8 from a ASN1 buffer */
BOOL asn1_read_uint8(ASN1_DATA *data, uint8 *v)
/* read a uint8_t from a ASN1 buffer */
BOOL asn1_read_uint8(ASN1_DATA *data, uint8_t *v)
{
return asn1_read(data, v, 1);
}
/* start reading a nested asn1 structure */
BOOL asn1_start_tag(ASN1_DATA *data, uint8 tag)
BOOL asn1_start_tag(ASN1_DATA *data, uint8_t tag)
{
uint8 b;
uint8_t b;
struct nesting *nesting;
if (!asn1_read_uint8(data, &b))
@ -314,7 +314,7 @@ int asn1_tag_remaining(ASN1_DATA *data)
/* read an object ID from a ASN1 buffer */
BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
{
uint8 b;
uint8_t b;
pstring aoid;
fstring el;
@ -392,7 +392,7 @@ BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob)
/* read an interger */
BOOL asn1_read_Integer(ASN1_DATA *data, int *i)
{
uint8 b;
uint8_t b;
*i = 0;
if (!asn1_start_tag(data, ASN1_INTEGER)) return False;
@ -407,7 +407,7 @@ BOOL asn1_read_Integer(ASN1_DATA *data, int *i)
/* check a enumarted value is correct */
BOOL asn1_check_enumerated(ASN1_DATA *data, int v)
{
uint8 b;
uint8_t b;
if (!asn1_start_tag(data, ASN1_ENUMERATED)) return False;
asn1_read_uint8(data, &b);
asn1_end_tag(data);
@ -419,7 +419,7 @@ BOOL asn1_check_enumerated(ASN1_DATA *data, int v)
}
/* write an enumarted value to the stream */
BOOL asn1_write_enumerated(ASN1_DATA *data, uint8 v)
BOOL asn1_write_enumerated(ASN1_DATA *data, uint8_t v)
{
if (!asn1_push_tag(data, ASN1_ENUMERATED)) return False;
asn1_write_uint8(data, v);

View File

@ -75,7 +75,7 @@ NTSTATUS cli_nt_error(struct cli_tree *tree)
/* Return the DOS error from the last packet - an error class and an error
code. */
void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32_t *ecode)
void cli_dos_error(struct cli_state *cli, uint8_t *eclass, uint32_t *ecode)
{
if (cli->transport->error.etype == ETYPE_DOS) {
ntstatus_to_dos(cli->transport->error.e.nt_status,

View File

@ -46,7 +46,7 @@
/* NT status -> dos error map */
static const struct {
uint8 dos_class;
uint8_t dos_class;
uint32_t dos_code;
NTSTATUS ntstatus;
} ntstatus_to_dos_map[] = {
@ -612,7 +612,7 @@ static const struct {
/* dos -> nt status error map */
static const struct {
uint8 dos_class;
uint8_t dos_class;
uint32_t dos_code;
NTSTATUS ntstatus;
} dos_to_ntstatus_map[] = {
@ -1410,7 +1410,7 @@ static const struct {
/*****************************************************************************
convert a dos eclas/ecode to a NT status32 code
*****************************************************************************/
NTSTATUS dos_to_ntstatus(uint8 eclass, uint32_t ecode)
NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode)
{
int i;
if (eclass == 0 && ecode == 0) return NT_STATUS_OK;
@ -1427,7 +1427,7 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32_t ecode)
/*****************************************************************************
convert a NT status code to a dos class/code
*****************************************************************************/
void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32_t *ecode)
void ntstatus_to_dos(NTSTATUS ntstatus, uint8_t *eclass, uint32_t *ecode)
{
int i;
if (NT_STATUS_IS_OK(ntstatus)) {

View File

@ -239,7 +239,7 @@ void SMBOWFencrypt_ntv2(const uchar kr[16],
}
void SMBsesskeygen_ntv2(const uchar kr[16],
const uchar * nt_resp, uint8 sess_key[16])
const uchar * nt_resp, uint8_t sess_key[16])
{
/* a very nice, 128 bit, variable session key */
@ -255,7 +255,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16],
#endif
}
void SMBsesskeygen_ntv1(const uchar kr[16], uint8 sess_key[16])
void SMBsesskeygen_ntv1(const uchar kr[16], uint8_t sess_key[16])
{
/* yes, this session key does not change - yes, this
is a problem - but it is 128 bits */
@ -270,7 +270,7 @@ void SMBsesskeygen_ntv1(const uchar kr[16], uint8 sess_key[16])
void SMBsesskeygen_lm_sess_key(const uchar lm_hash[16],
const uchar lm_resp[24], /* only uses 8 */
uint8 sess_key[16])
uint8_t sess_key[16])
{
/* Calculate the LM session key (effective length 40 bits,
but changes with each session) */

View File

@ -128,7 +128,7 @@ static const struct err_code_struct hard_msgs[] = {
static const struct {
uint8 class;
uint8_t class;
const char *class_name;
const struct err_code_struct *err_msgs;
} err_classes[] = {
@ -145,7 +145,7 @@ static const struct {
/* return a dos error string given a error class and error code */
const char *dos_errstr(uint8 class, uint16_t code)
const char *dos_errstr(uint8_t class, uint16_t code)
{
static char *msg;
int i, j;

View File

@ -31,7 +31,7 @@
/*
parse a uint8
*/
NTSTATUS ndr_pull_uint8(struct ndr_pull *ndr, uint8 *v)
NTSTATUS ndr_pull_uint8(struct ndr_pull *ndr, uint8_t *v)
{
NDR_PULL_NEED_BYTES(ndr, 1);
*v = CVAL(ndr->data, ndr->offset);
@ -199,7 +199,7 @@ NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *da
/*
push a uint8
*/
NTSTATUS ndr_push_uint8(struct ndr_push *ndr, uint8 v)
NTSTATUS ndr_push_uint8(struct ndr_push *ndr, uint8_t v)
{
NDR_PUSH_NEED_BYTES(ndr, 1);
SCVAL(ndr->data, ndr->offset, v);
@ -678,7 +678,7 @@ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
ndr->print(ndr, "%s: struct %s", name, type);
}
void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8 v)
void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8_t v)
{
ndr->print(ndr, "%-25s: 0x%02x (%u)", name, v, v);
}
@ -790,7 +790,7 @@ void ndr_print_array_uint16(struct ndr_print *ndr, const char *name,
}
void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
const uint8 *data, uint32_t count)
const uint8_t *data, uint32_t count)
{
int i;

View File

@ -81,13 +81,13 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p,
const char *username,
const char *password,
int chan_type,
uint8 new_session_key[8])
uint8_t new_session_key[8])
{
NTSTATUS status;
struct dcerpc_pipe *p2;
struct netr_ServerReqChallenge r;
struct netr_ServerAuthenticate2 a;
uint8 mach_pwd[16];
uint8_t mach_pwd[16];
struct creds_CredentialState creds;
const char *workgroup, *workstation;
uint32_t negotiate_flags = 0;
@ -160,10 +160,10 @@ NTSTATUS dcerpc_bind_auth_schannel_key(struct dcerpc_pipe *p,
const char *uuid, unsigned version,
const char *domain,
const char *username,
const uint8 session_key[8])
const uint8_t session_key[8])
{
NTSTATUS status;
uint8 full_session_key[16];
uint8_t full_session_key[16];
struct schannel_state *schannel_state;
const char *workgroup, *workstation;
@ -261,7 +261,7 @@ NTSTATUS dcerpc_bind_auth_schannel(struct dcerpc_pipe *p,
const char *password)
{
NTSTATUS status;
uint8 session_key[8];
uint8_t session_key[8];
status = dcerpc_schannel_key(p, domain, username, password,
lp_server_role() == ROLE_DOMAIN_BDC? SEC_CHAN_BDC:SEC_CHAN_WKSTA,

View File

@ -60,7 +60,7 @@ static void idle_func(struct cli_transport *transport, void *p_private)
a handler for oplock break events from the server - these need to be passed
along to the client
*/
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *p_private)
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private)
{
struct cvfs_private *private = p_private;

View File

@ -26,7 +26,7 @@
allocate a new rpc handle
*/
struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection *dce_conn,
uint8 handle_type)
uint8_t handle_type)
{
TALLOC_CTX *mem_ctx;
struct dcesrv_handle *h;
@ -72,7 +72,7 @@ void dcesrv_handle_destroy(struct dcesrv_connection *dce_conn,
*/
struct dcesrv_handle *dcesrv_handle_fetch(struct dcesrv_connection *dce_conn,
struct policy_handle *p,
uint8 handle_type)
uint8_t handle_type)
{
struct dcesrv_handle *h;

View File

@ -145,7 +145,7 @@ static NTSTATUS netr_ServerAuthenticateInternals(struct server_pipe_state *pipe_
uint32_t *out_flags)
{
void *sam_ctx;
uint8 *mach_pwd;
uint8_t *mach_pwd;
uint16_t acct_flags;
int num_records;
struct ldb_message **msgs;

View File

@ -485,7 +485,7 @@ uint_t samdb_result_hashes(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
}
NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
uint8 **lm_pwd, uint8 **nt_pwd)
uint8_t **lm_pwd, uint8_t **nt_pwd)
{
const char *unicodePwd = samdb_result_string(msg, "unicodePwd", NULL);

View File

@ -24,7 +24,7 @@
static void get_challenge(struct server_context *smb, char buff[8])
{
NTSTATUS nt_status;
const uint8 *cryptkey;
const uint8_t *cryptkey;
/* muliple negprots are not premitted */
if (smb->negotiate.auth_context) {
@ -182,7 +182,7 @@ static void reply_lanman2(struct request_context *req, uint16_t choice)
static DATA_BLOB negprot_spnego(struct server_context *smb)
{
DATA_BLOB blob;
uint8 guid[16];
uint8_t guid[16];
const char *OIDs_krb5[] = {OID_KERBEROS5,
OID_KERBEROS5_OLD,
OID_NTLMSSP,

View File

@ -69,7 +69,7 @@ static NTSTATUS nttrans_ioctl(struct request_context *req,
union smb_ioctl nt;
uint32_t function;
uint16_t fnum;
uint8 filter;
uint8_t filter;
BOOL fsctl;
DATA_BLOB *blob;

View File

@ -2289,7 +2289,7 @@ void reply_sendtxt(struct request_context *req)
****************************************************************************/
void reply_special(struct request_context *req)
{
uint8 msg_type;
uint8_t msg_type;
char buf[4];
msg_type = CVAL(req->in.buffer,0);

View File

@ -292,7 +292,7 @@ void req_send_reply(struct request_context *req)
construct and send an error packet with a forced DOS error code
this is needed to match win2000 behaviour for some parts of the protocol
*/
void req_reply_dos_error(struct request_context *req, uint8 eclass, uint16_t ecode)
void req_reply_dos_error(struct request_context *req, uint8_t eclass, uint16_t ecode)
{
/* if the basic packet hasn't been setup yet then do it now */
if (req->out.buffer == NULL) {
@ -320,7 +320,7 @@ void req_reply_error(struct request_context *req, NTSTATUS status)
if (!lp_nt_status_support() || !(req->smb->negotiate.client_caps & CAP_STATUS32)) {
/* convert to DOS error codes */
uint8 eclass;
uint8_t eclass;
uint32_t ecode;
ntstatus_to_dos(status, &eclass, &ecode);
req_reply_dos_error(req, eclass, ecode);
@ -395,7 +395,7 @@ size_t req_push_str(struct request_context *req, char *dest, const char *str, in
return the number of bytes added
*/
size_t req_append_bytes(struct request_context *req,
const uint8 *bytes, size_t byte_len)
const uint8_t *bytes, size_t byte_len)
{
req_grow_allocation(req, byte_len + req->out.data_size);
memcpy(req->out.data + req->out.data_size, bytes, byte_len);
@ -407,7 +407,7 @@ size_t req_append_bytes(struct request_context *req,
return the number of bytes added
*/
size_t req_append_var_block(struct request_context *req,
const uint8 *bytes, uint16_t byte_len)
const uint8_t *bytes, uint16_t byte_len)
{
req_grow_allocation(req, byte_len + 3 + req->out.data_size);
SCVAL(req->out.data + req->out.data_size, 0, 5);

View File

@ -78,7 +78,7 @@ static void find_fill_info(struct request_context *req,
p += req_append_bytes(req, file->search.search_id.data, 21);
p += req_append_bytes(req, (char*)&file->search.attrib, 1);
srv_push_dos_date3(req->smb, (uint8 *)&dos_date, 0, file->search.write_time);
srv_push_dos_date3(req->smb, (uint8_t *)&dos_date, 0, file->search.write_time);
p += req_append_bytes(req, (char*)&dos_date, 4);
p += req_append_bytes(req, (char*)&file->search.size, 4);
memset(&search_name[0], ' ', 13);

View File

@ -34,8 +34,8 @@ static void mark_packet_signed(struct request_context *req)
/*
calculate the signature for a message
*/
static void calc_signature(uint8 *buffer, size_t length,
DATA_BLOB *mac_key, uint8 signature[8])
static void calc_signature(uint8_t *buffer, size_t length,
DATA_BLOB *mac_key, uint8_t signature[8])
{
unsigned char calc_md5_mac[16];
struct MD5Context md5_ctx;

View File

@ -25,7 +25,7 @@
/*
send an oplock break request to a client
*/
BOOL req_send_oplock_break(struct tcon_context *conn, uint16_t fnum, uint8 level)
BOOL req_send_oplock_break(struct tcon_context *conn, uint16_t fnum, uint8_t level)
{
struct request_context *req;
@ -415,7 +415,7 @@ static const struct smb_message_struct
/****************************************************************************
return a string containing the function name of a SMB command
****************************************************************************/
static const char *smb_fn_name(uint8 type)
static const char *smb_fn_name(uint8_t type)
{
const char *unknown_name = "SMBunknown";
@ -550,7 +550,7 @@ static void switch_message(int type, struct request_context *req)
****************************************************************************/
static void construct_reply(struct request_context *req)
{
uint8 type = CVAL(req->in.hdr,HDR_COM);
uint8_t type = CVAL(req->in.hdr,HDR_COM);
/* see if its a special NBT packet */
if (CVAL(req->in.buffer,0) != 0) {

View File

@ -27,7 +27,7 @@ put a dos date into a buffer (time/date format)
This takes GMT time and puts local time for zone_offset in the buffer
********************************************************************/
void srv_push_dos_date(struct server_context *smb_server,
uint8 *buf, int offset, time_t unixdate)
uint8_t *buf, int offset, time_t unixdate)
{
push_dos_date(buf, offset, unixdate, smb_server->negotiate.zone_offset);
}
@ -56,7 +56,7 @@ void srv_push_dos_date3(struct server_context *smb_server,
convert a dos date
********************************************************************/
time_t srv_pull_dos_date(struct server_context *smb_server,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date(date_ptr, smb_server->negotiate.zone_offset);
}
@ -65,7 +65,7 @@ time_t srv_pull_dos_date(struct server_context *smb_server,
like srv_pull_dos_date() but the words are reversed
********************************************************************/
time_t srv_pull_dos_date2(struct server_context *smb_server,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date2(date_ptr, smb_server->negotiate.zone_offset);
}
@ -75,7 +75,7 @@ time_t srv_pull_dos_date2(struct server_context *smb_server,
these arrive in server zone, with corresponding DST
******************************************************************/
time_t srv_pull_dos_date3(struct server_context *smb_server,
const uint8 *date_ptr)
const uint8_t *date_ptr)
{
return pull_dos_date3(date_ptr, smb_server->negotiate.zone_offset);
}

View File

@ -1238,7 +1238,7 @@ static NTSTATUS trans_backend(struct request_context *req, struct smb_trans2 *tr
/****************************************************************************
Reply to an SMBtrans or SMBtrans2 request
****************************************************************************/
void reply_trans_generic(struct request_context *req, uint8 command)
void reply_trans_generic(struct request_context *req, uint8_t command)
{
struct smb_trans2 trans;
int i;

View File

@ -524,7 +524,7 @@ void build_options(BOOL screen)
output(screen," sizeof(char): %d\n",sizeof(char));
output(screen," sizeof(int): %d\n",sizeof(int));
output(screen," sizeof(long): %d\n",sizeof(long));
output(screen," sizeof(uint8): %d\n",sizeof(uint8));
output(screen," sizeof(uint8_t): %d\n",sizeof(uint8_t));
output(screen," sizeof(uint16_t): %d\n",sizeof(uint16_t));
output(screen," sizeof(uint32_t): %d\n",sizeof(uint32_t));
output(screen," sizeof(short): %d\n",sizeof(short));

View File

@ -29,7 +29,7 @@ BOOL torture_utable(int dummy)
smb_ucs2_t c2;
int c, len, fd;
int chars_allowed=0, alt_allowed=0;
uint8 valid[0x10000];
uint8_t valid[0x10000];
printf("starting utable\n");

View File

@ -70,7 +70,7 @@ static struct {
BOOL got_break;
uint16_t fnum;
uint16_t handle;
uint8 level;
uint8_t level;
BOOL do_close;
} oplocks[NSERVERS][NINSTANCES];
@ -94,7 +94,7 @@ static struct {
#define BAD_HANDLE 0xFFFE
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *private);
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private);
static void idle_func(struct cli_transport *transport, void *private);
/*
@ -704,7 +704,7 @@ static void async_notify(struct cli_request *req)
/*
the oplock handler will either ack the break or close the file
*/
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *private)
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private)
{
union smb_close io;
NTSTATUS status;

View File

@ -143,7 +143,7 @@ static struct cli_state *c;
/*
a handler function for oplock break requests
*/
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *private)
static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private)
{
struct cli_tree *tree = private;
return cli_oplock_ack(tree, fnum, level);

View File

@ -45,7 +45,7 @@ static struct {
/*
a handler function for oplock break requests
*/
static BOOL oplock_handler_ack(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *private)
static BOOL oplock_handler_ack(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private)
{
struct cli_tree *tree = private;
break_info.fnum = fnum;
@ -60,7 +60,7 @@ static BOOL oplock_handler_ack(struct cli_transport *transport, uint16_t tid, ui
/*
a handler function for oplock break requests - close the file
*/
static BOOL oplock_handler_close(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8 level, void *private)
static BOOL oplock_handler_close(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private)
{
union smb_close io;
NTSTATUS status;

View File

@ -241,7 +241,7 @@ static BOOL test_SetupCredentials(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct netr_ServerReqChallenge r;
struct netr_ServerAuthenticate a;
const char *plain_pass;
uint8 mach_pwd[16];
uint8_t mach_pwd[16];
printf("Testing ServerReqChallenge\n");
@ -295,7 +295,7 @@ static BOOL test_SetupCredentials2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct netr_ServerReqChallenge r;
struct netr_ServerAuthenticate2 a;
const char *plain_pass;
uint8 mach_pwd[16];
uint8_t mach_pwd[16];
printf("Testing ServerReqChallenge\n");
@ -374,8 +374,8 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
DATA_BLOB *chall,
DATA_BLOB *lm_response,
DATA_BLOB *nt_response,
uint8 lm_key[8],
uint8 user_session_key[16],
uint8_t lm_key[8],
uint8_t user_session_key[16],
char **error_string)
{
NTSTATUS status;

View File

@ -232,7 +232,7 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
s2.in.level = lvl1; \
u = *q.out.info; \
if (lvl1 == 21) { \
uint8 *bitmap = u.info21.logon_hours.bitmap; \
uint8_t *bitmap = u.info21.logon_hours.bitmap; \
ZERO_STRUCT(u.info21); \
if (fpval == SAMR_FIELD_LOGON_HOURS) { \
u.info21.logon_hours.units_per_week = 168; \
@ -430,7 +430,7 @@ static BOOL test_SetUserPassEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
BOOL ret = True;
DATA_BLOB session_key;
DATA_BLOB confounded_session_key = data_blob_talloc(mem_ctx, NULL, 16);
uint8 confounder[16];
uint8_t confounder[16];
char *newpass = samr_rand_pass(mem_ctx);
struct MD5Context ctx;
@ -481,7 +481,7 @@ static BOOL test_SetUserPass_25(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
BOOL ret = True;
DATA_BLOB session_key;
DATA_BLOB confounded_session_key = data_blob_talloc(mem_ctx, NULL, 16);
uint8 confounder[16];
uint8_t confounder[16];
char *newpass = samr_rand_pass(mem_ctx);
struct MD5Context ctx;
@ -707,8 +707,8 @@ static BOOL test_ChangePasswordUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle user_handle;
char *oldpass = *password;
char *newpass = samr_rand_pass(mem_ctx);
uint8 old_nt_hash[16], new_nt_hash[16];
uint8 old_lm_hash[16], new_lm_hash[16];
uint8_t old_nt_hash[16], new_nt_hash[16];
uint8_t old_lm_hash[16], new_lm_hash[16];
status = test_OpenUser_byname(p, mem_ctx, handle, TEST_USERNAME, &user_handle);
if (!NT_STATUS_IS_OK(status)) {
@ -768,7 +768,7 @@ static BOOL test_OemChangePasswordUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_c
struct samr_AsciiName server, account;
char *oldpass = *password;
char *newpass = samr_rand_pass(mem_ctx);
uint8 old_lm_hash[16], new_lm_hash[16];
uint8_t old_lm_hash[16], new_lm_hash[16];
printf("Testing OemChangePasswordUser2\n");
@ -810,8 +810,8 @@ static BOOL test_ChangePasswordUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct samr_Hash nt_verifier, lm_verifier;
char *oldpass = *password;
char *newpass = samr_rand_pass(mem_ctx);
uint8 old_nt_hash[16], new_nt_hash[16];
uint8 old_lm_hash[16], new_lm_hash[16];
uint8_t old_nt_hash[16], new_nt_hash[16];
uint8_t old_lm_hash[16], new_lm_hash[16];
printf("Testing ChangePasswordUser2\n");
@ -863,8 +863,8 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct samr_Hash nt_verifier, lm_verifier;
char *oldpass = *password;
char *newpass = samr_rand_pass(mem_ctx);
uint8 old_nt_hash[16], new_nt_hash[16];
uint8 old_lm_hash[16], new_lm_hash[16];
uint8_t old_nt_hash[16], new_nt_hash[16];
uint8_t old_lm_hash[16], new_lm_hash[16];
printf("Testing ChangePasswordUser3\n");

View File

@ -170,10 +170,10 @@ NTSTATUS torture_rpc_close(struct dcerpc_pipe *p)
/* check if the server produced the expected error code */
static BOOL check_error(int line, struct cli_state *c,
uint8 eclass, uint32_t ecode, NTSTATUS nterr)
uint8_t eclass, uint32_t ecode, NTSTATUS nterr)
{
if (cli_is_dos_error(c->tree)) {
uint8 class;
uint8_t class;
uint32_t num;
/* Check DOS error */

View File

@ -27,7 +27,7 @@
struct netlogon_string {
uint32_t comp_len;
char **component;
uint8 extra_flag;
uint8_t extra_flag;
};
struct cldap_netlogon_reply {