Lines Matching refs:ctx

93 ntlm_rand_ssn_key(struct smb_ctx *ctx,
232 struct smb_ctx *ctx = sp->smb_ctx;
258 if (ctx->ct_vcflags & SMBV_WILL_SIGN) {
260 ctx->ct_hflags2 |= SMB_FLAGS2_SECURITY_SIGNATURE;
310 struct smb_ctx *ctx = sp->smb_ctx;
343 bcopy(&hdr.h_challenge, ctx->ct_srv_chal, NTLM_CHAL_SZ);
419 struct smb_ctx *ctx = sp->smb_ctx;
446 if (ctx->ct_authflags & SMB_AT_ANON) {
459 } else if (ctx->ct_authflags & SMB_AT_NTLM2) {
463 err = ntlm_build_target_info(ctx,
467 err = ntlm_put_v2_responses(ctx, &ti_mbc,
472 memcpy(ssp_st->ss_kxkey, ctx->ct_ssn_key, NTLM_HASH_SZ);
479 err = ntlm_put_v1x_responses(ctx,
484 ntlm2_kxkey(ctx, &lm_mbc, ssp_st->ss_kxkey);
489 err = ntlm_put_v1_responses(ctx,
494 memcpy(ssp_st->ss_kxkey, ctx->ct_ssn_key, NTLM_HASH_SZ);
503 err = ntlm_rand_ssn_key(ctx, ssp_st, &ek_mbc);
508 memcpy(ctx->ct_ssn_key, ssp_st->ss_kxkey, NTLM_HASH_SZ);
524 err = mb_put_sb_string(&mb2, &hdr.h_domain, ctx->ct_domain, uc);
527 err = mb_put_sb_string(&mb2, &hdr.h_user, ctx->ct_user, uc);
530 err = mb_put_sb_string(&mb2, &hdr.h_wksta, ctx->ct_locname, uc);
593 struct smb_ctx *ctx,
606 (void) smb_get_urandom(ctx->ct_ssn_key, NTLM_HASH_SZ);
611 ctx->ct_ssn_key, NTLM_HASH_SZ);
625 struct smb_ctx *ctx = sp->smb_ctx;
632 if ((ctx->ct_hflags2 & SMB_FLAGS2_SECURITY_SIGNATURE) &&
633 (ctx->ct_mackey == NULL)) {
634 ctx->ct_mackeylen = NTLM_HASH_SZ;
635 ctx->ct_mackey = malloc(ctx->ct_mackeylen);
636 if (ctx->ct_mackey == NULL) {
637 ctx->ct_mackeylen = 0;
641 memcpy(ctx->ct_mackey, ctx->ct_ssn_key, NTLM_HASH_SZ);
646 ctx->ct_mac_seqno = 2;