2 Unix SMB/CIFS implementation.
3 Group Managed Service Account functions
5 Copyright (C) Catalyst.Net Ltd 2024
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <https://www.gnu.org/licenses/>.
21 #ifndef LIB_CRYPTO_GMSA_H
22 #define LIB_CRYPTO_GMSA_H
24 #include "lib/crypto/gkdi.h"
27 GMSA_PASSWORD_LEN
= 256,
28 GMSA_PASSWORD_NULL_TERMINATED_LEN
= GMSA_PASSWORD_LEN
+ 2,
31 struct gmsa_null_terminated_password
{
32 uint8_t buf
[GMSA_PASSWORD_NULL_TERMINATED_LEN
];
36 NTSTATUS
gmsa_password_based_on_key_id(
38 const struct Gkid gkid
,
39 const NTTIME current_time
,
40 const struct ProvRootKey
*const root_key
,
41 const struct dom_sid
*const account_sid
,
42 uint8_t password
[static const GMSA_PASSWORD_NULL_TERMINATED_LEN
]);
44 NTSTATUS
gmsa_talloc_password_based_on_key_id(
46 const struct Gkid gkid
,
47 const NTTIME current_time
,
48 const struct ProvRootKey
*const root_key
,
49 const struct dom_sid
*const account_sid
,
50 struct gmsa_null_terminated_password
**password_out
);
52 bool gmsa_current_time(NTTIME
*current_time_out
);
54 #endif /* LIB_CRYPTO_GMSA_H */