#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
gss_ctx_id_t context_handle;
#endif
- };
+ } s;
};
struct cli_state {
}
ZERO_STRUCTP(es);
es->smb_enc_type = SMB_TRANS_ENC_NTLM;
- status = ntlmssp_client_start(&es->ntlmssp_state);
+ status = ntlmssp_client_start(&es->s.ntlmssp_state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
- ntlmssp_want_feature(es->ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
- es->ntlmssp_state->neg_flags |= (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL);
+ ntlmssp_want_feature(es->s.ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+ es->s.ntlmssp_state->neg_flags |= (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL);
- if (!NT_STATUS_IS_OK(status = ntlmssp_set_username(es->ntlmssp_state, user))) {
+ if (!NT_STATUS_IS_OK(status = ntlmssp_set_username(es->s.ntlmssp_state, user))) {
goto fail;
}
- if (!NT_STATUS_IS_OK(status = ntlmssp_set_domain(es->ntlmssp_state, domain))) {
+ if (!NT_STATUS_IS_OK(status = ntlmssp_set_domain(es->s.ntlmssp_state, domain))) {
goto fail;
}
- if (!NT_STATUS_IS_OK(status = ntlmssp_set_password(es->ntlmssp_state, pass))) {
+ if (!NT_STATUS_IS_OK(status = ntlmssp_set_password(es->s.ntlmssp_state, pass))) {
goto fail;
}
do {
- status = ntlmssp_update(es->ntlmssp_state, blob_in, &blob_out);
+ status = ntlmssp_update(es->s.ntlmssp_state, blob_in, &blob_out);
data_blob_free(&blob_in);
if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) || NT_STATUS_IS_OK(status)) {
status = enc_blob_send_receive(cli, &blob_out, &blob_in);
switch (es->smb_enc_type) {
case SMB_TRANS_ENC_NTLM:
- return common_ntlm_encrypt_buffer(es->ntlmssp_state, buffer, buf_out);
+ return common_ntlm_encrypt_buffer(es->s.ntlmssp_state, buffer, buf_out);
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
case SMB_TRANS_ENC_GSS:
- return common_gss_encrypt_buffer(es->context_handle, buffer, buf_out);
+ return common_gss_encrypt_buffer(es->s.context_handle, buffer, buf_out);
#endif
default:
return NT_STATUS_NOT_SUPPORTED;
switch (es->smb_enc_type) {
case SMB_TRANS_ENC_NTLM:
- return common_ntlm_decrypt_buffer(es->ntlmssp_state, buf);
+ return common_ntlm_decrypt_buffer(es->s.ntlmssp_state, buf);
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
case SMB_TRANS_ENC_GSS:
- return common_gss_decrypt_buffer(es->context_handle, buf);
+ return common_gss_decrypt_buffer(es->s.context_handle, buf);
#endif
default:
return NT_STATUS_NOT_SUPPORTED;
}
if (es->smb_enc_type == SMB_TRANS_ENC_NTLM) {
- if (es->ntlmssp_state) {
- ntlmssp_end(&es->ntlmssp_state);
+ if (es->s.ntlmssp_state) {
+ ntlmssp_end(&es->s.ntlmssp_state);
}
}
#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
* We must remember to update the pointer copy for the common
* functions after any auth_ntlmssp_start/auth_ntlmssp_end.
*/
- ec->es->ntlmssp_state = ec->auth_ntlmssp_state->ntlmssp_state;
+ ec->es->s.ntlmssp_state = ec->auth_ntlmssp_state->ntlmssp_state;
return status;
}
if (ec->auth_ntlmssp_state) {
auth_ntlmssp_end(&ec->auth_ntlmssp_state);
/* The auth_ntlmssp_end killed this already. */
- ec->es->ntlmssp_state = NULL;
+ ec->es->s.ntlmssp_state = NULL;
}
}
}
if (ec->es->smb_enc_type == SMB_TRANS_ENC_NTLM) {
- if ((ec->es->ntlmssp_state->neg_flags & (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) !=
+ if ((ec->es->s.ntlmssp_state->neg_flags & (NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) !=
(NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL)) {
return NT_STATUS_INVALID_PARAMETER;
}