summaryrefslogtreecommitdiff
path: root/source4/libcli/auth/credentials.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/auth/credentials.c')
-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! */