summaryrefslogtreecommitdiffstats
path: root/src/ntlm.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-08-08 16:11:40 -0400
committerSimo Sorce <simo@redhat.com>2014-08-08 18:29:25 -0400
commit0033db0bdb6db653ab43b99ca4b343148739e5c2 (patch)
tree49bb12b367bb2fed56a1c7c62889896e5a4d9579 /src/ntlm.c
parentfd4464077fee7b309059f7c39ab89925a4a7dac0 (diff)
downloadgss-ntlmssp-0033db0bdb6db653ab43b99ca4b343148739e5c2.tar.gz
gss-ntlmssp-0033db0bdb6db653ab43b99ca4b343148739e5c2.tar.xz
gss-ntlmssp-0033db0bdb6db653ab43b99ca4b343148739e5c2.zip
Ignore domain and workstation in negotiate message
We never use these fields, so do not even attempt to decode them just ignore completely.
Diffstat (limited to 'src/ntlm.c')
-rw-r--r--src/ntlm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ntlm.c b/src/ntlm.c
index 3702e4c..d9b3c87 100644
--- a/src/ntlm.c
+++ b/src/ntlm.c
@@ -979,12 +979,14 @@ int ntlm_decode_neg_msg(struct ntlm_ctx *ctx,
neg_flags = le32toh(msg->neg_flags);
- if (neg_flags & NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED) {
+ if (domain &&
+ (neg_flags & NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED)) {
ret = ntlm_decode_oem_str(&msg->domain_name, buffer,
payload_offs, &dom);
if (ret) goto done;
}
- if (neg_flags & NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED) {
+ if (workstation &&
+ (neg_flags & NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED)) {
ret = ntlm_decode_oem_str(&msg->workstation_name, buffer,
payload_offs, &wks);
if (ret) goto done;
@@ -996,8 +998,8 @@ done:
safefree(wks);
} else {
*flags = neg_flags;
- *domain = dom;
- *workstation = wks;
+ if (domain) *domain = dom;
+ if (workstation) *workstation = wks;
}
return ret;
}