s3:smbstatus: Fix some nonempty blank lines
[Samba/aatanasov.git] / source3 / passdb / secrets_schannel.c
blob84a860ee6aa75787c311a90c578b732009fc6dee
1 /*
2 Unix SMB/CIFS implementation.
3 Copyright (C) Guenther Deschner 2009
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "includes.h"
20 #include "../libcli/auth/libcli_auth.h"
21 #include "../libcli/auth/schannel_state.h"
23 /******************************************************************************
24 Wrapper around schannel_fetch_session_key_tdb()
25 Note we must be root here.
26 *******************************************************************************/
28 NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx,
29 const char *computer_name,
30 struct netlogon_creds_CredentialState **pcreds)
32 struct tdb_context *tdb;
33 NTSTATUS status;
35 tdb = open_schannel_session_store(mem_ctx);
36 if (!tdb) {
37 return NT_STATUS_ACCESS_DENIED;
40 status = schannel_fetch_session_key_tdb(tdb, mem_ctx, computer_name, pcreds);
42 tdb_close(tdb);
44 return status;
47 /******************************************************************************
48 Wrapper around schannel_store_session_key_tdb()
49 Note we must be root here.
50 *******************************************************************************/
52 NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
53 struct netlogon_creds_CredentialState *creds)
55 struct tdb_context *tdb;
56 NTSTATUS status;
58 tdb = open_schannel_session_store(mem_ctx);
59 if (!tdb) {
60 return NT_STATUS_ACCESS_DENIED;
63 status = schannel_store_session_key_tdb(tdb, mem_ctx, creds);
65 tdb_close(tdb);
67 return status;