summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-05-09 13:07:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:51 -0500
commit59c8f48f0dfc0e4d42623fe1595cd9773ac5d15f (patch)
tree231e322dee12b1a9573a0853fcaa1b0ba3a3f1f3 /source4/libcli
parentdce84ffd379012812170f68f7de8aab73123f0b3 (diff)
downloadsamba-59c8f48f0dfc0e4d42623fe1595cd9773ac5d15f.tar.gz
samba-59c8f48f0dfc0e4d42623fe1595cd9773ac5d15f.tar.bz2
samba-59c8f48f0dfc0e4d42623fe1595cd9773ac5d15f.zip
r611: Fix breakage from my last commit:
Now that all session keys are DATA_BLOBs, fix the callers. This assumes some things about the behaviour of certain crypto algorithms, without the ability to test it on session keys != 16 bytes in length. We will just need to retest when we get the KRB5 support in (DES keys are 8 bytes). Andrew Bartlett (This used to be commit e4355a7ec1eba92bdecef8cc478272897276dbae)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/auth/session.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/libcli/auth/session.c b/source4/libcli/auth/session.c
index 946b0fe62f..77eb1a6527 100644
--- a/source4/libcli/auth/session.c
+++ b/source4/libcli/auth/session.c
@@ -29,7 +29,7 @@
before calling, the out blob must be initialised to be the same size
as the in blob
*/
-void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const uint8 session_key[16],
+void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const DATA_BLOB *session_key,
BOOL forward)
{
int i, k;
@@ -42,10 +42,10 @@ void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const uint8 session_ke
memset(bin, 0, 8);
memcpy(bin, &in->data[i], MIN(8, in->length-i));
- if (k + 7 > 16) {
- k = (16 - k);
+ if (k + 7 > session_key->length) {
+ k = (session_key->length - k);
}
- memcpy(key, &session_key[k], 7);
+ memcpy(key, &session_key->data[k], 7);
smbhash(bout, bin, key, forward?1:0);
@@ -62,7 +62,7 @@ void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const uint8 session_ke
caller should free using data_blob_free()
*/
-DATA_BLOB sess_encrypt_string(const char *str, const uint8 session_key[16])
+DATA_BLOB sess_encrypt_string(const char *str, const DATA_BLOB *session_key)
{
DATA_BLOB ret, src;
int slen = strlen(str);
@@ -96,7 +96,7 @@ DATA_BLOB sess_encrypt_string(const char *str, const uint8 session_key[16])
caller should free the returned string
*/
-char *sess_decrypt_string(DATA_BLOB *blob, const uint8 session_key[16])
+char *sess_decrypt_string(DATA_BLOB *blob, const DATA_BLOB *session_key)
{
DATA_BLOB out;
int slen;