Lines Matching defs:ctx
85 smbfs_ssnsetup_null(struct smb_ctx *ctx)
91 if (ctx->ct_sopt.sv_caps & CAP_EXTENDED_SECURITY) {
97 err = smbfs_ssnsetup(ctx, NULL, NULL, &ntstatus, &action);
105 ctx->ct_ntstatus = ntstatus;
116 smbfs_ssnsetup_ntlm1(struct smb_ctx *ctx)
123 if (ctx->ct_sopt.sv_caps & CAP_EXTENDED_SECURITY) {
134 err = smbfs_ntlm_put_v1_responses(ctx, &lm_mbc, &nt_mbc);
143 if ((ctx->ct_vcflags & SMBV_WILL_SIGN) &&
144 (ctx->ct_hflags2 & SMB_FLAGS2_SMB_SECURITY_SIGNATURE) == 0) {
151 ctx->ct_mackeylen = NTLM_HASH_SZ + m->m_len;
152 ctx->ct_mackey = malloc(ctx->ct_mackeylen);
153 if (ctx->ct_mackey == NULL) {
154 ctx->ct_mackeylen = 0;
158 p = ctx->ct_mackey;
159 (void) memcpy(p, ctx->ct_ssn_key, NTLM_HASH_SZ);
161 if (ctx->ct_vopt & SMBVOPT_SIGNING_REQUIRED) {
162 ctx->ct_hflags2 |=
167 ctx->ct_hflags2 |= SMB_FLAGS2_SMB_SECURITY_SIGNATURE;
170 err = smbfs_ssnsetup(ctx, &lm_mbc, &nt_mbc, &ntstatus, &action);
178 ctx->ct_ntstatus = ntstatus;
191 smbfs_ssnsetup_ntlm2(struct smb_ctx *ctx)
198 if (ctx->ct_sopt.sv_caps & CAP_EXTENDED_SECURITY) {
210 err = smbfs_ntlm_build_target_info(ctx, NULL, &ti_mbc);
215 err = smbfs_ntlm_put_v2_responses(ctx, &ti_mbc, &lm_mbc, &nt_mbc);
224 if ((ctx->ct_vcflags & SMBV_WILL_SIGN) &&
225 (ctx->ct_hflags2 & SMB_FLAGS2_SMB_SECURITY_SIGNATURE) == 0) {
232 ctx->ct_mackeylen = NTLM_HASH_SZ + m->m_len;
233 ctx->ct_mackey = malloc(ctx->ct_mackeylen);
234 if (ctx->ct_mackey == NULL) {
235 ctx->ct_mackeylen = 0;
239 p = ctx->ct_mackey;
240 (void) memcpy(p, ctx->ct_ssn_key, NTLM_HASH_SZ);
244 ctx->ct_hflags2 |= SMB_FLAGS2_SMB_SECURITY_SIGNATURE;
245 if (ctx->ct_vopt & SMBVOPT_SIGNING_REQUIRED) {
246 ctx->ct_hflags2 |=
251 err = smbfs_ssnsetup(ctx, &lm_mbc, &nt_mbc, &ntstatus, &action);
259 ctx->ct_ntstatus = ntstatus;
288 * authentication cannot be attempted with the ctx structure.
291 smbfs_ssnsetup_spnego(struct smb_ctx *ctx, struct mbdata *hint_mb)
295 err = smbfs_gss_init_sec(ctx, hint_mb);
299 err = smbfs_ssp_init_sec(ctx, hint_mb);
323 smbfs_ssnsetup(struct smb_ctx *ctx,
330 struct smb_sopt *sv = &ctx->ct_sopt;
331 struct smb_iods *is = &ctx->ct_iods;
355 caps = ctx->ct_sopt.sv_caps & caps_mask;
356 uc = ctx->ct_hflags2 & SMB_FLAGS2_UNICODE;
358 err = smbfs_rq_init(ctx, SMB_COM_SESSION_SETUP_ANDX, &rqp);
407 smbfs_mb_put_string(mbp, ctx->ct_user, uc);
408 smbfs_mb_put_string(mbp, ctx->ct_domain, uc);
414 err = smbfs_rq_internal(ctx, rqp);
491 (void) smbfs_md_get_string(mbp, &ctx->ct_srv_OS, uc);
492 (void) smbfs_md_get_string(mbp, &ctx->ct_srv_LM, uc);
495 if (!reported && ctx->ct_srv_OS != NULL && ctx->ct_srv_LM != NULL) {
498 ctx->ct_srv_OS, ctx->ct_srv_LM);
500 ctx->ct_srv_OS, ctx->ct_srv_LM);
507 if (ctx->ct_srv_OS &&
508 0 == strncmp(ctx->ct_srv_OS, "Windows ", 8)) {
509 if (ctx->ct_vcflags & SMBV_WILL_SIGN) {
511 ctx->ct_sopt.sv_caps &=