forked from namjaejeon/ksmbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.h
76 lines (60 loc) · 1.87 KB
/
auth.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2018 Samsung Electronics Co., Ltd.
*/
#ifndef __AUTH_H__
#define __AUTH_H__
#include "ntlmssp.h"
#define AUTH_GSS_LENGTH 74
#define AUTH_GSS_PADDING 6
#define CIFS_HMAC_MD5_HASH_SIZE (16)
#define CIFS_NTHASH_SIZE (16)
struct cifsd_session;
struct cifsd_tcp_conn;
struct kvec;
int cifsd_crypt_message(struct cifsd_tcp_conn *conn,
struct kvec *iov,
unsigned int nvec,
int enc);
void cifsd_copy_gss_neg_header(void *buf);
void cifsd_free_conn_secmech(struct cifsd_tcp_conn *conn);
int cifsd_auth_ntlm(struct cifsd_session *sess,
char *pw_buf);
int cifsd_auth_ntlmv2(struct cifsd_session *sess,
struct ntlmv2_resp *ntlmv2,
int blen,
char *domain_name);
int cifsd_decode_ntlmssp_auth_blob(AUTHENTICATE_MESSAGE *authblob,
int blob_len,
struct cifsd_session *sess);
int cifsd_decode_ntlmssp_neg_blob(NEGOTIATE_MESSAGE *negblob,
int blob_len,
struct cifsd_session *sess);
unsigned int cifsd_build_ntlmssp_challenge_blob(CHALLENGE_MESSAGE *chgblob,
struct cifsd_session *sess);
int cifsd_sign_smb1_pdu(struct cifsd_session *sess,
struct kvec *iov,
int n_vec,
char *sig);
int cifsd_sign_smb2_pdu(struct cifsd_tcp_conn *conn,
char *key,
struct kvec *iov,
int n_vec,
char *sig);
int cifsd_sign_smb3_pdu(struct cifsd_tcp_conn *conn,
char *key,
struct kvec *iov,
int n_vec,
char *sig);
int cifsd_gen_smb30_signingkey(struct cifsd_session *sess,
bool binding,
char *hash_value);
int cifsd_gen_smb311_signingkey(struct cifsd_session *sess,
bool binding,
char *hash_value);
int cifsd_gen_smb30_encryptionkey(struct cifsd_session *sess);
int cifsd_gen_smb311_encryptionkey(struct cifsd_session *sess);
int cifsd_gen_preauth_integrity_hash(struct cifsd_tcp_conn *conn,
char *buf,
__u8 *pi_hash);
#endif