summaryrefslogtreecommitdiff
path: root/source4/libcli/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-10-09 13:03:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:35 -0500
commit43adda56b6a175fa2a9e4c6f20ca921e0b1c5fab (patch)
tree9601c773d969813de0b8e9c751b14364d3908107 /source4/libcli/auth
parentb468ba1386166cfe2f026051b205468de1c6103e (diff)
downloadsamba-43adda56b6a175fa2a9e4c6f20ca921e0b1c5fab.tar.gz
samba-43adda56b6a175fa2a9e4c6f20ca921e0b1c5fab.tar.bz2
samba-43adda56b6a175fa2a9e4c6f20ca921e0b1c5fab.zip
r10847: Fix up new 'decrypt samlogon reply' routine to be more robust, and use
it in the RPC-SAMLOGON test. Andrew Bartlett (This used to be commit 675b7df2eedbcb7ea89c0411f76429d8e2357222)
Diffstat (limited to 'source4/libcli/auth')
-rw-r--r--source4/libcli/auth/credentials.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source4/libcli/auth/credentials.c b/source4/libcli/auth/credentials.c
index 7cfccf446c..3f055a657d 100644
--- a/source4/libcli/auth/credentials.c
+++ b/source4/libcli/auth/credentials.c
@@ -322,18 +322,32 @@ void creds_decrypt_samlogon(struct creds_CredentialState *creds,
{
static const char zeros[16];
- struct netr_SamBaseInfo *base;
+ struct netr_SamBaseInfo *base = NULL;
switch (validation_level) {
case 2:
- base = &validation->sam2->base;
+ if (validation->sam2) {
+ base = &validation->sam2->base;
+ }
break;
case 3:
- base = &validation->sam3->base;
+ if (validation->sam3) {
+ base = &validation->sam3->base;
+ }
break;
case 6:
- base = &validation->sam6->base;
+ if (validation->sam6) {
+ base = &validation->sam6->base;
+ }
break;
+ default:
+ /* If we can't find it, we can't very well decrypt it */
+ return;
}
+
+ if (!base) {
+ return;
+ }
+
/* find and decyrpt the session keys, return in parameters above */
if (validation_level == 6) {
/* they aren't encrypted! */