From dce84ffd379012812170f68f7de8aab73123f0b3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 9 May 2004 12:42:18 +0000 Subject: r610: - Merge the Samba3 'ntlm_auth --diagnostics' testsuite to Samba4. - This required using NETLOGON_NEG_AUTH2_FLAGS for the SetupCredentials2 negotiation flags, which is what Samba3 does, because otherwise the server uses different crypto. - This tests the returned session keys, which we decrypt. - Update the Samba4 notion of a 'session key' to be a DATA_BLOB in most places. - Fix session key code to return NT_STATUS_NO_SESSION_KEY if none is available. - Remove a useless argument to SMBsesskeygen_ntv1 - move netr_CredentialState from the .idl to the new credentials.h Andrew Bartlett (This used to be commit 44f8b5b53e6abd4de8a676f78d729988fadff320) --- source4/libcli/util/smbdes.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source4/libcli/util/smbdes.c') diff --git a/source4/libcli/util/smbdes.c b/source4/libcli/util/smbdes.c index 80b938b460..22bafcb449 100644 --- a/source4/libcli/util/smbdes.c +++ b/source4/libcli/util/smbdes.c @@ -338,14 +338,14 @@ void cred_hash1(unsigned char *out, const unsigned char *in, const unsigned char smbhash(out, buf, key+9, 1); } -void cred_hash2(unsigned char *out, const unsigned char *in, const unsigned char *key) +void cred_hash2(unsigned char *out, const unsigned char *in, const unsigned char *key, int forw) { unsigned char buf[8]; unsigned char key2[8]; ZERO_STRUCT(key2); - smbhash(buf, in, key, 1); + smbhash(buf, in, key, forw); key2[0] = key[7]; - smbhash(out, buf, key2, 1); + smbhash(out, buf, key2, forw); } void cred_hash3(unsigned char *out, unsigned char *in, const unsigned char *key, int forw) @@ -401,12 +401,11 @@ void SamOEMhashBlob(unsigned char *data, int len, const DATA_BLOB *key) */ void SamOEMhash(unsigned char *data, const unsigned char keystr[16], int len) { - DATA_BLOB key; - - key.length = 16; - key.data = keystr; + DATA_BLOB key = data_blob(keystr, 16); SamOEMhashBlob(data, len, &key); + + data_blob_free(&key); } -- cgit