Comments (5)
@tguillem, @elthariel - opinions? :)
from libdsm.
Well, it authentication fails with the change, then the change is wrong, no?
from libdsm.
It didn't work before the change and the code was as I understood it wrong.
I'm trying to find the reason why browsing of smbx servers with VLC for iOS and tvOS only works on a full moonβ¦
Also clang static analyzer does find different issues like use-after-free among other things.
from libdsm.
Considering the fact that first parameter of HMAC_MD5 is a pointer (const void *key), there are some function calls that are incorrect :
in smb_ntlm2_hash :
HMAC_MD5(hash_v1, SMB_NTLM_HASH_SIZE, data, data_len, hash);
should be
HMAC_MD5(&hash_v1, SMB_NTLM_HASH_SIZE, data, data_len, hash);
in smb_ntlm2_session_key(smb_ntlmh *hash_v2, ...
HMAC_MD5(&hash_v2, 16, ntlm2, 16, &hmac_ntlm2);
should be
HMAC_MD5(hash_v2, 16, ntlm2, 16, &hmac_ntlm2);
One other point, the session state "SMB_STATE_SESSION_OK" at the end of authentication is only possible when going through smb_session_login_ntlm, if we login using smb_session_login_spnego, the final session state is SMB_STATE_DIALECT_OK.
One last point regarding "HMAC_MD5" function itself :
This part of the code looks suspicious :
// This is Microsoft variation of HMAC_MD5 for NTLMv2
// It seems they truncate over-sized keys instead of rehashing
if (key_len > 64)
key_len = 64;
else
{
memcpy(key_pad, key, key_len);
memset(key_pad + key_len, 0, 64 - key_len);
}
The point is that key_len is only used in the else statement ! And it means that if the key size is above 64 bytes, the key will not be copied in "key_pad" buffer, and the following code will work with an uninitialised buffer ...
I guess that this code should be
// This is Microsoft variation of HMAC_MD5 for NTLMv2
// It seems they truncate over-sized keys instead of rehashing
if (key_len > 64)
key_len = 64;
memcpy(key_pad, key, key_len);
memset(key_pad + key_len, 0, 64 - key_len);
from libdsm.
Fixed in 8ec9870.
from libdsm.
Related Issues (20)
- Domain Based Access HOT 1
- Fail to call `smb_fstat()` when the file name contains char like "γ¦γ"
- I hereby raise an objection to the 'Portable, Theoretically' claim HOT 4
- Move to meson buildsystem HOT 2
- What means a DSM_ERROR_NT ? HOT 1
- dsm raises SIGPIPE after network disconnect HOT 1
- Incorrect dependency on asn1Parser
- Meson build is broken HOT 9
- Can it build on Windows (Visual Studio 2019)? HOT 1
- Do we support ADS (alternate data streams)? HOT 5
- please help HOT 4
- 0.4.0 fail to build HOT 3
- 0.4.0 fails to configure for tvOS HOT 10
- add support to compile this lib for windows HOT 3
- Whether to support creating files HOT 3
- Compilation issues on Linux with Tasn1 (version 4.19.0) & clock_gettime.c HOT 2
- How to compile HOT 1
- wiki HOT 1
- is using meson build system? HOT 1
- how to build it for iOS? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdsm.