summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce ntlm_signseal_stateSimo Sorce2014-08-066-146/+138
| | | | This structure keeps the crypto state closer to the crypto routines.
* Use a macro to define the ntlm signature sizeSimo Sorce2014-08-063-22/+31
| | | | | Avoids the look of magic numbers everywhere, and give some useful context to the code reader
* Implement gss_wrap_size_limit()Simo Sorce2014-08-063-0/+53
|
* Fix sealing key regen with shorter keysSimo Sorce2014-08-062-3/+3
| | | | | At LM_COMPAT_LEVEL 0 there is no exteded security and initial sealing keys are 8 byte long.
* Fix unsealing without extended session securitySimo Sorce2014-08-061-7/+8
| | | | ntlm_unseal should be symmetric to ntlm_seal
* Fix flag clearingSimo Sorce2014-08-061-1/+0
| | | | | | NTLMSSP_REQUEST_NON_NT_SESSION_KEY is not in itself incompatble with NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY, although it is only used is Extended Security is not Negotiated.
* Generate LM hash when getting pwd from cred_storeSimo Sorce2014-08-061-0/+8
| | | | | This is needed when NTLMSSP_NEGOTIATE_LM_KEY is used at lower, LM_COMPTE_LEVEL (eg, level 0) by a client and NTLMv1 auth.
* Silence const errorsSimo Sorce2014-07-121-1/+1
|
* Cast to (char *) not (void *) to do pointer mathSimo Sorce2014-07-122-10/+10
|
* Add gss_localname supportSimo Sorce2014-07-123-0/+79
| | | | | | Uses the fully qualified name and falls back to simple user name and calls getpwnam_r() to resolve a local name. If the user is not known to the nsswitch subsystme it returns a failure.
* Handle missing name calling acquire creds.Simo Sorce2014-07-111-13/+41
| | | | | | | In the GSS_C_ACCEPT (acceptor/server) case we would end up segfalting if no name was provided. Instead allow a null desired_name and load the default server name if none is passed in, just like gss_accept_sec_context() does i this case.
* Fix const warningsSimo Sorce2014-06-211-4/+4
| | | | | Just discard the const and silence the warnings, where safe; rework assignments were possible.
* Fix memory leak in NTLMv2 acceptor codeSimo Sorce2014-05-171-0/+3
|
* Add way to talk about MIC with SPNEGOSimo Sorce2014-05-056-12/+106
| | | | | | | | | | | | | | | As agreed with MIT people, add an inquire mechanism that serves 2 roles. On the one hand, if the spnego mechanism makes this call at all it means it is recent enough to support forcing the mechlistMIC on if we create an Authenticate message MIC. So remove the environment variable and instead depend on the SPNEGO layer to call this function before the Authenticate token is generated (usually right after the Negotiate token has been produced). On the other hand if this function has been called assume SPNEGO will call again right after the authenticate message has been genrated to know whether the mechlistMIC needs to be added.
* Disable MIC by default.Simo Sorce2014-05-041-1/+11
| | | | | | | | | | | | The environment variable NTLMSSP_ENABLE_MIC will enable setting the MIC if requested by the server when it is set to '1'. It is disabled by default because it works only with a patched SPNEGO library that will always set the mechlistMIC on the authenticate packet if we report that integrity is enabled. If the libray is unpatched it has also been observed that Firefox will go in an infinite authentication loop while it keeps trying to make requests that are always denied.
* Provide the correct target name in the challengeSimo Sorce2014-05-041-2/+13
| | | | | | | | MS-NLMP prescribes in 3.2.5.1.1 that the server should send the NetbIOS Domain name if joined to a domain or the NetBIOS computer name if standalone. Never the DNS computer name. Also do not add a target_name entry in the target_info field, it is not required and Windows does not do that.
* Check netbios computer and domain name when neededSimo Sorce2014-05-043-4/+15
| | | | | | MS-NLMP 3.1.5.1.2 says a client must fail to communicate if NTLMv2 is used, Integrity or Confidentiality are required and NetBIOS Computer or Domain Name are not present in the Challenge message from the server.
* Always provide netbios computer and domain nameSimo Sorce2014-05-041-9/+79
| | | | | | | | | | These are necessary by spec (MS-NLMP 3.1.5.1.2) if the server sends a target_info field in the challenge message, which we do. Uses environment variables NETBIOS_COMPUTER_NAME and NETBIOS_DOMAIN_NAME to set NetBIOS data. If they are not available the server name truncated to the first '.' (if any) will be used and the domain is set to the generic "WORKGROUP" name.
* Verify Channel Bindings in accept_sec_contextSimo Sorce2014-05-041-1/+24
|
* Add support for setting CBT in the clientSimo Sorce2014-05-043-2/+28
|
* Add function to verify Channel Binding TokenSimo Sorce2014-05-042-0/+27
|
* Add function to calculate channel bindings hashSimo Sorce2014-05-042-0/+39
|
* Get av_flags and check MIC if a client sent itSimo Sorce2014-05-041-4/+25
| | | | | | | Gets the target_info structure from the NT Response (if any is available) and extract the av_flags. If the appropriate flag is set verify the MIC previously extracted.
* Return target_info from ntlm_decode_auth_msgSimo Sorce2014-05-045-30/+55
| | | | | | | | | The target_info structure embedded in the NT Response message in NTLMv2 contains information needed to establish if the client has sent a valid MIC. So we need to extract and return it if the caller requested it. Also moves some wire structures definitions in common to be able to reuse them.
* Make MIC conditional on integrity being requestedSimo Sorce2014-05-043-3/+6
| | | | | If integrity is requested by any party then the MIC, if requested by the server will be generated, otherwise it will not be.
* Compute MIC in the client when requestedSimo Sorce2014-05-042-4/+24
|
* Add function to verify MICsSimo Sorce2014-05-044-46/+104
|
* Add function to calculate MICSimo Sorce2014-05-042-0/+42
|
* Use target_info parsing helperSimo Sorce2014-05-041-36/+30
| | | | | Target_info can be optional, but it conflicts with channel bindings being requesed.
* Augment target_info processing with a utilitySimo Sorce2014-05-042-0/+91
| | | | | | | | | Thi re-encoded the target_info structure at the client side adding additional provisions of MS-NLMP 3.1.5.2.1 That is: - generate indication that a MIC is requested by the server - add ClientSuppliedTargetName data
* Add internal facility to override standard versionSimo Sorce2014-05-042-8/+31
| | | | This is useufl to use test vetors w/o altering them
* Retry auth with NULL Domain as per specSimo Sorce2014-05-041-23/+37
|
* Remove unnecessary assignmentsSimo Sorce2014-05-041-4/+3
| | | | | | | The calculation was right but some unnecessary assignments were left from a previous version. Also make the length computation more obvious.
* Remove redundant definitionSimo Sorce2014-05-041-17/+4
| | | | | | wire_lm_response is just the same thing as wire_ntlm_response, the only difference is how cli_chal is defined but it is not important from a usage p[oint of view.
* Change input parameter to be constSimo Sorce2014-05-042-2/+2
| | | | It is never and should never be touched so const char * is better.
* Fail if the encryption level is not matchedSimo Sorce2014-05-041-0/+6
| | | | | If the client allows only 128bit security but the server does not offer it, then fail the authentication.
* Do not send LM Response on auth to modern serversSimo Sorce2014-05-042-17/+23
| | | | | | | | | | | If a server send a target_info field in a challenge message it means it does not need nor want a LM Response. See also MS-NLMP 3.1.5.1.2 The authenticate message must alwyas send a lm_chalresp and a nt_chalresp fields in the header but they will be simply zero length, yet the payload pointer must point to the valid payload area. (Windows server fail authentication if the LM Response buffer offset is zero).
* Always use Extedned Session Security when possibleSimo Sorce2014-05-041-0/+1
| | | | | MS-NLMP 3.1.5.1.1 recommends to set the extended session security flag if LM authentication is not going to be used.
* Fix missing assignments in ntlm_decode_target_infoSimo Sorce2014-05-041-2/+4
| | | | | | Missed to see that the server set timestamp and flags. This was preventing MICs from being generated from the client among other things.
* Return flags and time when requestedSimo Sorce2014-05-041-0/+14
| | | | | | | The calling application may want to check what flags were actually negotiated. Spnego also depends on the mechanism properly returning flags when integrity is negotiated for MIC purposes.
* Return Client name if requestedSimo Sorce2014-04-121-0/+9
|
* Fix epoch valueSimo Sorce2014-04-121-1/+1
| | | | It was off by a factor of 10
* Fix segfault in init context.Simo Sorce2014-01-262-6/+11
| | | | | | | | | | | The init context function was improperly initializing the ctx variable (too late) when some early error conditions can happen. Therefore passing to the delete context function a random memory address it would then try to free. This wuld cause a SEGFAULT in most cases. Additionally unfortunately iconv_close() does not follow good practices and blindignly dereferences data, even if the passed in pointer is NULL. So add a check before calling.
* Implement Import/Export cred functionsexport_credSimo Sorce2014-01-123-0/+216
|
* Generalize export_state and related functionsSimo Sorce2014-01-121-75/+82
|
* Expose cred store names in public header file.Simo Sorce2014-01-123-6/+8
| | | | Easier to use from clients this way.
* Implement import context functionSimo Sorce2013-12-151-1/+313
|
* Implement export context functionSimo Sorce2013-12-154-1/+433
| | | | | The Export format version is set to 0.1 Long term keys are not exported.
* Add import/export functions for the RC4 stateSimo Sorce2013-12-152-0/+56
|
* Use RC4 instead of EVP interface of opensslSimo Sorce2013-12-151-49/+10
| | | | | This makes it much easier to export/import the crypto state. In preparation for implemeting import/export of context.