remember an established session key for a netr server authentication
use a simple ldb structure
*/
-NTSTATUS schannel_store_session_key(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- struct netlogon_creds_CredentialState *creds)
+NTSTATUS schannel_store_session_key_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ struct netlogon_creds_CredentialState *creds)
{
struct ldb_message *msg;
struct ldb_val val, seed, client_state, server_state;
/*
read back a credentials back for a computer
*/
-NTSTATUS schannel_fetch_session_key(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- const char *computer_name,
- struct netlogon_creds_CredentialState **creds)
+NTSTATUS schannel_fetch_session_key_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ const char *computer_name,
+ struct netlogon_creds_CredentialState **creds)
{
struct ldb_result *res;
int ret;
the caller needs some of that information.
*/
-NTSTATUS schannel_creds_server_step_check(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- const char *computer_name,
- bool schannel_required_for_call,
- bool schannel_in_use,
- struct netr_Authenticator *received_authenticator,
- struct netr_Authenticator *return_authenticator,
- struct netlogon_creds_CredentialState **creds_out)
+NTSTATUS schannel_creds_server_step_check_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ const char *computer_name,
+ bool schannel_required_for_call,
+ bool schannel_in_use,
+ struct netr_Authenticator *received_authenticator,
+ struct netr_Authenticator *return_authenticator,
+ struct netlogon_creds_CredentialState **creds_out)
{
struct netlogon_creds_CredentialState *creds;
NTSTATUS nt_status;
* disconnects) we must update the database every time we
* update the structure */
- nt_status = schannel_fetch_session_key(ldb, ldb, computer_name,
- &creds);
+ nt_status = schannel_fetch_session_key_ldb(ldb, ldb, computer_name,
+ &creds);
/* If we are flaged that schannel is required for a call, and
* it is not in use, then make this an error */
}
if (NT_STATUS_IS_OK(nt_status)) {
- nt_status = schannel_store_session_key(ldb, mem_ctx, creds);
+ nt_status = schannel_store_session_key_ldb(ldb, mem_ctx, creds);
}
if (NT_STATUS_IS_OK(nt_status)) {
/* The following definitions come from /home/jeremy/src/samba/git/master/source3/../source4/../libcli/auth/schannel_state.c */
-NTSTATUS schannel_store_session_key(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- struct netlogon_creds_CredentialState *creds);
-NTSTATUS schannel_fetch_session_key(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- const char *computer_name,
- struct netlogon_creds_CredentialState **creds);
-NTSTATUS schannel_creds_server_step_check(struct ldb_context *ldb,
- TALLOC_CTX *mem_ctx,
- const char *computer_name,
- bool schannel_required_for_call,
- bool schannel_in_use,
- struct netr_Authenticator *received_authenticator,
- struct netr_Authenticator *return_authenticator,
- struct netlogon_creds_CredentialState **creds_out) ;
+NTSTATUS schannel_store_session_key_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ struct netlogon_creds_CredentialState *creds);
+NTSTATUS schannel_fetch_session_key_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ const char *computer_name,
+ struct netlogon_creds_CredentialState **creds);
+NTSTATUS schannel_creds_server_step_check_ldb(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ const char *computer_name,
+ bool schannel_required_for_call,
+ bool schannel_in_use,
+ struct netr_Authenticator *received_authenticator,
+ struct netr_Authenticator *return_authenticator,
+ struct netlogon_creds_CredentialState **creds_out);
#undef _PRINTF_ATTRIBUTE
#define _PRINTF_ATTRIBUTE(a1, a2)
return NT_STATUS_ACCESS_DENIED;
}
/* pull the session key for this client */
- status = schannel_fetch_session_key(schannel_ldb,
- out_mem_ctx, workstation, &creds);
+ status = schannel_fetch_session_key_ldb(schannel_ldb,
+ out_mem_ctx, workstation, &creds);
talloc_free(schannel_ldb);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n",
return NT_STATUS_ACCESS_DENIED;
}
- nt_status = schannel_store_session_key(schannel_ldb, mem_ctx, creds);
+ nt_status = schannel_store_session_key_ldb(schannel_ldb, mem_ctx, creds);
talloc_free(schannel_ldb);
return nt_status;
if (!ldb) {
return NT_STATUS_ACCESS_DENIED;
}
- nt_status = schannel_creds_server_step_check(ldb, mem_ctx,
- computer_name,
- schannel_global_required,
- schannel_in_use,
- received_authenticator,
- return_authenticator, creds_out);
+ nt_status = schannel_creds_server_step_check_ldb(ldb, mem_ctx,
+ computer_name,
+ schannel_global_required,
+ schannel_in_use,
+ received_authenticator,
+ return_authenticator, creds_out);
talloc_free(ldb);
return nt_status;
}
return NT_STATUS_ACCESS_DENIED;
}
- nt_status = schannel_fetch_session_key(ldb, mem_ctx, r->in.computer_name, &creds);
+ nt_status = schannel_fetch_session_key_ldb(ldb, mem_ctx, r->in.computer_name, &creds);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
}