diff options
author | Andreas Schneider <asn@samba.org> | 2019-11-13 09:39:19 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-11-14 08:01:44 +0000 |
commit | 2c21cd6d49d56611acb2f364473d8c2e73e74545 (patch) | |
tree | 646478e49331c9fd7592f99e2ba1aca2dd6f9647 | |
parent | fbfb11b0f7ebd69cc4b1b545b398a367720d5473 (diff) | |
download | samba-2c21cd6d49d56611acb2f364473d8c2e73e74545.tar.gz |
libcli:auth: Check return value of netlogon_creds_init_128bit()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | libcli/auth/credentials.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c index baa436df71b..1c01930a9d9 100644 --- a/libcli/auth/credentials.c +++ b/libcli/auth/credentials.c @@ -580,6 +580,8 @@ struct netlogon_creds_CredentialState *netlogon_creds_server_init(TALLOC_CTX *me { struct netlogon_creds_CredentialState *creds = talloc_zero(mem_ctx, struct netlogon_creds_CredentialState); + NTSTATUS status; + if (!creds) { return NULL; @@ -604,8 +606,6 @@ struct netlogon_creds_CredentialState *netlogon_creds_server_init(TALLOC_CTX *me } if (negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) { - NTSTATUS status; - status = netlogon_creds_init_hmac_sha256(creds, client_challenge, server_challenge, @@ -615,8 +615,14 @@ struct netlogon_creds_CredentialState *netlogon_creds_server_init(TALLOC_CTX *me return NULL; } } else if (negotiate_flags & NETLOGON_NEG_STRONG_KEYS) { - netlogon_creds_init_128bit(creds, client_challenge, server_challenge, - machine_password); + status = netlogon_creds_init_128bit(creds, + client_challenge, + server_challenge, + machine_password); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(creds); + return NULL; + } } else { netlogon_creds_init_64bit(creds, client_challenge, server_challenge, machine_password); |