s3: libcli: Rename smb_signing_is_active() -> smb1_signing_is_active()
[samba.git] / libcli / smb / smb_signing.h
1 /*
2    Unix SMB/CIFS implementation.
3    SMB Signing Code
4    Copyright (C) Jeremy Allison 2003.
5    Copyright (C) Andrew Bartlett <abartlet@samba.org> 2002-2003
6    Copyright (C) Stefan Metzmacher 2009
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef _SMB_SIGNING_H_
23 #define _SMB_SIGNING_H_
24
25 struct smb1_signing_state;
26
27 struct smb1_signing_state *smb1_signing_init(TALLOC_CTX *mem_ctx,
28                                            bool allowed,
29                                            bool desired,
30                                            bool mandatory);
31 struct smb1_signing_state *smb1_signing_init_ex(TALLOC_CTX *mem_ctx,
32                                               bool allowed,
33                                               bool desired,
34                                               bool mandatory,
35                                               void *(*alloc_fn)(TALLOC_CTX *, size_t),
36                                               void (*free_fn)(TALLOC_CTX *, void *));
37 uint32_t smb1_signing_next_seqnum(struct smb1_signing_state *si, bool oneway);
38 void smb1_signing_cancel_reply(struct smb1_signing_state *si, bool oneway);
39 NTSTATUS smb1_signing_sign_pdu(struct smb1_signing_state *si,
40                               uint8_t *outhdr, size_t len,
41                               uint32_t seqnum);
42 bool smb1_signing_check_pdu(struct smb1_signing_state *si,
43                            const uint8_t *inhdr, size_t len,
44                            uint32_t seqnum);
45 bool smb1_signing_activate(struct smb1_signing_state *si,
46                           const DATA_BLOB user_session_key,
47                           const DATA_BLOB response);
48 bool smb1_signing_is_active(struct smb1_signing_state *si);
49 bool smb_signing_is_allowed(struct smb1_signing_state *si);
50 bool smb_signing_is_desired(struct smb1_signing_state *si);
51 bool smb_signing_is_mandatory(struct smb1_signing_state *si);
52 bool smb_signing_set_negotiated(struct smb1_signing_state *si,
53                                 bool allowed, bool mandatory);
54 bool smb_signing_is_negotiated(struct smb1_signing_state *si);
55 NTSTATUS smb_key_derivation(const uint8_t *KI,
56                             size_t KI_len,
57                             uint8_t KO[16]);
58
59 #endif /* _SMB_SIGNING_H_ */