]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth/credentials: remove unused netlogon_creds_session_encrypt()
authorStefan Metzmacher <metze@samba.org>
Mon, 28 Oct 2024 14:44:07 +0000 (15:44 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 30 Oct 2024 23:08:36 +0000 (23:08 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
auth/credentials/credentials.c
auth/credentials/credentials.h

index aade70cd2c131e49d4249fcef364724401bf3aca..a88a458f82bde29e2d390544841ab0c865c69818 100644 (file)
@@ -1996,49 +1996,3 @@ cli_credentials_get_smb_encryption(struct cli_credentials *creds)
 {
        return creds->encryption_state;
 }
-
-/**
- * Encrypt a data blob using the session key and the negotiated encryption
- * algorithm
- *
- * @param state Credential state, contains the session key and algorithm
- * @param data Data blob containing the data to be encrypted.
- *
- */
-_PUBLIC_ NTSTATUS netlogon_creds_session_encrypt(
-       struct netlogon_creds_CredentialState *state,
-       DATA_BLOB data)
-{
-       NTSTATUS status;
-
-       if (data.data == NULL || data.length == 0) {
-               DBG_ERR("Nothing to encrypt "
-                       "data.data == NULL or data.length == 0\n");
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-       /*
-        * Don't crypt an all-zero password it will give away the
-        * NETLOGON pipe session key .
-        */
-       if (all_zero(data.data, data.length)) {
-               DBG_ERR("Supplied data all zeros, could leak session key\n");
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-       if (state->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
-               status = netlogon_creds_aes_encrypt(state,
-                                                   data.data,
-                                                   data.length);
-       } else if (state->negotiate_flags & NETLOGON_NEG_ARCFOUR) {
-               status = netlogon_creds_arcfour_crypt(state,
-                                                     data.data,
-                                                     data.length);
-       } else {
-               DBG_ERR("Unsupported encryption option negotiated\n");
-               status = NT_STATUS_NOT_SUPPORTED;
-       }
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
-}
-
index 4a39899e751053e0687ca3db7c439a02f686f0af..cae6a94b4507cbe649ffd61cdeb4b2390190dddb 100644 (file)
@@ -357,10 +357,6 @@ void cli_credentials_dump(struct cli_credentials *creds);
  */
 struct netlogon_creds_CredentialState *cli_credentials_get_netlogon_creds(struct cli_credentials *cred);
 
-NTSTATUS netlogon_creds_session_encrypt(
-       struct netlogon_creds_CredentialState *state,
-       DATA_BLOB data);
-
 /**
  * Kerberos FAST handling
  */