summaryrefslogtreecommitdiffstats
path: root/source/libsmb/smbencrypt.c
Commit message (Collapse)AuthorAgeFilesLines
* Try to fix up warnings - particularly on the IRIX 64 bit compiler (which had aAndrew Bartlett2002-07-201-2/+2
| | | | | | | | distinction between uchar and char). Lots of const etc. Andrew Bartlett
* Fix up char/uchar casts etc. Fix up comments on some of the password hashAndrew Bartlett2002-07-201-4/+4
| | | | | | wrappers. Andrew Bartlett
* Add support for a weird behaviour apparently used by Win9X pass-throughAndrew Bartlett2002-07-201-2/+2
| | | | | | | | | | authentication - we can have an NT hash in the LM hash feild. (I need to double-check this fix with tpot, who discovered it). Also remove silly casts back and forth between uchar and char. Andrew Bartlett
* Two things: Check how many paramaters that the LDAP libs take for theAndrew Bartlett2002-06-161-4/+6
| | | | | | | | rebind proc (some give an extra paramter to pass a void* paramater) and some small changes for the SMB signing code to reset things when the signing starts, and to 'turn off' signing if the session setup failed. Andrew Bartlett
* Fix up some of the SMB signing code:Andrew Bartlett2002-06-161-0/+10
| | | | | | | | | | | | | The problem was that *all* packets were being signed, even packets before signing was set up. (This broke the session request). This fixes it to be an 'opt in' measure - that is, we only attempt to sign things after we have got a valid, non-guest session setup as per the CIFS spec. I've not tested this against an MS server, becouse my VMware is down, but at least it doesn't break the build farm any more. Andrew Bartlett
* Ok, now I can try my first client test...Jeremy Allison2002-06-141-0/+12
| | | | Jeremy.
* More of SMB signing for client - not yet finished (should be harmless).Jeremy Allison2002-06-141-0/+27
| | | | Jeremy.
* A couple of updates for the SmbEncrypt code, and some of its users.Andrew Bartlett2002-06-071-1/+1
| | | | | | | | | | (const, takes unix string as arg) Also update cli_full_connection to take NULL pointers as 'undefined' correctly, and therefore do its own lookup etc. This what was intended, but previously you needed to supply a 0.0.0.0 IP address. Andrew Bartlett
* Update some of the LM hash code to better respect the seperation betweenAndrew Bartlett2002-05-251-32/+41
| | | | | | | | | unix and DOS strings. This pushes all the 'have to uppercase, must be 14 chars' stuff behind the the interface. Andrew Bartlett
* This function is unused, and doesn't make any sense to me anyway.Andrew Bartlett2002-05-231-17/+0
| | | | | | | | Wasn't this what got us some of the bugs with big-endien smbpasswd -j FOO -U ? Anyway, it deserves to die. Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Add 'net rpc join' to match the ADS equiv.Andrew Bartlett2001-12-041-12/+5
| | | | | | | | | | | | | | | | This kills off the offending code in smbpasswd -j -Uab%c In the process we have changed from unsing compelatly random passwords to random, 15 char ascii strings. While this does produce a decrese in entropy, it is still vastly greater than we need, considering the application. In the meantime this allows us to actually *type* the machine account password duruign debugging. This code also adds a 'check' step to the join, confirming that the stored password does indeed do somthing of value :-) Andrew Bartlett
* Minor updates. A small dose of const.Andrew Bartlett2001-11-111-1/+1
|
* This is a farily large patch (3300 lines) and reworks most of the AuthRewriteAndrew Bartlett2001-10-311-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code. In particular this assists tpot in some of his work, becouse it provides the connection between the authenticaion and the vuid generation. Major Changes: - Fully malloc'ed structures. - Massive rework of the code so that all structures are made and destroyed using malloc and free, rather than hanging around on the stack. - SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them to be declared 'invalid' without the chance that people might get ROOT by default. - kill off some of the "DOMAIN\user" lookups. These can be readded at a more appropriate place (probably domain_client_validate.c) in the future. They don't belong in session setups. - Massive introduction of DATA_BLOB structures, particularly for passwords. - Use NTLMSSP flags to tell the backend what its getting, rather than magic lenghths. - Fix winbind back up again, but tpot is redoing this soon anyway. - Abstract much of the work in srv_netlog_nt back into auth helper functions. This is a LARGE change, and any assistance is testing it is appriciated. Domain logons are still broken (as far as I can tell) but other functionality seems intact. Needs testing with a wide variety of MS clients. Andrew Bartlett
* More const.Andrew Bartlett2001-10-311-2/+2
|
* This commit is number 4 of 4.Andrew Bartlett2001-10-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular this commit focuses on: Actually adding the 'const' to the passdb interface, and the flow-on changes. Also kill off the 'disp_info' stuff, as its no longer used. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes introduces a large dose of 'const' to the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username --- This finishes this line of commits off, your tree should now compile again :-) Andrew Bartlett
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-3/+0
|
* Kill unused variablesAndrew Bartlett2001-09-271-2/+0
|
* Make use of the pdb_set_plaintext_passwd() update to vastly simplifyAndrew Bartlett2001-09-261-49/+10
| | | | | | | | | | | decode_pw_buffer() and the samr password changing routines. And yes, I know that we can lost some information in the Unicode->UTF->Unicode bit of this, but its worth the code cleanup. This also takes into account the possability of multibyte passwords. Andrew Bartlett
* get rid of compiler warningsHerb Lewis2001-08-241-8/+8
|
* A rewrite of the error handling in the libsmb client code. I've separatedTim Potter2001-08-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | out the error handling into a bunch of separate functions rather than all being handled in one big function. Fetch error codes from the last received packet: void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num); uint32 cli_nt_error(struct cli_state *); Convert errors to UNIX errno values: int cli_errno_from_dos(uint8 eclass, uint32 num); int cli_errno_from_nt(uint32 status); int cli_errno(struct cli_state *cli); Detect different kinds of errors: BOOL cli_is_dos_error(struct cli_state *cli); BOOL cli_is_nt_error(struct cli_state *cli); BOOL cli_is_error(struct cli_state *cli); This also means we now support CAP_STATUS32 as we can decode and understand NT errors instead of just DOS errors. Yay! Ported a whole bunch of files in libsmb to use this new API instead of the just the DOS error.
* Changed the order of arguments in make_oem_passwd_hash(). All the otherTim Potter2001-08-101-1/+2
| | | | encryption functions have outputs as the last arguments.
* Throw out crappy (non-ascii unaware) mbtows stuff and use proper unicodeJeremy Allison2001-07-301-57/+6
| | | | | push calls. If this breaks authentication then good, it needed fixing anyway :-). Jeremy.
* Add backend encryption support for NTLMv2.Andrew Bartlett2001-07-071-1/+96
| | | | | | | | | | | | The leg-work for this was done by the folks at samba-tng.org, I'm just bringing it accross to HEAD. The MD5 implementation is seperatly derived, and does not have the copyright problems that the one in TNG has. Also add const to a few places where it makes sence. Andrew Bartlett
* The big character set handling changeover!Andrew Tridgell2001-07-041-30/+11
| | | | | | | This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation.
* Fixed W2K SP2 joining a Samba PDC hosted domain.Jeremy Allison2001-06-201-1/+1
| | | | Jermey.
* Merged encode_pw_buffer() and nt_owf_genW() functions from TNG branch.Tim Potter2001-06-151-0/+49
|
* merging from 2.2 to headAndrew Tridgell2001-04-221-17/+63
|
* last part of W2K support.Jean-François Micouleau2000-10-131-4/+5
| | | | | | | | | | | | the trust domain list reply on netlogon pipe was wrong, interim hack until we have full trust relationships. changed some unistr2 to parse the ending NULL char. added a prs_align_needed() function. much like a prs_align but with a condition. needed for the unistr2 parsing. J.F.
* changes to sync with 2.2. treeHerb Lewis2000-10-111-1/+1
| | | | | | | | | | | | | | | | | .cvsignore remove config.h - not in this directory include/profile.h profile changes lib/messages.c added message to return debug level libsmb/clierror.c cast to get rid of compiler warning libsmb/smbencrypt.c cast to get rid of compiler warning profile/profile.c add flush profile stats changes for profile struct rpc_parse/parse_samr.c fix for compiler warning rpc_server/srv_samr.c cast to get rid of compiler warning smbd/ipc.c profile stats message.c profile stats smbd/negprot.c profile stats smbd/nttrans.c profile stats smbd/trans2.c profile stats utils/smbcontrol.c new flush stats command
* added samr_set_user_info and info_2.Jean-François Micouleau2000-10-071-0/+44
| | | | | | | | | | | | | | cleanup of create_user cleanup of rid/sid mix in samr. now we only have sid. some prs_align() missing in parse_samr.c a small debug change in srv_pipe.c You still can't change a user's password in this commit. Will be availble in the next one. J.F.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-415/+66
|
* sys_select added one more argument (read, write selectors).Luke Leighton1999-12-011-52/+50
|
* previous commit added an abstraction function that didn't even haveLuke Leighton1999-11-251-6/+3
| | | | | struct cli_state, uint16 fnum into the code: rpc_hnd_api_req(). modified cli_lsarpc.c to use this. the rest is const issues.
* implement server-side generation of NTLMv2 session key. YESSS :-)Luke Leighton1999-11-211-0/+28
|
* you know what? this sort of thing makes me laugh. hmm, what functionsLuke Leighton1999-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | have we got. and what data do we have. hmm.. i wonder what the NTLMv2 user session key can be... hmmm... weell.... there's some hidden data here, generated from the user password that doesn't go over-the-wire, so that's _got_ to be involved. and... that bit of data took a lot of computation to produce, so it's probably _also_ involved... and md4 no, md5? no, how about hmac_md5 yes let's try that one (the other's didn't work) oh goodie, it worked! i love it when this sort of thing happens. took all of fifteen minutes to guess it. tried concatenating client and server challenges. tried concatenating _random_ bits of client and server challenges. tried md5 of the above. tried hmac_md5 of the above. eventually, it boils down to this: kr = MD4(NT#,username,domainname) hmacntchal=hmac_md5(kr, nt server challenge) sess_key = hmac_md5(kr, hmacntchal);
* The First Necessary UNICODE String Support.Luke Leighton1999-11-191-19/+67
| | | | | | | | | the random workstation trust account password is TOTAL garbage. i mean, complete garbage. it's nowhere CLOSE to being a UNICODE string. therefore we can't just take every second character. created nt_owf_genW() which creates NT#(password) instead of NT#(Unicode(pw)). followed through to the password setting in srv_samr.c
* samuserset <username> -p password. YESSSSS :)Luke Leighton1999-11-041-0/+11
| | | | you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
* adding experimental set user password command to rpcclient, it returnsLuke Leighton1999-11-041-0/+66
| | | | error wrong password against nt. ????
* adding CAP_EXTENDED_SECURITY support in a hurry last week. forgot toLuke Leighton1999-10-141-0/+29
| | | | deal with linking issues in other binaries
* removed old code/comments.Luke Leighton1999-06-291-66/+0
|
* smbclient modified to use cli_establish_connection(). smbclient thereforeLuke Leighton1999-06-291-5/+11
| | | | | | now uses improved authentication. smbclient now "broken" for "scripts" based on DEBUG() output. cli_establish_connection() requires modification to support old scripts.
* improving authentication code (tidyup).Luke Leighton1999-06-291-42/+229
|
* fixed issues with "Welcome to SAMBA Domain" for when admin user/pass isLuke Leighton1999-03-251-1/+1
| | | | | used to add workstation to domain. unix account db not modified: only SAM password db is used.
* NULL pointer handling in nt_lm_owf_genLuke Leighton1999-03-241-1/+4
|
* return type of nt_decrypt_string2 set to BOOL.Luke Leighton1999-03-191-4/+3
|
* Implemented encryption algorithm used for a number of RPC buffers.Matthew Chapman1999-03-191-0/+45
| | | | | | | (actually, decryption only currently because I need to get some sleep). Basically another Microsoft twist on DES; the "master key" is the user's NT hash MD4'd and subsets of this are chosen as the 56-bit DES keys.
* UNICODE cleanup (see lib/util_unistr.c).Matthew Chapman1999-02-121-1/+1
| | | | | | No more ugly static library buffers and all functions take a destination string length (especially unistrcpy was rather dangerous; we were only saved by the fact that datagrams are limited in size).
* the UNICODE issue...Luke Leighton1999-02-111-1/+1
|
* UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL()Luke Leighton1999-02-081-1/+1
|