1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r20135: attach default gensec features to the cli_credentials structure,

so make it possible to force encryption or signing.

metze
(This used to be commit a91dc4a02a)
This commit is contained in:
Stefan Metzmacher 2006-12-12 21:47:56 +00:00 committed by Gerald (Jerry) Carter
parent 6f73359133
commit 38a472c994
3 changed files with 16 additions and 0 deletions

View File

@ -63,6 +63,7 @@ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx)
cred->callback_running = False;
cli_credentials_set_kerberos_state(cred, CRED_AUTO_USE_KERBEROS);
cli_credentials_set_gensec_features(cred, 0);
return cred;
}
@ -78,6 +79,16 @@ enum credentials_use_kerberos cli_credentials_get_kerberos_state(struct cli_cred
return creds->use_kerberos;
}
void cli_credentials_set_gensec_features(struct cli_credentials *creds, uint32_t gensec_features)
{
creds->gensec_features = gensec_features;
}
uint32_t cli_credentials_get_gensec_features(struct cli_credentials *creds)
{
return creds->gensec_features;
}
/**
* Obtain the username for this credentials context.

View File

@ -106,6 +106,9 @@ struct cli_credentials {
/* Should we be trying to use kerberos? */
enum credentials_use_kerberos use_kerberos;
/* gensec features which should be used for connections */
uint32_t gensec_features;
/* Number of retries left before bailing out */
int tries;

View File

@ -1047,6 +1047,8 @@ _PUBLIC_ BOOL gensec_have_feature(struct gensec_security *gensec_security,
_PUBLIC_ NTSTATUS gensec_set_credentials(struct gensec_security *gensec_security, struct cli_credentials *credentials)
{
gensec_security->credentials = talloc_reference(gensec_security, credentials);
NT_STATUS_HAVE_NO_MEMORY(gensec_security->credentials);
gensec_want_feature(gensec_security, cli_credentials_get_gensec_features(gensec_security->credentials));
return NT_STATUS_OK;
}