diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-11-25 11:48:41 +1300 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2022-12-14 00:48:48 +0100 |
commit | 590228fd72f66412a8188b3b09d2d71e91b0d568 (patch) | |
tree | 7cb75251a15ba2b0afdf867681b38f5ef41b5328 | |
parent | eefa55320558ce8da7fb9d90038c2f778487da44 (diff) | |
download | samba-590228fd72f66412a8188b3b09d2d71e91b0d568.tar.gz |
CVE-2022-37966 auth/credentials: Allow specifying password to cli_credentials_get_aes256_key()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
[This is 4.15 only]
-rw-r--r-- | auth/credentials/credentials.h | 1 | ||||
-rw-r--r-- | auth/credentials/credentials_krb5.c | 7 |
2 files changed, 2 insertions, 6 deletions
diff --git a/auth/credentials/credentials.h b/auth/credentials/credentials.h index e9d8b8a44b1..6fd43472ae0 100644 --- a/auth/credentials/credentials.h +++ b/auth/credentials/credentials.h @@ -347,6 +347,7 @@ NTSTATUS netlogon_creds_session_encrypt( int cli_credentials_get_aes256_key(struct cli_credentials *cred, TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, + const char *password, const char *salt, DATA_BLOB *aes_256); diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index db0842be66c..39b7b8dd57e 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -1462,13 +1462,13 @@ _PUBLIC_ void cli_credentials_set_target_service(struct cli_credentials *cred, c _PUBLIC_ int cli_credentials_get_aes256_key(struct cli_credentials *cred, TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, + const char *password, const char *salt, DATA_BLOB *aes_256) { struct smb_krb5_context *smb_krb5_context = NULL; krb5_error_code krb5_ret; int ret; - const char *password = NULL; krb5_data cleartext_data; krb5_data salt_data; krb5_keyblock key; @@ -1478,11 +1478,6 @@ _PUBLIC_ int cli_credentials_get_aes256_key(struct cli_credentials *cred, return EINVAL; } - password = cli_credentials_get_password(cred); - if (password == NULL) { - return EINVAL; - } - cleartext_data.data = discard_const_p(char, password); cleartext_data.length = strlen(password); |