summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-03-18 03:17:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:06 -0500
commit928af7e6ff8f9051d0e7827ffea2dfa432692d63 (patch)
tree91c21223497bac503612f75f3010cc1e1b347190
parent00ac91fa29588fff203a25f9cb916169884ad89d (diff)
downloadsamba-928af7e6ff8f9051d0e7827ffea2dfa432692d63.tar.gz
samba-928af7e6ff8f9051d0e7827ffea2dfa432692d63.tar.bz2
samba-928af7e6ff8f9051d0e7827ffea2dfa432692d63.zip
r5877: It is not an error to have a zero-length secret, after decryption.
Andrew Bartlett (This used to be commit b484776cc4d48690d45c668f9253015eb0d6207d)
-rw-r--r--source4/libcli/auth/session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/libcli/auth/session.c b/source4/libcli/auth/session.c
index 9b4132a490..fda0aab055 100644
--- a/source4/libcli/auth/session.c
+++ b/source4/libcli/auth/session.c
@@ -178,6 +178,8 @@ NTSTATUS sess_decrypt_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const DAT
int slen;
if (blob->length < 8) {
+ DEBUG(0, ("Unexpected length %d in session crypted secret (BLOB)\n",
+ blob->length));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -189,19 +191,19 @@ NTSTATUS sess_decrypt_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const DAT
sess_crypt_blob(&out, blob, session_key, False);
if (IVAL(out.data, 4) != 1) {
- DEBUG(0,("Unexpected revision number %d in session crypted string\n",
+ DEBUG(0,("Unexpected revision number %d in session crypted secret (BLOB)\n",
IVAL(out.data, 4)));
return NT_STATUS_UNKNOWN_REVISION;
}
slen = IVAL(out.data, 0);
if (slen > blob->length - 8) {
- DEBUG(0,("Invalid crypt length %d\n", slen));
+ DEBUG(0,("Invalid crypt length %d in session crypted secret (BLOB)\n", slen));
return NT_STATUS_WRONG_PASSWORD;
}
*ret = data_blob_talloc(mem_ctx, out.data+8, slen);
- if (!ret->data) {
+ if (slen && !ret->data) {
return NT_STATUS_NO_MEMORY;
}