return NULL;
}
- creds->sid = dom_sid_dup(creds, client_sid);
- if (creds->sid == NULL) {
+ creds->ex = talloc_zero(creds,
+ struct netlogon_creds_CredentialState_extra_info);
+ if (creds->ex == NULL) {
talloc_free(creds);
return NULL;
}
+ creds->ex->client_sid = *client_sid;
+
+ creds->sid = &creds->ex->client_sid;
if (negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
status = netlogon_creds_init_hmac_sha256(creds,
return NULL;
}
- if (creds_in->sid) {
- creds->sid = dom_sid_dup(creds, creds_in->sid);
- if (!creds->sid) {
+ if (creds_in->ex != NULL) {
+ creds->ex = talloc_zero(creds,
+ struct netlogon_creds_CredentialState_extra_info);
+ if (creds->ex == NULL) {
talloc_free(creds);
return NULL;
}
+ *creds->ex = *creds_in->ex;
+ }
+
+ if (creds->ex != NULL) {
+ creds->sid = &creds->ex->client_sid;
+ } else {
+ creds->sid = NULL;
}
memcpy(creds->session_key, creds_in->session_key, sizeof(creds->session_key));
char *name_upper;
NTSTATUS status;
+ if (creds->ex == NULL) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
+ if (creds->sid == NULL) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
if (strlen(creds->computer_name) > 15) {
/*
* We may want to check for a completely
NDR_PRINT_DEBUG(netlogon_creds_CredentialState, creds);
}
+ if (creds->ex == NULL) {
+ status = NT_STATUS_INTERNAL_ERROR;
+ goto done;
+ }
+
+ creds->sid = &creds->ex->client_sid;
+
DEBUG(3,("schannel_fetch_session_key_tdb: restored schannel info key %s\n",
keystr));
{
/* this structure is used internally in the NETLOGON server */
+ typedef [flag(NDR_PAHEX)] struct {
+ /*
+ * These were only used on the server part
+ * with a single dom_sid for the client_sid.
+ *
+ * On the server we use CLEAR_IF_FIRST,
+ * so db layout changes don't matter there.
+ */
+ dom_sid client_sid;
+ } netlogon_creds_CredentialState_extra_info;
+
typedef [public,flag(NDR_PAHEX)] struct {
netr_NegotiateFlags negotiate_flags;
uint8 session_key[16];
netr_SchannelType secure_channel_type;
[string,charset(UTF8)] uint8 computer_name[];
[string,charset(UTF8)] uint8 account_name[];
- dom_sid *sid;
+ [skip] dom_sid *sid;
+ netlogon_creds_CredentialState_extra_info *ex;
} netlogon_creds_CredentialState;
/* This is used in the schannel_store.tdb */