1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r5877: It is not an error to have a zero-length secret, after decryption.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2005-03-18 03:17:30 +00:00 committed by Gerald (Jerry) Carter
parent 08b47e2dc0
commit b484776cc4

View File

@ -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;
}