diff options
author | Andreas Schneider <asn@samba.org> | 2019-11-13 09:41:18 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-11-14 08:01:44 +0000 |
commit | e4ae1ba451d408b3b5c74d303493cb7c38e6e1c8 (patch) | |
tree | 2fb6d07c3f0ff3ffe881dc55971c58f64de524c6 | |
parent | 2c21cd6d49d56611acb2f364473d8c2e73e74545 (diff) | |
download | samba-e4ae1ba451d408b3b5c74d303493cb7c38e6e1c8.tar.gz |
libcli:auth: Check return status of netlogon_creds_init_64bit()
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 | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c index 1c01930a9d9..36d0368d198 100644 --- a/libcli/auth/credentials.c +++ b/libcli/auth/credentials.c @@ -51,10 +51,10 @@ static void netlogon_creds_step_crypt(struct netlogon_creds_CredentialState *cre this call is made after the netr_ServerReqChallenge call */ -static void netlogon_creds_init_64bit(struct netlogon_creds_CredentialState *creds, - const struct netr_Credential *client_challenge, - const struct netr_Credential *server_challenge, - const struct samr_Password *machine_password) +static NTSTATUS netlogon_creds_init_64bit(struct netlogon_creds_CredentialState *creds, + const struct netr_Credential *client_challenge, + const struct netr_Credential *server_challenge, + const struct samr_Password *machine_password) { uint32_t sum[2]; uint8_t sum2[8]; @@ -68,6 +68,8 @@ static void netlogon_creds_init_64bit(struct netlogon_creds_CredentialState *cre ZERO_ARRAY(creds->session_key); des_crypt128(creds->session_key, sum2, machine_password->hash); + + return NT_STATUS_OK; } /* @@ -458,7 +460,14 @@ struct netlogon_creds_CredentialState *netlogon_creds_client_init(TALLOC_CTX *me return NULL; } } else { - netlogon_creds_init_64bit(creds, client_challenge, server_challenge, machine_password); + status = netlogon_creds_init_64bit(creds, + client_challenge, + server_challenge, + machine_password); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(creds); + return NULL; + } } netlogon_creds_first_step(creds, client_challenge, server_challenge); @@ -624,8 +633,14 @@ struct netlogon_creds_CredentialState *netlogon_creds_server_init(TALLOC_CTX *me return NULL; } } else { - netlogon_creds_init_64bit(creds, client_challenge, server_challenge, - machine_password); + status = netlogon_creds_init_64bit(creds, + client_challenge, + server_challenge, + machine_password); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(creds); + return NULL; + } } netlogon_creds_first_step(creds, client_challenge, server_challenge); |