Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
b814c45f
Commit
b814c45f
authored
Mar 06, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Mar 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: NTLM's AcquireCredentialHandleA/W should accept domains and usernames with lengths of 0.
Add tests for these cases.
parent
d9229bd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
6 deletions
+69
-6
ntlm.c
dlls/secur32/ntlm.c
+0
-6
ntlm.c
dlls/secur32/tests/ntlm.c
+69
-0
No files found.
dlls/secur32/ntlm.c
View file @
b814c45f
...
...
@@ -163,12 +163,6 @@ static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(
PSEC_WINNT_AUTH_IDENTITY_W
auth_data
=
(
PSEC_WINNT_AUTH_IDENTITY_W
)
pAuthData
;
if
(
!
auth_data
->
UserLength
||
!
auth_data
->
DomainLength
)
{
ret
=
SEC_E_NO_CREDENTIALS
;
phCredential
=
NULL
;
break
;
}
/* Get username and domain from pAuthData */
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
auth_data
->
UserLength
+
1
)
*
sizeof
(
SEC_WCHAR
));
...
...
dlls/secur32/tests/ntlm.c
View file @
b814c45f
...
...
@@ -1116,6 +1116,74 @@ end:
HeapFree
(
GetProcessHeap
(),
0
,
complex_data
[
3
].
pvBuffer
);
}
static
void
testAcquireCredentialsHandle
(
void
)
{
CredHandle
cred
;
TimeStamp
ttl
;
static
char
test_user
[]
=
"testuser"
,
workgroup
[]
=
"WORKGROUP"
,
test_pass
[]
=
"testpass"
,
sec_pkg_name
[]
=
"NTLM"
;
SECURITY_STATUS
ret
;
SEC_WINNT_AUTH_IDENTITY
id
;
PSecPkgInfo
pkg_info
=
NULL
;
if
(
pQuerySecurityPackageInfoA
(
sec_pkg_name
,
&
pkg_info
)
!=
SEC_E_OK
)
{
skip
(
"NTLM package not installed, skipping test
\n
"
);
return
;
}
pFreeContextBuffer
(
pkg_info
);
id
.
User
=
(
unsigned
char
*
)
test_user
;
id
.
UserLength
=
strlen
((
char
*
)
id
.
User
);
id
.
Domain
=
(
unsigned
char
*
)
workgroup
;
id
.
DomainLength
=
strlen
((
char
*
)
id
.
Domain
);
id
.
Password
=
(
unsigned
char
*
)
test_pass
;
id
.
PasswordLength
=
strlen
((
char
*
)
id
.
Password
);
id
.
Flags
=
SEC_WINNT_AUTH_IDENTITY_ANSI
;
ret
=
pAcquireCredentialsHandleA
(
NULL
,
sec_pkg_name
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
id
,
NULL
,
NULL
,
&
cred
,
&
ttl
);
ok
(
ret
==
SEC_E_OK
,
"AcquireCredentialsHande() returned %s
\n
"
,
getSecError
(
ret
));
pFreeCredentialsHandle
(
&
cred
);
id
.
DomainLength
=
0
;
ret
=
pAcquireCredentialsHandleA
(
NULL
,
sec_pkg_name
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
id
,
NULL
,
NULL
,
&
cred
,
&
ttl
);
ok
(
ret
==
SEC_E_OK
,
"AcquireCredentialsHande() returned %s
\n
"
,
getSecError
(
ret
));
pFreeCredentialsHandle
(
&
cred
);
id
.
Domain
=
NULL
;
ret
=
pAcquireCredentialsHandleA
(
NULL
,
sec_pkg_name
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
id
,
NULL
,
NULL
,
&
cred
,
&
ttl
);
ok
(
ret
==
SEC_E_OK
,
"AcquireCredentialsHande() returned %s
\n
"
,
getSecError
(
ret
));
pFreeCredentialsHandle
(
&
cred
);
id
.
Domain
=
(
unsigned
char
*
)
workgroup
;
id
.
DomainLength
=
strlen
((
char
*
)
id
.
Domain
);
id
.
UserLength
=
0
;
id
.
User
=
NULL
;
ret
=
pAcquireCredentialsHandleA
(
NULL
,
sec_pkg_name
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
id
,
NULL
,
NULL
,
&
cred
,
&
ttl
);
ok
(
ret
==
SEC_E_OK
,
"AcquireCredentialsHande() returned %s
\n
"
,
getSecError
(
ret
));
pFreeCredentialsHandle
(
&
cred
);
id
.
User
=
(
unsigned
char
*
)
test_user
;
id
.
UserLength
=
strlen
((
char
*
)
id
.
User
);
id
.
Password
=
NULL
;
id
.
PasswordLength
=
0
;
ret
=
pAcquireCredentialsHandleA
(
NULL
,
sec_pkg_name
,
SECPKG_CRED_OUTBOUND
,
NULL
,
&
id
,
NULL
,
NULL
,
&
cred
,
&
ttl
);
ok
(
ret
==
SEC_E_OK
,
"AcquireCredentialsHande() returned %s
\n
"
,
getSecError
(
ret
));
pFreeCredentialsHandle
(
&
cred
);
}
START_TEST
(
ntlm
)
{
InitFunctionPtrs
();
...
...
@@ -1125,6 +1193,7 @@ START_TEST(ntlm)
pInitializeSecurityContextA
&&
pCompleteAuthToken
&&
pQuerySecurityPackageInfoA
)
{
testAcquireCredentialsHandle
();
testInitializeSecurityContextFlags
();
if
(
pAcceptSecurityContext
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment